CodeCraft-20 (Div. 2)

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
1316 CodeCraft-20 (Div. 2) FINISHED False 7200 154020311 March 4, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7344 ) C Primitive Primes PROGRAMMING constructive algorithms math ternary search 1700

B"It is Professor R's last class of his teaching career. Every time Professor R taught a class, he gave a special problem for the students to solve. You being his favourite student, put your heart into solving it one last time. You are given two polynomials f(x) = a_0 + a_1x + ... + a_{n-1}x^{n-1} and g(x) = b_0 + b_1x + ... + b_{m-1}x^{m-1} , with positive integral coefficients. It is guaranteed that the cumulative GCD of the coefficients is equal to 1 for both the given polynomials. In other words, gcd(a_0, a_1, ... , a_{n-1}) = gcd(b_0, b_1, ... , b_{m-1}) = 1 . Let h(x) = f(x) cdot g(x) . Suppose that h(x) = c_0 + c_1x + ... + c_{n+m-2}x^{n+m-2} . You are also given a prime number p . Professor R challenges you to find any t such that c_t isn't divisible by p . He guarantees you that under these conditions such t always exists. If there are several such t , output any of them. As the input is quite large, please use fast input reading methods. The first line of the input contains three integers, n , m and p ( 1 <= q n, m <= q 10^6, 2 <= q p <= q 10^9 ), -- n and m are the number of terms in f(x) and g(x) respectively (one more than the degrees of the respective polynomials) and p is the given prime number. It is guaranteed that p is prime. The second line contains n integers a_0, a_1, ... , a_{n-1} ( 1 <= q a_{i} <= q 10^{9} ) -- a_i is the coefficient of x^{i} in f(x) . The third line contains m integers b_0, b_1, ... , b_{m-1} ( 1 <= q b_{i} <= q 10^{9} ) -- b_i is the coefficient of x^{i} in g(x) . Print a single integer t ( 0 <= t <= n+m-2 ) -- the appropriate power of x in h(x) whose coefficient isn't divisible by the given prime p . If there are multiple powers of x that satisfy the condition, print any. In t"...

Tutorials

