Codeforces Round 609 (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
1269 Codeforces Round 609 (Div. 2) FINISHED False 7200 160512887 Dec. 21, 2019, 11:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9251 ) B Modulo Equality PROGRAMMING brute force sortings 1500

B'You are given a positive integer m and two integer sequence: a=[a_1, a_2, ldots, a_n] and b=[b_1, b_2, ldots, b_n] . Both of these sequence have a length n . Permutation is a sequence of n different positive integers from 1 to n . For example, these sequences are permutations: [1] , [1,2] , [2,1] , [6,7,3,4,1,2,5] . These are not: [0] , [1,1] , [2,3] . You need to find the non-negative integer x , and increase all elements of a_i by x , modulo m (i.e. you want to change a_i to (a_i + x) bmod m ), so it would be possible to rearrange elements of a to make it equal b , among them you need to find the smallest possible x . In other words, you need to find the smallest non-negative integer x , for which it is possible to find some permutation p=[p_1, p_2, ldots, p_n] , such that for all 1 <= q i <= q n , (a_i + x) bmod m = b_{p_i} , where y bmod m -- remainder of division of y by m . For example, if m=3 , a = [0, 0, 2, 1], b = [2, 0, 1, 1] , you can choose x=1 , and a will be equal to [1, 1, 0, 2] and you can rearrange it to make it equal [2, 0, 1, 1] , which is equal to b . The first line contains two integers n,m ( 1 <= q n <= q 2000, 1 <= q m <= q 10^9 ): number of elemens in arrays and m . The second line contains n integers a_1, a_2, ldots, a_n ( 0 <= q a_i < m ). The third line contains n integers b_1, b_2, ldots, b_n ( 0 <= q b_i < m ). It is guaranteed that there exists some non-negative integer x , such that it would be possible to find some permutation p_1, p_2, ldots, p_n such that (a_i + x) bmod m = b_{p_i} . Print one integer, the smallest non-negative integer x , such that it would be possible to find some permutation p_1, p_2, ldots, p_n such that (a_i + x) bmod '...

Tutorials

