Codeforces Round 315 (Div. 1)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
568 Codeforces Round 315 (Div. 1) FINISHED False 7200 292598999 Aug. 10, 2015, 4:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5117 ) A Primes or Palindromes? PROGRAMMING brute force implementation math number theory 1700

B'Rikhail Mubinchik believes that the current definition of prime numbers is obsolete as they are too complex and unpredictable. A palindromic number is another matter. It is aesthetically pleasing, and it has a number of remarkable properties. Help Rikhail to convince the scientific community in this! Let us remind you that a number is called prime if it is integer larger than one, and is not divisible by any positive integer other than itself and one. Rikhail calls a number a palindromic if it is integer, positive, and its decimal representation without leading zeros is a palindrome, i.e. reads the same from left to right and right to left. One problem with prime numbers is that there are too many of them. Let 's introduce the following notation: xcf x80(n) -- the number of primes no larger than n, rub(n) -- the number of palindromic numbers no larger than n. Rikhail wants to prove that there are a lot more primes than palindromic ones. He asked you to solve the following problem: for a given value of the coefficient A find the maximum n, such that xcf x80(n) xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89A xc2 xb7rub(n). The input consists of two positive integers p, q, the numerator and denominator of the fraction that is the value of A (, ). If such maximum number exists, then print it. Otherwise, print "Palindromic tree is better than splay tree" (without the quotes).'...

Tutorials