Codecraft-20 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
72450876 avm C March 4, 2020, 4 p.m. OK D TESTS 156 202 25292800 1700
72437687 iica C March 4, 2020, 3:13 p.m. OK D TESTS 156 592 119398400 1700
72446690 ruban C March 4, 2020, 3:44 p.m. OK Delphi TESTS 156 639 27545600 1700
72489497 191110899 C March 5, 2020, 6:07 a.m. OK GNU C11 TESTS 157 373 80179200 1700
72529455 Avinash1506 C March 5, 2020, 5:23 p.m. OK GNU C11 TESTS 158 374 7987200 1700
72456063 shaun_0124 C March 4, 2020, 4:19 p.m. OK GNU C11 TESTS 156 374 7987200 1700
72441981 akash456 C March 4, 2020, 3:27 p.m. OK GNU C11 TESTS 156 389 7987200 1700
72467381 rainboy C March 4, 2020, 7:15 p.m. OK GNU C11 TESTS 157 390 0 1700
72466717 Zarzees C March 4, 2020, 7:08 p.m. OK GNU C11 TESTS 157 436 0 1700
72445431 pengin_2000 C March 4, 2020, 3:40 p.m. OK GNU C11 TESTS 156 452 15974400 1700
72469385 anubhavkalyani C March 4, 2020, 7:44 p.m. OK GNU C11 TESTS 157 483 15974400 1700
72481670 Leggasick C March 5, 2020, 2:19 a.m. OK GNU C11 TESTS 157 530 0 1700
72524571 StelaYuri C March 5, 2020, 4 p.m. OK GNU C++11 TESTS 158 78 1024000 1700
72508782 iyaad C March 5, 2020, 12:03 p.m. OK GNU C++11 TESTS 158 93 0 1700
72484276 zhtjtcz C March 5, 2020, 3:44 a.m. OK GNU C++11 TESTS 157 93 0 1700
72482393 Frame233 C March 5, 2020, 2:45 a.m. OK GNU C++11 TESTS 157 93 0 1700
72482284 luotc_why C March 5, 2020, 2:41 a.m. OK GNU C++11 TESTS 157 93 0 1700
72480504 loongnight C March 5, 2020, 1:38 a.m. OK GNU C++11 TESTS 157 93 0 1700
72449636 xiaohaomeimingzi C March 4, 2020, 3:55 p.m. OK GNU C++11 TESTS 156 93 0 1700
72549552 luogu_bot4 C March 6, 2020, 3:58 a.m. OK GNU C++11 TESTS 158 93 0 1700
72548707 MasonMount19 C March 6, 2020, 3:33 a.m. OK GNU C++11 TESTS 158 93 0 1700
72556634 Nisemono C March 6, 2020, 7:03 a.m. OK GNU C++11 TESTS 158 93 8089600 1700
72436676 stonemasons C March 4, 2020, 3:10 p.m. OK GNU C++14 TESTS 156 108 8294400 1700
72468384 tokitsukaze C March 4, 2020, 7:28 p.m. OK GNU C++14 TESTS 157 109 8089600 1700
72459283 KaguraNana C March 4, 2020, 4:30 p.m. OK GNU C++14 TESTS 156 109 8089600 1700
72433409 MackereI_Pike C March 4, 2020, 2:59 p.m. OK GNU C++14 TESTS 156 109 8192000 1700
72497351 nitvjudge1 C March 5, 2020, 8:50 a.m. OK GNU C++14 TESTS 158 109 8294400 1700
72437011 compute C March 4, 2020, 3:11 p.m. OK GNU C++14 TESTS 156 124 8192000 1700
72434623 QwertyPi C March 4, 2020, 3:03 p.m. OK GNU C++14 TESTS 156 124 142540800 1700
72470986 risujiroh C March 4, 2020, 8:13 p.m. OK GNU C++14 TESTS 157 140 24883200 1700
72443381 j_peters C March 4, 2020, 3:32 p.m. OK GNU C++14 TESTS 156 187 16076800 1700
72465654 dy2000 C March 4, 2020, 6:59 p.m. OK GNU C++14 TESTS 156 374 7987200 1700
72442943 DivQ C March 4, 2020, 3:31 p.m. OK GNU C++17 TESTS 156 93 1024000 1700
72487975 shysimon C March 5, 2020, 5:30 a.m. OK GNU C++17 TESTS 157 93 16998400 1700
72440973 killer_lsy C March 4, 2020, 3:24 p.m. OK GNU C++17 TESTS 156 108 8089600 1700
72447701 zWtLcY C March 4, 2020, 3:48 p.m. OK GNU C++17 TESTS 156 108 32563200 1700
72443080 balakrishnan C March 4, 2020, 3:31 p.m. OK GNU C++17 TESTS 156 108 75980800 1700
72444864 H_J_Granger C March 4, 2020, 3:38 p.m. OK GNU C++17 TESTS 156 109 2048000 1700
72431625 BroadwayNight C March 4, 2020, 2:54 p.m. OK GNU C++17 TESTS 156 109 8294400 1700
72440818 Diorvh C March 4, 2020, 3:23 p.m. OK GNU C++17 TESTS 156 109 9011200 1700
72430647 LayCurse C March 4, 2020, 2:51 p.m. OK GNU C++17 TESTS 156 109 10137600 1700
72446884 twtynije1 C March 4, 2020, 3:45 p.m. OK GNU C++17 TESTS 156 109 16179200 1700
72501678 synapse C March 5, 2020, 10:02 a.m. OK Go TESTS 158 217 0 1700
72501384 synapse C March 5, 2020, 9:58 a.m. OK Go TESTS 158 233 5222400 1700
72476371 lucifer1004 C March 4, 2020, 10:46 p.m. OK Go TESTS 157 233 49766400 1700
72501261 synapse C March 5, 2020, 9:56 a.m. OK Go TESTS 158 234 5222400 1700
72443914 Jughead C March 4, 2020, 3:34 p.m. OK Go TESTS 156 373 14438400 1700
72488135 wzazzy C March 5, 2020, 5:34 a.m. OK Go TESTS 157 561 13312000 1700
72471443 Dukkha C March 4, 2020, 8:23 p.m. OK Java 11 TESTS 157 280 0 1700
72465841 atishay127 C March 4, 2020, 7 p.m. OK Java 11 TESTS 156 296 4608000 1700
72432545 uwi C March 4, 2020, 2:57 p.m. OK Java 11 TESTS 156 327 4608000 1700
72565338 Azakarka C March 6, 2020, 10:16 a.m. OK Java 11 TESTS 158 608 53452800 1700
72538180 once_twice C March 5, 2020, 8:18 p.m. OK Java 11 TESTS 158 623 53452800 1700
72529257 mr___hacker____ C March 5, 2020, 5:19 p.m. OK Java 11 TESTS 158 639 4812800 1700
72607818 rreeennnnn C March 6, 2020, 11:58 p.m. OK Java 11 TESTS 158 639 53452800 1700
72460930 GiantTornado C March 4, 2020, 4:34 p.m. OK Java 11 TESTS 156 655 59904000 1700
72467624 Hemose C March 4, 2020, 7:18 p.m. OK Java 11 TESTS 157 670 53555200 1700
72440425 ZeyadKhattab C March 4, 2020, 3:22 p.m. OK Java 11 TESTS 156 670 65638400 1700
72607902 kacho C March 7, 2020, 12:03 a.m. OK Java 8 TESTS 158 171 0 1700
72455977 johnny16 C March 4, 2020, 4:19 p.m. OK Java 8 TESTS 156 202 2252800 1700
72450421 rishisharma__ C March 4, 2020, 3:58 p.m. OK Java 8 TESTS 156 202 15462400 1700
72567141 bluesky111 C March 6, 2020, 10:54 a.m. OK Java 8 TESTS 158 218 2150400 1700
72451809 MessiahJK C March 4, 2020, 4:04 p.m. OK Java 8 TESTS 156 218 2150400 1700
72458383 sguar C March 4, 2020, 4:27 p.m. OK Java 8 TESTS 156 233 2150400 1700
72434453 cwise C March 4, 2020, 3:03 p.m. OK Java 8 TESTS 156 249 35737600 1700
72465873 conquerorArpit C March 4, 2020, 7 p.m. OK Java 8 TESTS 156 264 35737600 1700
72443247 mufaddalnaya C March 4, 2020, 3:32 p.m. OK Java 8 TESTS 156 265 2150400 1700
72539150 Elias C March 5, 2020, 8:42 p.m. OK Java 8 TESTS 158 280 0 1700
72481972 Spheniscine C March 5, 2020, 2:31 a.m. OK Kotlin TESTS 157 592 123801600 1700
72482818 koboshi C March 5, 2020, 2:59 a.m. OK Kotlin TESTS 157 811 155340800 1700
72436465 SlavaG C March 4, 2020, 3:09 p.m. OK Kotlin TESTS 156 889 155340800 1700
72494627 hyzhyzhy C March 5, 2020, 8:01 a.m. OK Mono C# TESTS 158 966 226611200 1700
72446725 eSeF_ C March 4, 2020, 3:44 p.m. OK Mono C# TESTS 156 1013 214732800 1700
72460146 Ruban_Denic C March 4, 2020, 4:33 p.m. OK Mono C# TESTS 156 1029 210739200 1700
72452015 eki C March 4, 2020, 4:04 p.m. OK Mono C# TESTS 156 1044 208896000 1700
72434433 mban259 C March 4, 2020, 3:03 p.m. OK Mono C# TESTS 156 1060 227737600 1700
72438851 hibatibati C March 4, 2020, 3:17 p.m. OK Mono C# TESTS 156 1138 219136000 1700
72571307 vjudge2 C March 6, 2020, 12:09 p.m. OK MS C++ TESTS 158 358 0 1700
72546256 vjudge2 C March 6, 2020, 1:52 a.m. OK MS C++ TESTS 158 358 7987200 1700
72571419 vjudge5 C March 6, 2020, 12:11 p.m. OK MS C++ TESTS 158 373 0 1700
72437186 tarattata1 C March 4, 2020, 3:11 p.m. OK MS C++ TESTS 156 374 7987200 1700
72496481 ika557 C March 5, 2020, 8:35 a.m. OK MS C++ 2017 TESTS 158 592 8294400 1700
72490912 jhpark_inha C March 5, 2020, 6:39 a.m. OK MS C++ 2017 TESTS 158 607 7987200 1700
72458004 i3Cheese C March 4, 2020, 4:26 p.m. OK MS C++ 2017 TESTS 156 608 307200 1700
72461022 Yiii C March 4, 2020, 4:34 p.m. OK MS C++ 2017 TESTS 156 608 307200 1700
72512849 PrideBlack C March 5, 2020, 1 p.m. OK MS C++ 2017 TESTS 158 608 307200 1700
72455516 shon804 C March 4, 2020, 4:17 p.m. OK MS C++ 2017 TESTS 156 608 7987200 1700
72447863 LeeLdler C March 4, 2020, 3:49 p.m. OK MS C++ 2017 TESTS 156 608 8089600 1700
72565803 Najmus_Sakib_Rashid C March 6, 2020, 10:27 a.m. OK MS C++ 2017 TESTS 158 608 16281600 1700
72451402 rhksdn6227 C March 4, 2020, 4:02 p.m. OK MS C++ 2017 TESTS 156 623 0 1700
72513366 PrideBlack C March 5, 2020, 1:07 p.m. OK MS C++ 2017 TESTS 158 623 307200 1700
72490269 shivam1420 C March 5, 2020, 6:24 a.m. OK Node.js TESTS 158 1263 129126400 1700
72581224 thekushalghosh C March 6, 2020, 2:42 p.m. OK PyPy 2 TESTS 158 561 65945600 1700
72450040 Renshu C March 4, 2020, 3:57 p.m. OK PyPy 2 TESTS 156 561 80486400 1700
72514940 bazzyadb C March 5, 2020, 1:30 p.m. OK PyPy 2 TESTS 158 576 80486400 1700
72434167 astrom.lars C March 4, 2020, 3:02 p.m. OK PyPy 2 TESTS 156 576 80486400 1700
72514106 cgfs10000 C March 5, 2020, 1:18 p.m. OK PyPy 2 TESTS 158 607 89600000 1700
72439827 kabeer27 C March 4, 2020, 3:20 p.m. OK PyPy 2 TESTS 156 655 139059200 1700
72468533 snape_here C March 4, 2020, 7:31 p.m. OK PyPy 2 TESTS 157 670 139059200 1700
72446456 Gaurav1 C March 4, 2020, 3:43 p.m. OK PyPy 2 TESTS 156 686 139264000 1700
72532428 aberent C March 5, 2020, 6:17 p.m. OK PyPy 3 TESTS 158 530 100249600 1700
72516459 cgfs10000 C March 5, 2020, 1:52 p.m. OK PyPy 3 TESTS 158 561 135475200 1700
72515825 cgfs10000 C March 5, 2020, 1:43 p.m. OK PyPy 3 TESTS 158 592 135475200 1700
72600695 thekushalghosh C March 6, 2020, 7:48 p.m. OK PyPy 3 TESTS 158 623 128614400 1700
72490400 m.ni C March 5, 2020, 6:28 a.m. OK PyPy 3 TESTS 158 623 128614400 1700
72484660 paras555 C March 5, 2020, 3:57 a.m. OK PyPy 3 TESTS 157 623 128614400 1700
72514559 cgfs10000 C March 5, 2020, 1:25 p.m. OK PyPy 3 TESTS 158 624 128614400 1700
72573218 soujiokita C March 6, 2020, 12:41 p.m. OK PyPy 3 TESTS 158 639 91033600 1700
72573301 soujiokita C March 6, 2020, 12:43 p.m. OK PyPy 3 TESTS 158 639 91340800 1700
72529518 titia C March 5, 2020, 5:24 p.m. OK PyPy 3 TESTS 158 639 128614400 1700
72571057 bertrandovide C March 6, 2020, 12:05 p.m. OK Python 2 TESTS 158 1435 72294400 1700
72557838 notbot C March 6, 2020, 7:32 a.m. OK Python 3 TESTS 158 1014 83660800 1700
72551909 nikeshthapa255 C March 6, 2020, 5:09 a.m. OK Python 3 TESTS 158 1075 90828800 1700
72475703 mkawa2 C March 4, 2020, 10:21 p.m. OK Python 3 TESTS 157 1076 90828800 1700
72557447 notbot C March 6, 2020, 7:22 a.m. OK Python 3 TESTS 158 1091 83660800 1700
72513544 amruth_kumar C March 5, 2020, 1:10 p.m. OK Python 3 TESTS 158 1091 91238400 1700
72479282 patahene C March 5, 2020, 12:51 a.m. OK Python 3 TESTS 157 1092 103526400 1700
72514516 cgfs10000 C March 5, 2020, 1:24 p.m. OK Python 3 TESTS 158 1123 100249600 1700
72479232 patahene C March 5, 2020, 12:49 a.m. OK Python 3 TESTS 157 1138 91750400 1700
72513477 ryo_n C March 5, 2020, 1:09 p.m. OK Python 3 TESTS 158 1169 91852800 1700
72557450 notbot C March 6, 2020, 7:22 a.m. OK Python 3 TESTS 158 1170 91852800 1700
72470683 rustafarian C March 4, 2020, 8:08 p.m. OK Rust TESTS 157 140 50483200 1700
72478433 lucifer1004 C March 5, 2020, 12:17 a.m. OK Rust TESTS 157 202 29184000 1700
72477606 lucifer1004 C March 4, 2020, 11:38 p.m. OK Rust TESTS 157 202 32358400 1700
72434135 sansen C March 4, 2020, 3:02 p.m. OK Rust TESTS 156 202 50483200 1700
72467649 rustafarian C March 4, 2020, 7:18 p.m. OK Rust TESTS 157 343 73625600 1700
72474423 rustafarian C March 4, 2020, 9:36 p.m. OK Rust TESTS 157 358 73625600 1700
72440804 koboshi C March 4, 2020, 3:23 p.m. OK Rust TESTS 156 1060 7987200 1700

remove filters

Back to search problems