Codeforces Round #609 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
67354911 daut-dlang B Dec. 21, 2019, 12:16 p.m. OK D TESTS 38 31 4198400 1500
67471631 ruban B Dec. 23, 2019, 1 p.m. OK Delphi TESTS 40 826 158105600 1500
67344654 Fidisk B Dec. 21, 2019, 11:42 a.m. OK FPC TESTS 38 31 307200 1500
68699753 chaorenhaha B Jan. 13, 2020, 9:04 a.m. OK FPC TESTS 40 93 102400 1500
67349422 LaSWeeG B Dec. 21, 2019, 11:58 a.m. OK FPC TESTS 38 140 307200 1500
67512704 RajMaheshwari B Dec. 24, 2019, 9:45 a.m. OK GNU C11 TESTS 40 31 0 1500
67487220 hnust_guanxin B Dec. 23, 2019, 5:55 p.m. OK GNU C11 TESTS 40 31 0 1500
67486906 hnust_guanxin B Dec. 23, 2019, 5:48 p.m. OK GNU C11 TESTS 40 31 0 1500
67371434 mth1908 B Dec. 21, 2019, 2:16 p.m. OK GNU C11 TESTS 38 31 0 1500
67366611 hnust_gongyufei B Dec. 21, 2019, 12:58 p.m. OK GNU C11 TESTS 38 31 0 1500
67350961 hnust_zhouzisheng B Dec. 21, 2019, 12:03 p.m. OK GNU C11 TESTS 38 31 0 1500
67338769 pengin_2000 B Dec. 21, 2019, 11:24 a.m. OK GNU C11 TESTS 38 46 0 1500
67402402 cc0408 B Dec. 22, 2019, 4:42 a.m. OK GNU C11 TESTS 39 78 0 1500
67387551 satya_chaitanya B Dec. 21, 2019, 6:21 p.m. OK GNU C11 TESTS 39 78 0 1500
67380566 tushar3105 B Dec. 21, 2019, 4:15 p.m. OK GNU C11 TESTS 39 78 0 1500
67338473 Alcremie B Dec. 21, 2019, 11:24 a.m. OK GNU C++11 TESTS 38 30 0 1500
67871674 dejongh93 B Dec. 29, 2019, 11:43 a.m. OK GNU C++11 TESTS 40 30 0 1500
69472479 vjudge1 B Jan. 24, 2020, 3 p.m. OK GNU C++11 TESTS 40 30 0 1500
67376548 eatingmore B Dec. 21, 2019, 3:12 p.m. OK GNU C++11 TESTS 38 30 0 1500
67342624 gakiiii B Dec. 21, 2019, 11:36 a.m. OK GNU C++11 TESTS 38 30 0 1500
67338488 Performanceartist B Dec. 21, 2019, 11:24 a.m. OK GNU C++11 TESTS 38 30 0 1500
69557039 luogu_bot1 B Jan. 26, 2020, 9:13 a.m. OK GNU C++11 TESTS 40 31 0 1500
69412740 longxiaokong B Jan. 23, 2020, 12:10 p.m. OK GNU C++11 TESTS 40 31 0 1500
68917635 xiaochen619 B Jan. 16, 2020, 8:47 a.m. OK GNU C++11 TESTS 40 31 0 1500
68820463 smax B Jan. 14, 2020, 5:16 p.m. OK GNU C++11 TESTS 40 31 0 1500
67340034 swapnilr B Dec. 21, 2019, 11:28 a.m. OK GNU C++14 TESTS 38 15 0 1500
67402712 L_lawliet27 B Dec. 22, 2019, 4:52 a.m. OK GNU C++14 TESTS 39 15 0 1500
68072100 R99 B Jan. 2, 2020, 10:48 a.m. OK GNU C++14 TESTS 40 15 0 1500
68394223 MAD_ROBO B Jan. 8, 2020, 10:13 a.m. OK GNU C++14 TESTS 40 30 0 1500
68980838 durano B Jan. 17, 2020, 10:39 a.m. OK GNU C++14 TESTS 40 30 0 1500
68073328 _shango_ B Jan. 2, 2020, 11:23 a.m. OK GNU C++14 TESTS 40 30 0 1500
69552198 Invisible_Shadow B Jan. 26, 2020, 7:02 a.m. OK GNU C++14 TESTS 40 30 0 1500
69079951 karanagarwalla B Jan. 19, 2020, 5:55 a.m. OK GNU C++14 TESTS 40 30 0 1500
68100419 sky666 B Jan. 3, 2020, 2:17 a.m. OK GNU C++14 TESTS 40 30 0 1500
68105099 the_hero B Jan. 3, 2020, 6:33 a.m. OK GNU C++14 TESTS 40 30 0 1500
67402313 kamboj11 B Dec. 22, 2019, 4:39 a.m. OK GNU C++17 TESTS 39 15 0 1500
67601532 zagabi B Dec. 25, 2019, 12:06 p.m. OK GNU C++17 TESTS 40 15 0 1500
67430897 as2341567 B Dec. 22, 2019, 3:10 p.m. OK GNU C++17 TESTS 40 15 0 1500
67368321 nyist_lyslyslys B Dec. 21, 2019, 1:03 p.m. OK GNU C++17 TESTS 38 15 0 1500
67337402 Suto82 B Dec. 21, 2019, 11:21 a.m. OK GNU C++17 TESTS 38 15 0 1500
67353911 xiayuhandalao B Dec. 21, 2019, 12:13 p.m. OK GNU C++17 TESTS 38 15 102400 1500
67385017 sandeep_kumar_e B Dec. 21, 2019, 5:31 p.m. OK GNU C++17 TESTS 39 15 102400 1500
67428725 HIEU_LE B Dec. 22, 2019, 2:27 p.m. OK GNU C++17 TESTS 40 15 102400 1500
67452114 oblivion_21 B Dec. 23, 2019, 4:54 a.m. OK GNU C++17 TESTS 40 15 409600 1500
67384690 unrated_grandmaster B Dec. 21, 2019, 5:25 p.m. OK GNU C++17 TESTS 39 15 512000 1500
67459577 ktateish B Dec. 23, 2019, 8:35 a.m. OK Go TESTS 40 31 0 1500
67345074 maguroguma B Dec. 21, 2019, 11:44 a.m. OK Go TESTS 38 46 0 1500
67420973 mikolaychuknn B Dec. 22, 2019, 11:39 a.m. OK Go TESTS 40 46 0 1500
67347633 error271828 B Dec. 21, 2019, 11:52 a.m. OK Go TESTS 38 155 0 1500
67969856 amarjeetanand B Dec. 30, 2019, 2:37 p.m. OK Go TESTS 40 296 5324800 1500
67474375 congbao B Dec. 23, 2019, 1:52 p.m. OK Go TESTS 40 296 5324800 1500
67969932 pr0_iHack B Dec. 30, 2019, 2:38 p.m. OK Go TESTS 40 311 5324800 1500
67666299 XOR-star B Dec. 26, 2019, 6:01 p.m. OK Haskell TESTS 40 218 102400 1500
67371982 machhra B Dec. 21, 2019, 2:20 p.m. OK Java 11 TESTS 38 186 0 1500
67343818 Anonymous B Dec. 21, 2019, 11:40 a.m. OK Java 11 TESTS 38 187 0 1500
67556028 ShesMyNerd B Dec. 24, 2019, 4:32 p.m. OK Java 11 TESTS 40 187 0 1500
67371656 machhra B Dec. 21, 2019, 2:18 p.m. OK Java 11 TESTS 38 187 0 1500
68953687 GiantTornado B Jan. 16, 2020, 7:03 p.m. OK Java 11 TESTS 40 202 0 1500
67626581 bdomokos B Dec. 25, 2019, 10:24 p.m. OK Java 11 TESTS 40 217 0 1500
67409008 xfx98 B Dec. 22, 2019, 7:35 a.m. OK Java 11 TESTS 39 218 0 1500
67507325 satya_p54 B Dec. 24, 2019, 7:50 a.m. OK Java 11 TESTS 40 233 0 1500
68313201 Ayoub14 B Jan. 6, 2020, 12:09 p.m. OK Java 11 TESTS 40 249 0 1500
67584162 kamesh.joshi B Dec. 25, 2019, 7:33 a.m. OK Java 11 TESTS 40 249 0 1500
68671585 nidhigoel B Jan. 12, 2020, 5:02 p.m. OK Java 8 TESTS 40 109 0 1500
68342402 _IAm_PM_ B Jan. 7, 2020, 4:56 a.m. OK Java 8 TESTS 40 109 0 1500
67699062 dyhu083 B Dec. 27, 2019, 1:53 p.m. OK Java 8 TESTS 40 109 0 1500
67397439 gouh9qn B Dec. 22, 2019, 12:48 a.m. OK Java 8 TESTS 39 109 0 1500
67397365 gouh9qn B Dec. 22, 2019, 12:43 a.m. OK Java 8 TESTS 39 109 0 1500
67395721 bluesky111 B Dec. 21, 2019, 10:44 p.m. OK Java 8 TESTS 39 109 0 1500
68479867 ashraybharambe B Jan. 10, 2020, 7:17 a.m. OK Java 8 TESTS 40 124 0 1500
67446399 mareshkau B Dec. 22, 2019, 10:38 p.m. OK Java 8 TESTS 40 124 0 1500
67446335 mareshkau B Dec. 22, 2019, 10:37 p.m. OK Java 8 TESTS 40 124 0 1500
67408961 insane_28 B Dec. 22, 2019, 7:34 a.m. OK Java 8 TESTS 39 124 0 1500
67399894 a11eca B Dec. 22, 2019, 2:56 a.m. OK Kotlin TESTS 39 186 1024000 1500
67347205 Spheniscine B Dec. 21, 2019, 11:50 a.m. OK Kotlin TESTS 38 186 1126400 1500
67455158 shivam1420 B Dec. 23, 2019, 6:31 a.m. OK Kotlin TESTS 40 202 819200 1500
67395917 Spheniscine B Dec. 21, 2019, 10:57 p.m. OK Kotlin TESTS 39 358 921600 1500
67377408 RauBot B Dec. 21, 2019, 3:24 p.m. OK Kotlin TESTS 38 358 1228800 1500
67376879 RauBot B Dec. 21, 2019, 3:17 p.m. OK Kotlin TESTS 38 389 1228800 1500
67345826 AsuraPro B Dec. 21, 2019, 11:46 a.m. OK Kotlin TESTS 38 420 409600 1500
67341488 songsinger B Dec. 21, 2019, 11:33 a.m. OK Kotlin TESTS 38 717 1228800 1500
67473431 artworks B Dec. 23, 2019, 1:33 p.m. OK Mono C# TESTS 40 77 5734400 1500
67339143 Yupiteru B Dec. 21, 2019, 11:26 a.m. OK Mono C# TESTS 38 93 5017600 1500
67354380 sergmel B Dec. 21, 2019, 12:15 p.m. OK Mono C# TESTS 38 218 7168000 1500
67341026 eki B Dec. 21, 2019, 11:31 a.m. OK Mono C# TESTS 38 249 716800 1500
67337675 plasma-effect B Dec. 21, 2019, 11:21 a.m. OK Mono C# TESTS 38 280 4198400 1500
67337067 mban259 B Dec. 21, 2019, 11:20 a.m. OK Mono C# TESTS 38 327 4710400 1500
69257246 nastya1199 B Jan. 21, 2020, 4 p.m. OK Mono C# TESTS 40 373 8396800 1500
67354754 csgo B Dec. 21, 2019, 12:16 p.m. OK Mono C# TESTS 38 499 40652800 1500
67388955 r57shell B Dec. 21, 2019, 6:54 p.m. OK MS C++ TESTS 39 31 0 1500
67346920 IceyWang B Dec. 21, 2019, 11:50 a.m. OK MS C++ TESTS 38 31 0 1500
67340522 Volja B Dec. 21, 2019, 11:30 a.m. OK MS C++ TESTS 38 31 0 1500
68754918 vjudge3 B Jan. 14, 2020, 7:57 a.m. OK MS C++ TESTS 40 31 409600 1500
68753522 vjudge5 B Jan. 14, 2020, 7:31 a.m. OK MS C++ TESTS 40 46 0 1500
67398127 vjudge1 B Dec. 22, 2019, 1:29 a.m. OK MS C++ TESTS 39 124 102400 1500
67367982 Tiberiu.Mihai B Dec. 21, 2019, 1:02 p.m. OK MS C++ TESTS 38 171 102400 1500
68649486 vjudge5 B Jan. 12, 2020, 10:15 a.m. OK MS C++ TESTS 40 202 0 1500
68752758 vjudge3 B Jan. 14, 2020, 7:16 a.m. OK MS C++ TESTS 40 202 0 1500
68938818 vjudge1 B Jan. 16, 2020, 1:44 p.m. OK MS C++ TESTS 40 202 0 1500
68763673 q8514199 B Jan. 14, 2020, 9:05 a.m. OK MS C++ 2017 TESTS 40 30 307200 1500
68677722 omerb.zeybek B Jan. 12, 2020, 7:32 p.m. OK MS C++ 2017 TESTS 40 31 0 1500
68442992 2018qwer B Jan. 9, 2020, 11:38 a.m. OK MS C++ 2017 TESTS 40 31 0 1500
67371556 Parsa84 B Dec. 21, 2019, 2:17 p.m. OK MS C++ 2017 TESTS 38 31 0 1500
67352272 scarabaeus B Dec. 21, 2019, 12:07 p.m. OK MS C++ 2017 TESTS 38 31 0 1500
67336883 llFreetimell B Dec. 21, 2019, 11:19 a.m. OK MS C++ 2017 TESTS 38 31 0 1500
67371728 youx B Dec. 21, 2019, 2:18 p.m. OK MS C++ 2017 TESTS 38 31 204800 1500
67484031 Raptor_3186 B Dec. 23, 2019, 4:51 p.m. OK MS C++ 2017 TESTS 40 31 307200 1500
68022645 AlexanderL B Jan. 1, 2020, 1:38 a.m. OK MS C++ 2017 TESTS 40 31 307200 1500
68921648 hakobdilif B Jan. 16, 2020, 9:32 a.m. OK MS C++ 2017 TESTS 40 31 307200 1500
67387126 shivam1420 B Dec. 21, 2019, 6:12 p.m. OK Node.js TESTS 39 217 4300800 1500
67631732 vjudge1 B Dec. 26, 2019, 4:28 a.m. OK Node.js TESTS 40 1559 5427200 1500
67631845 vjudge1 B Dec. 26, 2019, 4:32 a.m. OK Node.js TESTS 40 2028 9216000 1500
67631665 vjudge3 B Dec. 26, 2019, 4:26 a.m. OK Node.js TESTS 40 2214 38912000 1500
67339266 aaa_bbb_ccc B Dec. 21, 2019, 11:26 a.m. OK PyPy 2 TESTS 38 140 819200 1500
67364232 p1geon B Dec. 21, 2019, 12:50 p.m. OK PyPy 2 TESTS 38 156 1536000 1500
67346070 Mukundan314 B Dec. 21, 2019, 11:47 a.m. OK PyPy 2 TESTS 38 170 3686400 1500
67342593 raj1307 B Dec. 21, 2019, 11:36 a.m. OK PyPy 2 TESTS 38 187 3174400 1500
67343892 ashok123 B Dec. 21, 2019, 11:40 a.m. OK PyPy 2 TESTS 38 218 6348800 1500
67363964 iamprayush B Dec. 21, 2019, 12:49 p.m. OK PyPy 2 TESTS 38 327 9830400 1500
67335427 MVP B Dec. 21, 2019, 11:16 a.m. OK PyPy 2 TESTS 38 576 6656000 1500
67335058 Cifko B Dec. 21, 2019, 11:15 a.m. OK PyPy 2 TESTS 38 1606 120422400 1500
68097296 addammy B Jan. 2, 2020, 9:54 p.m. OK PyPy 3 TESTS 40 140 2150400 1500
67402422 io___oi B Dec. 22, 2019, 4:43 a.m. OK PyPy 3 TESTS 39 155 2150400 1500
67342389 cgfs10000 B Dec. 21, 2019, 11:35 a.m. OK PyPy 3 TESTS 38 155 2252800 1500
67374738 Udit2000 B Dec. 21, 2019, 2:48 p.m. OK PyPy 3 TESTS 38 155 2969600 1500
67364706 shade1010 B Dec. 21, 2019, 12:52 p.m. OK PyPy 3 TESTS 38 156 2355200 1500
67385772 postscript B Dec. 21, 2019, 5:46 p.m. OK PyPy 3 TESTS 39 170 2355200 1500
67355278 zgonnikov B Dec. 21, 2019, 12:18 p.m. OK PyPy 3 TESTS 38 171 2355200 1500
67381181 Mkay6122 B Dec. 21, 2019, 4:25 p.m. OK PyPy 3 TESTS 39 171 2457600 1500
67349050 Tihohon B Dec. 21, 2019, 11:57 a.m. OK PyPy 3 TESTS 38 171 2457600 1500
67509511 19n1900011773 B Dec. 24, 2019, 8:38 a.m. OK PyPy 3 TESTS 40 171 2969600 1500
68023091 pengyuhe B Jan. 1, 2020, 2:24 a.m. OK Python 2 TESTS 40 202 921600 1500
67350620 anonymous0314 B Dec. 21, 2019, 12:02 p.m. OK Python 2 TESTS 38 1341 409600 1500
67347917 sowmithdodda B Dec. 21, 2019, 11:53 a.m. OK Python 2 TESTS 38 2464 512000 1500
67341938 shelam B Dec. 21, 2019, 11:34 a.m. OK Python 3 TESTS 38 124 512000 1500
67360441 Prakhar314 B Dec. 21, 2019, 12:36 p.m. OK Python 3 TESTS 38 124 614400 1500
67342440 areo B Dec. 21, 2019, 11:35 a.m. OK Python 3 TESTS 38 124 716800 1500
67377517 BUCT_WynnLu B Dec. 21, 2019, 3:26 p.m. OK Python 3 TESTS 38 139 819200 1500
67343531 Shee11 B Dec. 21, 2019, 11:39 a.m. OK Python 3 TESTS 38 140 921600 1500
68992617 Jyunpp B Jan. 17, 2020, 3:52 p.m. OK Python 3 TESTS 40 155 614400 1500
67690089 motoras B Dec. 27, 2019, 10:42 a.m. OK Python 3 TESTS 40 155 614400 1500
67389387 LintuStorm B Dec. 21, 2019, 7:04 p.m. OK Python 3 TESTS 39 155 614400 1500
67374843 eugalt B Dec. 21, 2019, 2:50 p.m. OK Python 3 TESTS 38 155 614400 1500
67345150 I__D__ B Dec. 21, 2019, 11:44 a.m. OK Python 3 TESTS 38 155 921600 1500
67382733 comsyl B Dec. 21, 2019, 4:50 p.m. OK Rust TESTS 39 31 102400 1500
67351324 manta1130 B Dec. 21, 2019, 12:04 p.m. OK Rust TESTS 38 46 102400 1500
67342375 akiradeveloper B Dec. 21, 2019, 11:35 a.m. OK Rust TESTS 38 61 307200 1500

remove filters

Back to search problems