Codeforces Round #315 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
51087995 vjudge2 A March 9, 2019, 1:44 p.m. OK Clang++17 Diagnostics TESTS 27 576 0 1700
51087989 vjudge3 A March 9, 2019, 1:44 p.m. OK Clang++17 Diagnostics TESTS 27 577 0 1700
51084016 vjudge2 A March 9, 2019, 12:29 p.m. OK Clang++17 Diagnostics TESTS 27 577 0 1700
51076366 JoneySun A March 9, 2019, 9:29 a.m. OK Clang++17 Diagnostics TESTS 27 577 0 1700
51076258 JoneySun A March 9, 2019, 9:27 a.m. OK Clang++17 Diagnostics TESTS 27 577 0 1700
51075987 JoneySun A March 9, 2019, 9:23 a.m. OK Clang++17 Diagnostics TESTS 27 577 0 1700
51086264 vjudge3 A March 9, 2019, 1:09 p.m. OK Clang++17 Diagnostics TESTS 27 764 0 1700
51084021 vjudge3 A March 9, 2019, 12:29 p.m. OK Clang++17 Diagnostics TESTS 27 764 0 1700
51076309 JoneySun A March 9, 2019, 9:28 a.m. OK Clang++17 Diagnostics TESTS 27 764 0 1700
51078271 hznu_kk A March 9, 2019, 10:13 a.m. OK Clang++17 Diagnostics TESTS 27 779 0 1700
12441781 Gassa A Aug. 10, 2015, 4:42 p.m. OK D TESTS 27 280 24064000 1700
12775489 ruban A Aug. 30, 2015, 11:34 a.m. OK Delphi TESTS 27 499 155136000 1700
12444274 tungtinhoctre126 A Aug. 10, 2015, 5 p.m. OK FPC TESTS 27 140 16076800 1700
13574199 SilverDH A Oct. 12, 2015, 1:58 p.m. OK FPC TESTS 27 140 32153600 1700
12448708 CSTRP A Aug. 10, 2015, 5:31 p.m. OK FPC TESTS 27 218 45670400 1700
12793862 Valerich A Aug. 31, 2015, 7:32 p.m. OK FPC TESTS 27 390 80281600 1700
12443296 cjy A Aug. 10, 2015, 4:54 p.m. OK FPC TESTS 27 468 16076800 1700
12679179 fufck A Aug. 24, 2015, 3:04 a.m. OK FPC TESTS 27 561 16076800 1700
12561376 yan_lazy A Aug. 16, 2015, 1:22 p.m. OK FPC TESTS 27 702 10035200 1700
12457934 RomanDerkach A Aug. 10, 2015, 8:25 p.m. OK FPC TESTS 27 733 168448000 1700
12467577 Kleaschev_Maksim A Aug. 11, 2015, 2:16 p.m. OK FPC TESTS 27 857 100249600 1700
12448790 ongvuacon A Aug. 10, 2015, 5:31 p.m. OK FPC TESTS 27 1419 102400 1700
12457237 sgtlaugh A Aug. 10, 2015, 7:38 p.m. OK GNU C TESTS 27 31 4915200 1700
12727446 NoSoul A Aug. 28, 2015, 6:16 a.m. OK GNU C TESTS 27 46 1228800 1700
12487330 cyand1317 A Aug. 13, 2015, 5:31 a.m. OK GNU C TESTS 27 46 11980800 1700
12445876 hashlife A Aug. 10, 2015, 5:10 p.m. OK GNU C TESTS 27 46 45260800 1700
12444014 liv_curious A Aug. 10, 2015, 4:58 p.m. OK GNU C TESTS 27 78 24064000 1700
12444048 Tebak_Siapa_Aku A Aug. 10, 2015, 4:58 p.m. OK GNU C TESTS 27 109 4915200 1700
12577552 starter007 A Aug. 17, 2015, 4:02 p.m. OK GNU C TESTS 27 109 24064000 1700
17714637 anothervjudge A May 5, 2016, 5:41 a.m. OK GNU C TESTS 27 280 10035200 1700
13212965 rastogi007 A Sept. 25, 2015, 4:29 a.m. OK GNU C TESTS 27 421 90214400 1700
12727415 NoSoul A Aug. 28, 2015, 6:13 a.m. OK GNU C TESTS 27 514 10035200 1700
13886755 130705009 A Oct. 27, 2015, 7:56 a.m. OK GNU C++ TESTS 27 31 1024000 1700
13126714 vjudge2 A Sept. 21, 2015, 1:22 p.m. OK GNU C++ TESTS 27 31 1228800 1700
13126745 vjudge3 A Sept. 21, 2015, 1:24 p.m. OK GNU C++ TESTS 27 31 1228800 1700
12443999 arsijo A Aug. 10, 2015, 4:58 p.m. OK GNU C++ TESTS 27 31 1228800 1700
12442190 faebdc A Aug. 10, 2015, 4:46 p.m. OK GNU C++ TESTS 27 31 2252800 1700
12448857 zhyfzy A Aug. 10, 2015, 5:32 p.m. OK GNU C++ TESTS 27 31 3993600 1700
33197414 vjudge2 A Dec. 12, 2017, 10:09 p.m. OK GNU C++ TESTS 27 31 12902400 1700
12452354 rnsiehemt A Aug. 10, 2015, 6:04 p.m. OK GNU C++ TESTS 27 31 21606400 1700
12465453 dragonslayerv2 A Aug. 11, 2015, 11:16 a.m. OK GNU C++ TESTS 27 46 204800 1700
12526002 kevin11 A Aug. 14, 2015, 8:12 a.m. OK GNU C++ TESTS 27 46 204800 1700
57164460 rainboy A July 16, 2019, 9:17 p.m. OK GNU C11 TESTS 27 61 9420800 1700
14353836 _ED A Nov. 20, 2015, 4:23 a.m. OK GNU C++11 TESTS 27 31 1024000 1700
12459829 KarlFreecss A Aug. 11, 2015, 1:16 a.m. OK GNU C++11 TESTS 27 31 1228800 1700
13410265 tmyklebu A Oct. 5, 2015, 4:23 a.m. OK GNU C++11 TESTS 27 31 1331200 1700
13278318 yarek A Sept. 28, 2015, 1:29 p.m. OK GNU C++11 TESTS 27 31 1843200 1700
12452031 klyachin A Aug. 10, 2015, 6:01 p.m. OK GNU C++11 TESTS 27 31 2048000 1700
12459075 rotoZOOM A Aug. 10, 2015, 10:34 p.m. OK GNU C++11 TESTS 27 31 2048000 1700
12462164 jimola A Aug. 11, 2015, 6:22 a.m. OK GNU C++11 TESTS 27 31 2355200 1700
12468877 krijgertje A Aug. 11, 2015, 4:14 p.m. OK GNU C++11 TESTS 27 31 11878400 1700
12457419 OMG_wc A Aug. 10, 2015, 7:48 p.m. OK GNU C++11 TESTS 27 31 12083200 1700
33197418 Nobel_ruettt A Dec. 12, 2017, 10:09 p.m. OK GNU C++11 TESTS 27 31 12902400 1700
31715494 Simon7426 A Oct. 25, 2017, 3:19 p.m. OK GNU C++14 TESTS 27 46 2048000 1700
38320644 vjudge5 A May 16, 2018, 12:21 p.m. OK GNU C++14 TESTS 27 46 3788800 1700
55113882 pvannvuILQD A June 5, 2019, 7:43 a.m. OK GNU C++14 TESTS 27 46 3993600 1700
41623629 georgevidalakis A Aug. 15, 2018, 1:11 p.m. OK GNU C++14 TESTS 27 46 10752000 1700
35276046 philologist A Feb. 14, 2018, 8:40 p.m. OK GNU C++14 TESTS 27 46 25907200 1700
37916276 zhongzero A May 6, 2018, 12:31 a.m. OK GNU C++14 TESTS 27 46 37478400 1700
46019903 Yuki726 A Nov. 21, 2018, 7:14 a.m. OK GNU C++14 TESTS 27 61 1536000 1700
25564294 playhard A March 17, 2017, 5:20 a.m. OK GNU C++14 TESTS 27 61 3891200 1700
24231156 demonsbane A Jan. 28, 2017, 5:19 p.m. OK GNU C++14 TESTS 27 61 5939200 1700
30247012 exprosic A Sept. 10, 2017, 2 p.m. OK GNU C++14 TESTS 27 61 18022400 1700
58652276 Matevz A Aug. 12, 2019, 7:55 a.m. OK GNU C++17 TESTS 27 46 1843200 1700
52799098 Ygg_Drasil A April 16, 2019, 12:55 a.m. OK GNU C++17 TESTS 27 61 307200 1700
49092320 vjudge2 A Jan. 28, 2019, 8:55 a.m. OK GNU C++17 TESTS 27 61 15872000 1700
47762019 yizhibaiwuya A Dec. 30, 2018, 4:51 p.m. OK GNU C++17 TESTS 27 61 18022400 1700
52799088 Ygg_Drasil A April 16, 2019, 12:54 a.m. OK GNU C++17 TESTS 27 62 307200 1700
38433214 linh A May 19, 2018, 2:09 p.m. OK GNU C++17 TESTS 27 62 1945600 1700
49108280 vjudge1 A Jan. 28, 2019, 1:57 p.m. OK GNU C++17 TESTS 27 62 2252800 1700
49092334 1804010714 A Jan. 28, 2019, 8:55 a.m. OK GNU C++17 TESTS 27 62 15872000 1700
56782545 vector94 A July 10, 2019, 6:55 a.m. OK GNU C++17 TESTS 27 62 18022400 1700
68144883 minexo79 A Jan. 4, 2020, 3:29 a.m. OK GNU C++17 TESTS 27 62 18022400 1700
15445141 behzad.nouri A Jan. 19, 2016, 11:44 p.m. OK Haskell TESTS 27 1747 14950400 1700
12914700 partizan22 A Sept. 9, 2015, 8:24 p.m. OK Java 7 TESTS 27 139 0 1700
12442466 PlayLikeNeverB4 A Aug. 10, 2015, 4:48 p.m. OK Java 7 TESTS 27 140 0 1700
13066374 wotafak A Sept. 17, 2015, 12:06 p.m. OK Java 7 TESTS 27 140 0 1700
12844351 tyuan73 A Sept. 4, 2015, 6:37 p.m. OK Java 7 TESTS 27 140 0 1700
12480913 3mph4515 A Aug. 12, 2015, 2:20 p.m. OK Java 7 TESTS 27 140 0 1700
12476680 kenkoooo A Aug. 12, 2015, 9:04 a.m. OK Java 7 TESTS 27 156 0 1700
12441354 xiaowuc1 A Aug. 10, 2015, 4:35 p.m. OK Java 7 TESTS 27 170 0 1700
12449244 davidarcila93 A Aug. 10, 2015, 5:35 p.m. OK Java 7 TESTS 27 171 0 1700
12442219 pitfall A Aug. 10, 2015, 4:46 p.m. OK Java 7 TESTS 27 171 0 1700
12443137 dusty.and.rusty A Aug. 10, 2015, 4:53 p.m. OK Java 7 TESTS 27 171 25088000 1700
12461683 ironman7453 A Aug. 11, 2015, 5:16 a.m. OK Java 8 TESTS 27 140 0 1700
12461659 ironman7453 A Aug. 11, 2015, 5:11 a.m. OK Java 8 TESTS 27 140 0 1700
12461653 ironman7453 A Aug. 11, 2015, 5:11 a.m. OK Java 8 TESTS 27 140 8192000 1700
12557225 MVesterli A Aug. 16, 2015, 8:01 a.m. OK Java 8 TESTS 27 155 0 1700
12461648 ironman7453 A Aug. 11, 2015, 5:10 a.m. OK Java 8 TESTS 27 156 16588800 1700
13066375 wotafak A Sept. 17, 2015, 12:06 p.m. OK Java 8 TESTS 27 186 0 1700
57164459 Dukkha A July 16, 2019, 9:17 p.m. OK Java 8 TESTS 27 202 5222400 1700
22943631 vjudge2 A Dec. 14, 2016, 7:35 a.m. OK Java 8 TESTS 27 218 6451200 1700
12457412 uwi A Aug. 10, 2015, 7:48 p.m. OK Java 8 TESTS 27 218 14745600 1700
12460969 skyrim A Aug. 11, 2015, 3:30 a.m. OK Java 8 TESTS 27 218 33792000 1700
23076954 JoeBlow A Dec. 18, 2016, 4:43 a.m. OK Kotlin TESTS 27 280 0 1700
12448617 kuuso A Aug. 10, 2015, 5:30 p.m. OK Mono C# TESTS 27 311 35840000 1700
12447458 kingmoshe A Aug. 10, 2015, 5:21 p.m. OK MS C# TESTS 27 140 14540800 1700
14712903 zazak A Dec. 9, 2015, 12:22 p.m. OK MS C# TESTS 27 171 4300800 1700
12581595 guillermo A Aug. 17, 2015, 10:26 p.m. OK MS C# TESTS 27 171 19353600 1700
14712861 zazak A Dec. 9, 2015, 12:19 p.m. OK MS C# TESTS 27 217 4300800 1700
12443422 azukun A Aug. 10, 2015, 4:55 p.m. OK MS C# TESTS 27 296 7475200 1700
12523699 cod3r A Aug. 14, 2015, 5:58 a.m. OK MS C# TESTS 27 358 3174400 1700
12539980 freepvps A Aug. 15, 2015, 4:23 a.m. OK MS C# TESTS 27 467 43212800 1700
12456083 og.kostya A Aug. 10, 2015, 7:03 p.m. OK MS C# TESTS 27 529 2969600 1700
12448080 Lurr A Aug. 10, 2015, 5:26 p.m. OK MS C# TESTS 27 2480 158310400 1700
14317923 _ED A Nov. 17, 2015, 7:39 p.m. OK MS C++ TESTS 27 31 1228800 1700
13832052 Ahmed_Mostafa A Oct. 25, 2015, 1:04 a.m. OK MS C++ TESTS 27 46 2048000 1700
12912243 ALWAYSWANNAFLY A Sept. 9, 2015, 4:09 p.m. OK MS C++ TESTS 27 46 3993600 1700
12444830 moreda A Aug. 10, 2015, 5:03 p.m. OK MS C++ TESTS 27 46 7475200 1700
12443279 ASoboll A Aug. 10, 2015, 4:54 p.m. OK MS C++ TESTS 27 46 10649600 1700
12477419 vjudge5 A Aug. 12, 2015, 9:52 a.m. OK MS C++ TESTS 27 46 12288000 1700
12811453 FxF A Sept. 2, 2015, 6:42 a.m. OK MS C++ TESTS 27 62 2048000 1700
49106009 vjudge2 A Jan. 28, 2019, 1:09 p.m. OK MS C++ TESTS 27 62 2048000 1700
12445346 yeahpeng A Aug. 10, 2015, 5:06 p.m. OK MS C++ TESTS 27 62 3481600 1700
19052299 LoDThe A July 12, 2016, 1:42 p.m. OK MS C++ TESTS 27 62 3993600 1700
66615813 Samanter A Dec. 11, 2019, 3:44 a.m. OK MS C++ 2017 TESTS 27 77 20992000 1700
63389699 CtrlAlt A Oct. 25, 2019, 2:49 p.m. OK MS C++ 2017 TESTS 27 202 60108800 1700
42720851 matheus.justino A Sept. 10, 2018, 12:54 a.m. OK PyPy 2 TESTS 27 311 6451200 1700
12489060 cchao A Aug. 13, 2015, 8:42 a.m. OK PyPy 2 TESTS 27 467 17203200 1700
42871743 daniel.carlos A Sept. 14, 2018, 7:26 p.m. OK PyPy 2 TESTS 27 514 8499200 1700
42875920 daniel.carlos A Sept. 15, 2018, 12:27 a.m. OK PyPy 2 TESTS 27 592 8499200 1700
12484737 iburinoc A Aug. 12, 2015, 9:49 p.m. OK PyPy 2 TESTS 27 873 8192000 1700
12719142 Vosatorp A Aug. 27, 2015, 12:07 p.m. OK PyPy 3 TESTS 27 327 5836800 1700
13256312 SteelRaven A Sept. 28, 2015, 12:51 a.m. OK PyPy 3 TESTS 27 343 6656000 1700
54737316 Aidos A May 28, 2019, 5:47 a.m. OK PyPy 3 TESTS 27 343 8806400 1700
46760699 jfelipe A Dec. 8, 2018, 1:19 p.m. OK PyPy 3 TESTS 27 686 8908800 1700
46760671 vodka_power A Dec. 8, 2018, 1:18 p.m. OK PyPy 3 TESTS 27 686 8908800 1700
43669734 DaniboyTorres A Oct. 2, 2018, 3:33 a.m. OK PyPy 3 TESTS 27 904 9113600 1700
19223471 skywalker8000 A July 19, 2016, 3:31 a.m. OK Python 2 TESTS 27 1466 34304000 1700
27234339 BlueHazard_rony A May 20, 2017, 11:24 a.m. OK Python 2 TESTS 27 1902 24371200 1700
38000731 gabialverga A May 7, 2018, 3:43 p.m. OK Python 2 TESTS 27 2012 15564800 1700
12872884 mowayao A Sept. 6, 2015, 1:32 p.m. OK Python 2 TESTS 27 2261 9728000 1700
19388046 son1c A July 24, 2016, 5:37 p.m. OK Python 2 TESTS 27 2464 57036800 1700
12466408 nims11 A Aug. 11, 2015, 12:47 p.m. OK Python 2 TESTS 27 2526 56934400 1700
12443487 nwi A Aug. 10, 2015, 4:55 p.m. OK Python 2 TESTS 27 2542 65024000 1700
27723704 PTQ1001 A June 11, 2017, 3:55 p.m. OK Python 2 TESTS 27 2652 24576000 1700
12493072 Fear_Is_An_Illusion A Aug. 13, 2015, 2:14 p.m. OK Python 2 TESTS 27 2683 75776000 1700
12604775 rspencer A Aug. 19, 2015, 2:54 p.m. OK Python 2 TESTS 27 2744 48947200 1700
17027508 orailly A March 30, 2016, 2:40 a.m. OK Python 3 TESTS 27 374 9830400 1700
31034631 yugle7 A Oct. 5, 2017, 1:10 p.m. OK Python 3 TESTS 27 701 4812800 1700
31033622 yugle7 A Oct. 5, 2017, 12:41 p.m. OK Python 3 TESTS 27 1278 68403200 1700
12454702 rpy3cpp A Aug. 10, 2015, 6:25 p.m. OK Python 3 TESTS 27 1528 50688000 1700
12594639 enesoncu A Aug. 18, 2015, 10:24 p.m. OK Python 3 TESTS 27 1746 5222400 1700
42108317 Mk_Python_v1 A Aug. 26, 2018, 3:28 a.m. OK Python 3 TESTS 27 1902 5222400 1700
12442911 limed A Aug. 10, 2015, 4:51 p.m. OK Scala TESTS 27 2199 20275200 1700

remove filters

Back to search problems