随笔分类 -  数论

摘要:Problem DescriptionAcellular automatonis a collection of cells on a grid of specified shape that evolves through a number of discrete time steps according to a set of rules that describe the new state of a cell based on the states of neighboring cells. Theorder of the cellular automatonis the number 阅读全文
posted @ 2014-01-29 15:13 persistent codeants 阅读(906) 评论(0) 推荐(0)
摘要:Problem DescriptionImagine you are attending your math lesson at school. Once again, you are bored because your teacher tells things that you already mastered years ago (this time he's explaining that (a+b)2=a2+2ab+b2). So you decide to waste your time with drawing modern art instead.Fortunately 阅读全文
posted @ 2014-01-19 16:36 persistent codeants 阅读(536) 评论(0) 推荐(0)
摘要:Problem DescriptionTransmitting and memorizing information is a task that requires different coding systems for the best use of the available space. A well known system is that one where a number is associated to a character sequence. It is considered that the words are made only of small characters 阅读全文
posted @ 2014-01-19 15:19 persistent codeants 阅读(424) 评论(0) 推荐(0)
摘要:Problem DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of other names) in order to make arbitrary decisions such as who gets to be milked first. The 阅读全文
posted @ 2014-01-19 10:53 persistent codeants 阅读(343) 评论(0) 推荐(0)
摘要:DescriptionHow many zeros are there in the end ofs!if bothsands!are written in basekwhich is not necessarily to be 10? For general base, the digit order is 0-9,A-Z,a-z(increasingly), for example F4 in base 46 is actually 694 in base 10,and f4 in base 46 is 1890 in base 10.InputThere are multiple cas 阅读全文
posted @ 2013-11-23 21:29 persistent codeants 阅读(330) 评论(0) 推荐(0)
摘要:Problem DescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...Sk. Each group Sk consists of a sequence of positive integer numbers ranging from 1 to k, written one after another.For example, the first 80 d 阅读全文
posted @ 2013-10-23 18:53 persistent codeants 阅读(203) 评论(0) 推荐(0)
摘要:Problem DescriptionConsider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901).InputThe only line contains the two natural numbers A and B, (0 2 #include 3 #include 4 5 #define SIZE_N 10000 6 #define MODE 99.. 阅读全文
posted @ 2013-10-22 21:09 persistent codeants 阅读(348) 评论(0) 推荐(0)
摘要:Problem DescriptionA Compiler Mystery: We are given a C-language style for loop of typefor (variable = A; variable != B; variable += C) statement;I.e., a loop which starts by setting variable to value A and while variable is not equal to B, repeats statement followed by increasing the variable by C. 阅读全文
posted @ 2013-10-22 09:03 persistent codeants 阅读(248) 评论(0) 推荐(0)
摘要:Problem DescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there is a corresponding m containing no more than 100 decimal digits.InputThe input f 阅读全文
posted @ 2013-10-11 21:52 persistent codeants 阅读(629) 评论(0) 推荐(0)
摘要:1049. Brave BalloonistsTime limit: 2.0 second Memory limit: 64 MBTen mathematicians are flying on a balloon over the Pacific ocean. When they are crossing the equator they decide to celebrate this event and open a bottle of champagne. Unfortunately, the cork makes a hole in the balloon. Hydrogen is 阅读全文
posted @ 2013-08-11 10:19 persistent codeants 阅读(258) 评论(0) 推荐(0)