1.1 字符串
~千溪杂谈(随风而逝)~
北京交通大学本科
中国科学院硕士
蚂蚁集团-高级技术专家
展开
-
UVa10878 - Decode the tape
代码如下: #include #include char str[20]; int main() { int value; // ASCII char c; //freopen("10878.txt","r",stdin); gets(str); while(gets(str)&&str[0]!='_') { value=0;原创 2014-05-22 16:43:50 · 495 阅读 · 0 评论 -
UVa_1339 - Ancient Cipher
Ancient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and the capital in encrypted form t原创 2014-10-16 23:25:48 · 474 阅读 · 0 评论 -
UVA_202 - Repeating Decimals
Repeating Decimals The decimal expansion of the fraction 1/33 is , where the is used to indicate that the cycle 03 repeats indefinitely with no intervening digits. In fact, the decimal原创 2014-10-14 21:23:30 · 512 阅读 · 0 评论 -
UVA_10340 - All in All
Problem E All in All Input: standard input Output: standard output Time Limit: 2 seconds Memory Limit: 32 MB You have devised a new encryption technique which encodes a message by inserting betw原创 2014-10-14 23:42:46 · 471 阅读 · 0 评论 -
UVA_1368 - DNA Consensus String
Figure 1. DNA (Deoxyribonucleic Acid) is the molecule which contains the genetic instructions. It consists of four different nucleotides, namely Adenine, Thymine, Guanine, and Cytosine as shown in原创 2014-10-14 14:06:46 · 402 阅读 · 0 评论 -
UVA_227 - Puzzle
Puzzle A children's puzzle that was popular 30 years ago consisted of a 5x5 framewhich contained 24 small squares of equal size. A unique letter of thealphabet was printed on each small sq原创 2014-10-14 00:40:57 · 3932 阅读 · 0 评论 -
UVa_512 - Spreadsheet Tracking
Spreadsheet Tracking Data in spreadsheets are stored in cells, which are organized in rows (r) andcolumns (c). Some operations onspreadsheets can be applied to single cells (r,c), while ot原创 2014-10-21 23:40:34 · 3465 阅读 · 4 评论 -
UVa_409 - Excuses, Excuses!
字符串匹配题,思路很简单,但是一些细节需要注意原创 2014-05-27 18:53:29 · 446 阅读 · 0 评论 -
UVa 537 - Artificial Intelligence?
好久没写代码,好手生,字符题原创 2014-05-21 19:49:19 · 519 阅读 · 0 评论 -
UVa_644 - Immediate Decodability
简单模拟题,依次读入编码,比较是否一编码是另一前缀即可。 有两种比较方式, (1)把所有编码全读入后,再进行判断; (2)边读入边比较,同时判断 二者比较次数相同,时间复杂度相同,看个人喜好。 代码如下: #include #include using namespace std; char str[8][11]; int main() { int i=0,j,k,cases原创 2014-05-22 20:02:11 · 455 阅读 · 0 评论 -
周期串
如果一个字符串可以由某个长度为k的字符串重复多次得到,该串以k为周期。例如:abcabcabc以3为最小周期。输入一个长度不超过80的串,输出其最小周期。 输入:abcabcabc 输出:3 分析: 关键是如何判定是重复串 1.可以枚举周期长度,然后依次判定; 2.假定周期为i时,则len%i==0(len为字符串长度),否则i不可能是周期; 3.字符串第一个周期字符的小标原创 2014-01-02 23:35:52 · 616 阅读 · 0 评论 -
UVa_10115 - Automatic Editing(POJ 1572)
简单模拟题,用C++的string操作非常简单。 代买原创 2014-05-21 21:39:42 · 472 阅读 · 0 评论 -
UVa_489 - Hangman Judge
Hangman Judge In ``Hangman Judge,'' you are to write a program that judges a series of Hangman games. For each game, the answer to the puzzle is given as well as the guesses. Rules are the原创 2014-10-17 00:00:13 · 391 阅读 · 0 评论