
算法
文章平均质量分 77
reiliu
这个作者很懒,什么都没留下…
展开
-
Big Integer 大数求模
DescriptionLong long ago, there was a super computer that could deal with VeryLongIntegers(no VeryLongInteger will be negative). Do you know how this computer stores the VeryLongIntegers? This com原创 2012-10-09 08:23:19 · 1100 阅读 · 0 评论 -
sicily 1000. 3n+1数链问题
Description在计算机科学上,有很多类问题是无法解决的,我们称之为不可解决问题。然而,在很多情况我们并不知道哪一类问题可以解决,那一类问题不可解决。现在我们就有这样一个问题,问题如下:1. 输入一个正整数n;2. 把n显示出来;3. 如果n=1则结束;4. 如果n是奇数则n变为3n+1 ,否则n变为n/2;5.原创 2012-12-17 17:09:32 · 760 阅读 · 0 评论 -
sicily 1515. 魔版C[Special judge]
Description魔板由8个大小相同方块组成,分别用涂上不同颜色,用1到8的数字表示。其初始状态是1 2 3 45 6 7 8对魔板可进行三种基本操作:A操作(左右两列互换):3 4 1 27 8 5 6B操作(每次以行循环左移一个):2 3 4 16 7 8 5C操作(中间四小块逆时针转一格):1 3 7 45 2 6 8用上述原创 2012-10-22 18:54:11 · 1156 阅读 · 0 评论 -
sicily 1150&1151 魔板[Special judge]
Description魔板由8个大小相同方块组成,分别用涂上不同颜色,用1到8的数字表示。其初始状态是1 2 3 48 7 6 5对魔板可进行三种基本操作:A操作(上下行互换):8 7 6 51 2 3 4B操作(每次以行循环右移一个):4 1 2 35 8 7 6C操作(中间四小块顺时针转一格):1 7 2 48 6 3 5用上述三原创 2012-10-22 16:13:36 · 723 阅读 · 0 评论 -
sicily 1156. Binary tree二叉树
DescriptionYour task is very simple: Given a binary tree, every node of which contains one upper case character (‘A’ to ‘Z’); you just need to print all characters of this tree in pre-order.In原创 2012-10-29 17:38:33 · 859 阅读 · 0 评论 -
Two Ends
DescriptionIn the two-player game "Two Ends", an even number of cards is laid out in a row. On each card, face up, is written a positive integer. Players take turns removing a card from either end原创 2012-10-18 11:33:03 · 943 阅读 · 0 评论 -
Plane Spotting
DescriptionCraig is fond of planes. Making photographs of planes forms a major part of his daily life. Since he tries to stimulate his social life, and since it’s quite a drive from his home to th原创 2012-10-18 10:00:31 · 768 阅读 · 0 评论 -
Printer Queue打印队列
DescriptionThe only printer in the computer science students' union is experiencing an extremely heavy workload. Sometimes there are a hundred jobs in the printer queue and you may have to wait fo原创 2012-10-16 00:06:35 · 1393 阅读 · 0 评论 -
Crypto Columns加密列
DescriptionThe columnar encryption scheme scrambles the letters in a message (or plaintext) using a keyword as illustrated in the following example: Suppose BATBOY is the keyword and our message i原创 2012-10-11 11:11:19 · 702 阅读 · 0 评论 -
To and Fro简单加密
DescriptionMo and Larry have devised a way of encrypting messages. They first decide secretly on the number of columns and write the message (letters only) down the columns, padding with extra ran原创 2012-10-11 09:39:28 · 581 阅读 · 0 评论 -
Substring子序列
DescriptionDr lee cuts a string S into N pieces,s[1],…,s[N]. Now, Dr lee gives you these N sub-strings: s[1],…s[N]. There might be several possibilities that the string S could be. For example原创 2012-10-09 08:40:14 · 555 阅读 · 0 评论 -
Biker's Trip Odomete
DescriptionMost bicycle speedometers work by using a Hall Effect sensor fastened to the front fork of the bicycle. A magnet is attached to one of the spokes on the front wheel so that it will line原创 2012-10-09 08:37:32 · 902 阅读 · 0 评论 -
DNA matching匹配问题
DescriptionDNA (Deoxyribonucleic acid) is founded in every living creature as the storage medium for genetic information. It is comprised of subunits called nucleotides that are strung together in原创 2012-10-09 08:34:26 · 879 阅读 · 0 评论 -
MJ, Nowhere to Hide马甲账号无处可藏
DescriptionOn BBS, there is a familiar term called MJ (short for MaJia), which means another BBS ID of one person besides his/her main ID.These days, a lot of ACMers pour water on the ACMICPC Bo原创 2012-10-09 08:31:42 · 1043 阅读 · 0 评论 -
Couples 夫妻配对
DescriptionN couples are standing in a circle, numbered consecutively clockwise from 1 to 2N. Husband and wife do not always stand together. We remove the couples who stand together until the circ原创 2012-10-09 08:28:38 · 1185 阅读 · 0 评论 -
sicily 1294 高级机密
Description 在很多情况下,我们需要对信息进行加密。特别是随着Internet的飞速发展,加密技术就显得尤为重要。 很早以前,罗马人为了在战争中传递信息,频繁地使用替换法进行信息加密。然而在计算机技术高速发展的今天,这种替换法显得不堪一击。因此密码研究人员正在试图寻找一种易于编码、但不易于解码的编码规则。 目前比较流行的编码规则称为RSA,原创 2012-12-18 10:42:27 · 1141 阅读 · 0 评论