You may run it on your own computer. Then you'll get the all answers. Then......Got AC!!! I ran the program for 2.5 hours in all!!! Yes, it was interesting to find all simple numbers in range 3 .. 65521 (There is only 6541 simple number in this range!) and calculate answer for each of them using SMART brute-force. It had taken only 17 minutes! And AC program weights about 91501 bytes! How to solve this problem by maths? Read "Introduction to Algorithms", chapter 33 - modular arithmetics, group generators, Lagrange theorem, etc. 17 minutes? What kind of so called "smart brute-force"? You can send to fujieyun@163.com to tell me your way. Thanks. Edited by author 09.09.2005 00:20 How did you reach this time? Ok. I submited it. My worked 27 sec. Vladimir Yakovlev(USU) 91501 bytes > 64000 bytes Where rejudge? P.S. I too got AC with cheating [ 38kb ]. I think 38Kb it's enough, because to solve this problem with cheating you need only one array [1..6541] of word constans. Please, send me your solution my E-mail: xujand000@rambler.ru for n are: 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 and 53 K : 2, 3, 5, 8, 11, 14, 15, 21, 27, 24, 35, 35, 34, 45 and 51 is right? for n are: 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 and 53 K : 2, 3, 5, 8, 11, 14, 15, 21, 27, 24, 35, 35, 34, 45 and 51 is right? Yes, it's right! Why the answer for 41 is 35? if k=35, then doomsday will be 22th attempt. but if k = 39, the repetition will be after 42 sleep. |