Codeforces Round 639 (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
1344 Codeforces Round 639 (Div. 1) FINISHED False 8100 148577111 May 6, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15792 ) A Hilbert's Hotel PROGRAMMING math number theory sortings 1600

B'Hilbert 's Hotel is a very unusual hotel since the number of rooms is infinite! In fact, there is exactly one room for every integer, including zero and negative integers. Even stranger, the hotel is currently at full capacity, meaning there is exactly one guest in every room. The hotel 's manager, David Hilbert himself, decides he wants to shuffle the guests around because he thinks this will create a vacancy (a room without a guest). For any integer k and positive integer n , let k bmod n denote the remainder when k is divided by n . More formally, r=k bmod n is the smallest non-negative integer such that k-r is divisible by n . It always holds that 0 <= k bmod n <= n-1 . For example, 100 bmod 12=4 and (-1337) bmod 3=1 . Then the shuffling works as follows. There is an array of n integers a_0,a_1, ldots,a_{n-1} . Then for each integer k , the guest in room k is moved to room number k+a_{k bmod n} . After this shuffling process, determine if there is still exactly one guest assigned to each room. That is, there are no vacancies or rooms with multiple guests. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Next 2t lines contain descriptions of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of the array. The second line of each test case contains n integers a_0,a_1, ldots,a_{n-1} ( -10^9 <= a_i <= 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single line containing "YES" if there is exactly one guest assigned to each room after the shuffling process, or "NO" otherwise. You can print each letter in any case (upper or lower). In the first test case, every guest is shifted by 14 rooms, so t'...

Tutorials

Codeforces Round #639 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
79162169 hos.lyric A May 6, 2020, 2:54 p.m. OK D TESTS 26 109 18227200 1600
79151633 Gassa A May 6, 2020, 2:41 p.m. OK D TESTS 26 109 18227200 1600
79162666 physics0523 A May 6, 2020, 2:54 p.m. OK GNU C11 TESTS 26 124 28876800 1600
79151033 LJC00118 A May 6, 2020, 2:41 p.m. OK GNU C++11 TESTS 26 31 4710400 1600
79244529 Frame233 A May 7, 2020, 7:39 a.m. OK GNU C++11 TESTS 26 31 4710400 1600
79151859 Chtholly_Froggy A May 6, 2020, 2:42 p.m. OK GNU C++11 TESTS 26 31 5529600 1600
79155456 DWAE86 A May 6, 2020, 2:46 p.m. OK GNU C++11 TESTS 26 31 5529600 1600
79152054 Binary_Search_Tree A May 6, 2020, 2:42 p.m. OK GNU C++11 TESTS 26 31 8908800 1600
79151043 Fuyuki A May 6, 2020, 2:41 p.m. OK GNU C++11 TESTS 26 31 11980800 1600
79161913 Golden_Time A May 6, 2020, 2:53 p.m. OK GNU C++11 TESTS 26 46 3891200 1600
79150700 huhaoo A May 6, 2020, 2:40 p.m. OK GNU C++11 TESTS 26 46 4505600 1600
79252741 wasa855 A May 7, 2020, 9:15 a.m. OK GNU C++11 TESTS 26 46 4710400 1600
79431829 Rainbow_sjy A May 9, 2020, 5:09 a.m. OK GNU C++11 TESTS 26 46 4710400 1600
79156438 NotaMotuaQAQ A May 6, 2020, 2:47 p.m. OK GNU C++14 TESTS 26 31 8704000 1600
79153230 danya090699 A May 6, 2020, 2:43 p.m. OK GNU C++14 TESTS 26 62 3891200 1600
79172938 dixitgarg A May 6, 2020, 3:10 p.m. OK GNU C++14 TESTS 26 62 5529600 1600
79209281 hackerwizard A May 6, 2020, 9:28 p.m. OK GNU C++14 TESTS 26 77 3891200 1600
79208185 hackerwizard A May 6, 2020, 9 p.m. OK GNU C++14 TESTS 26 77 3891200 1600
79155990 kimjihoon A May 6, 2020, 2:46 p.m. OK GNU C++14 TESTS 26 77 3891200 1600
79154616 Minnakhmetov A May 6, 2020, 2:45 p.m. OK GNU C++14 TESTS 26 77 3891200 1600
79154601 _no0B A May 6, 2020, 2:45 p.m. OK GNU C++14 TESTS 26 77 3891200 1600
79151985 CodePlatina A May 6, 2020, 2:42 p.m. OK GNU C++14 TESTS 26 77 3891200 1600
79229484 Invisible_Shadow A May 7, 2020, 4:40 a.m. OK GNU C++14 TESTS 26 77 3891200 1600
79149721 LayCurse A May 6, 2020, 2:39 p.m. OK GNU C++17 TESTS 26 46 7475200 1600
79376086 _andyli A May 8, 2020, 12:11 p.m. OK GNU C++17 TESTS 26 46 9523200 1600
79342962 interestingLSY A May 8, 2020, 4:28 a.m. OK GNU C++17 TESTS 26 46 10035200 1600
79151656 SoulTch A May 6, 2020, 2:41 p.m. OK GNU C++17 TESTS 26 62 3891200 1600
79421289 saiful.dh A May 8, 2020, 11:35 p.m. OK GNU C++17 TESTS 26 62 4096000 1600
79150477 Vedensky A May 6, 2020, 2:40 p.m. OK GNU C++17 TESTS 26 62 4505600 1600
79221955 thtsshz_bgwrswh A May 7, 2020, 2:33 a.m. OK GNU C++17 TESTS 26 62 4710400 1600
79157826 1252351876 A May 6, 2020, 2:48 p.m. OK GNU C++17 TESTS 26 62 5324800 1600
79154176 CharacterMe A May 6, 2020, 2:45 p.m. OK GNU C++17 TESTS 26 77 3788800 1600
79329396 Nanored A May 7, 2020, 9:50 p.m. OK GNU C++17 TESTS 26 77 3891200 1600
79165797 sammyMaX A May 6, 2020, 2:59 p.m. OK GNU C++17 (64) TESTS 26 46 4300800 1600
79152407 Agua_Podrida A May 6, 2020, 2:42 p.m. OK GNU C++17 (64) TESTS 26 61 5120000 1600
79151468 saketh A May 6, 2020, 2:41 p.m. OK GNU C++17 (64) TESTS 26 61 5120000 1600
79154030 kessido A May 6, 2020, 2:44 p.m. OK GNU C++17 (64) TESTS 26 61 5120000 1600
79177528 Scissors_Ss A May 6, 2020, 3:19 p.m. OK GNU C++17 (64) TESTS 26 61 5222400 1600
79155820 neko_nyaaaaaaaaaaaaaaaaa A May 6, 2020, 2:46 p.m. OK GNU C++17 (64) TESTS 26 61 5939200 1600
79153130 fedoseev.timofey A May 6, 2020, 2:43 p.m. OK GNU C++17 (64) TESTS 26 61 5939200 1600
79150632 lightseba A May 6, 2020, 2:40 p.m. OK GNU C++17 (64) TESTS 26 61 5939200 1600
79149881 majk A May 6, 2020, 2:39 p.m. OK GNU C++17 (64) TESTS 26 61 5939200 1600
79149841 FlowerOfSorrow A May 6, 2020, 2:39 p.m. OK GNU C++17 (64) TESTS 26 61 5939200 1600
79240865 wang.senyuan A May 7, 2020, 6:59 a.m. OK Go TESTS 26 93 17100800 1600
79214317 glebsamsonov A May 6, 2020, 11:15 p.m. OK Go TESTS 26 93 44134400 1600
79330284 Laurens A May 7, 2020, 10:13 p.m. OK Haskell TESTS 26 187 43315200 1600
79155480 Russell_Emerine A May 6, 2020, 2:46 p.m. OK Haskell TESTS 26 717 64307200 1600
79175561 cirno3153 A May 6, 2020, 3:15 p.m. OK Java 11 TESTS 26 202 23961600 1600
79149913 awesomelemonade A May 6, 2020, 2:39 p.m. OK Java 11 TESTS 26 217 24883200 1600
79149765 uwi A May 6, 2020, 2:39 p.m. OK Java 11 TESTS 26 218 24064000 1600
79149211 Lewin A May 6, 2020, 2:38 p.m. OK Java 11 TESTS 26 233 24064000 1600
79244924 unicorn228 A May 7, 2020, 7:43 a.m. OK Java 11 TESTS 26 233 24883200 1600
79149292 VArtem A May 6, 2020, 2:38 p.m. OK Java 11 TESTS 26 234 24780800 1600
79210777 TheSawan A May 6, 2020, 9:56 p.m. OK Java 11 TESTS 26 280 28364800 1600
79207771 egaeus.code A May 6, 2020, 8:50 p.m. OK Java 11 TESTS 26 296 23961600 1600
79310004 adarsh000321 A May 7, 2020, 4:50 p.m. OK Java 11 TESTS 26 296 24780800 1600
79154548 dusty.and.rusty A May 6, 2020, 2:45 p.m. OK Java 11 TESTS 26 326 42905600 1600
79151729 cwise A May 6, 2020, 2:41 p.m. OK Java 8 TESTS 26 124 20889600 1600
79168784 aman28rwt A May 6, 2020, 3:04 p.m. OK Java 8 TESTS 26 155 21196800 1600
79395820 kareem3id A May 8, 2020, 4:07 p.m. OK Java 8 TESTS 26 155 25600000 1600
79429047 lizhijian A May 9, 2020, 4:01 a.m. OK Java 8 TESTS 26 156 25600000 1600
79166996 DanielW48 A May 6, 2020, 3:01 p.m. OK Java 8 TESTS 26 171 25600000 1600
79153885 Xylenox A May 6, 2020, 2:44 p.m. OK Java 8 TESTS 26 171 25600000 1600
79153559 qlf9 A May 6, 2020, 2:44 p.m. OK Java 8 TESTS 26 171 25702400 1600
79197619 DarLam A May 6, 2020, 4:17 p.m. OK Java 8 TESTS 26 171 25804800 1600
79207651 Sharon A May 6, 2020, 8:48 p.m. OK Java 8 TESTS 26 186 25497600 1600
79150563 YahiaSherif A May 6, 2020, 2:40 p.m. OK Java 8 TESTS 26 186 28774400 1600
79150204 Eva A May 6, 2020, 2:40 p.m. OK Kotlin TESTS 26 170 27136000 1600
79149838 Tlatoani A May 6, 2020, 2:39 p.m. OK Kotlin TESTS 26 264 42393600 1600
79211186 knightL A May 6, 2020, 10:03 p.m. OK Kotlin TESTS 26 373 39936000 1600
79152282 elizarov A May 6, 2020, 2:42 p.m. OK Kotlin TESTS 26 374 38809600 1600
79152897 Yupiteru A May 6, 2020, 2:43 p.m. OK Mono C# TESTS 26 109 157184000 1600
79152621 mban259 A May 6, 2020, 2:43 p.m. OK Mono C# TESTS 26 140 39219200 1600
79189357 hibatibati A May 6, 2020, 3:47 p.m. OK Mono C# TESTS 26 171 38604800 1600
79151086 keymoon A May 6, 2020, 2:41 p.m. OK Mono C# TESTS 26 171 42086400 1600
79170717 lxhgww A May 6, 2020, 3:07 p.m. OK MS C++ TESTS 26 77 4710400 1600
79188903 P___ A May 6, 2020, 3:46 p.m. OK MS C++ 2017 TESTS 26 93 4505600 1600
79150722 pichulia A May 6, 2020, 2:40 p.m. OK MS C++ 2017 TESTS 26 93 5324800 1600
79155148 tarattata1 A May 6, 2020, 2:46 p.m. OK MS C++ 2017 TESTS 26 140 7782400 1600
79162217 alex_36 A May 6, 2020, 2:54 p.m. OK MS C++ 2017 TESTS 26 202 5324800 1600
79157290 vpike A May 6, 2020, 2:48 p.m. OK MS C++ 2017 TESTS 26 202 5324800 1600
79236663 buping A May 7, 2020, 6:15 a.m. OK MS C++ 2017 TESTS 26 248 5324800 1600
79156000 Pasqual45 A May 6, 2020, 2:46 p.m. OK MS C++ 2017 TESTS 26 249 4505600 1600
79217357 areo A May 7, 2020, 12:42 a.m. OK MS C++ 2017 TESTS 26 249 7782400 1600
79431188 GreedyCoder999 A May 9, 2020, 4:55 a.m. OK MS C++ 2017 TESTS 26 264 7884800 1600
79241790 kupriyanov A May 7, 2020, 7:09 a.m. OK MS C++ 2017 TESTS 26 265 6860800 1600
79231946 Mukundan314 A May 7, 2020, 5:17 a.m. OK PyPy 2 TESTS 26 202 37683200 1600
79175958 pajenegod A May 6, 2020, 3:16 p.m. OK PyPy 2 TESTS 26 451 36044800 1600
79463224 pajenegod A May 9, 2020, 12:29 p.m. OK PyPy 3 TESTS 26 218 34201600 1600
79150723 tamato A May 6, 2020, 2:40 p.m. OK PyPy 3 TESTS 26 218 40038400 1600
79463161 pajenegod A May 9, 2020, 12:28 p.m. OK PyPy 3 TESTS 26 248 34201600 1600
79161190 su565fx A May 6, 2020, 2:53 p.m. OK PyPy 3 TESTS 26 265 40345600 1600
79150290 MAO1112 A May 6, 2020, 2:40 p.m. OK PyPy 3 TESTS 26 312 42393600 1600
79150458 conqueror_of_tourist A May 6, 2020, 2:40 p.m. OK PyPy 3 TESTS 26 343 38092800 1600
79151267 pineriver A May 6, 2020, 2:41 p.m. OK PyPy 3 TESTS 26 358 38707200 1600
79157700 titia A May 6, 2020, 2:48 p.m. OK PyPy 3 TESTS 26 373 41676800 1600
79155610 nagitaosu A May 6, 2020, 2:46 p.m. OK PyPy 3 TESTS 26 374 37273600 1600
79150895 anagohirame A May 6, 2020, 2:41 p.m. OK PyPy 3 TESTS 26 374 39219200 1600
79165104 mkawa2 A May 6, 2020, 2:58 p.m. OK Python 3 TESTS 26 202 23552000 1600
79216972 buiductoan207 A May 7, 2020, 12:31 a.m. OK Python 3 TESTS 26 233 24064000 1600
79216866 buiductoan207 A May 7, 2020, 12:27 a.m. OK Python 3 TESTS 26 249 23040000 1600
79391152 LethalPuppy A May 8, 2020, 3:13 p.m. OK Python 3 TESTS 26 280 22016000 1600
79216453 buiductoan207 A May 7, 2020, 12:15 a.m. OK Python 3 TESTS 26 296 22732800 1600
79158249 naagi A May 6, 2020, 2:49 p.m. OK Python 3 TESTS 26 296 22732800 1600
79154466 old_boo A May 6, 2020, 2:45 p.m. OK Python 3 TESTS 26 311 21913600 1600
79190431 potpath A May 6, 2020, 3:49 p.m. OK Python 3 TESTS 26 311 22732800 1600
79153580 Nanored A May 6, 2020, 2:44 p.m. OK Python 3 TESTS 26 311 22732800 1600
79454113 code_beast7 A May 9, 2020, 10:35 a.m. OK Python 3 TESTS 26 327 23347200 1600
79167696 cotton100pc A May 6, 2020, 3:02 p.m. OK Rust TESTS 26 46 9523200 1600
79215638 LeoRiether A May 6, 2020, 11:52 p.m. OK Rust TESTS 26 46 10035200 1600
79155191 darkkcyan A May 6, 2020, 2:46 p.m. OK Rust TESTS 26 62 14643200 1600
79433544 sansen A May 9, 2020, 5:42 a.m. OK Rust TESTS 26 93 15667200 1600
79170442 yuya178 A May 6, 2020, 3:06 p.m. OK Rust TESTS 26 155 10956800 1600
79237250 zz_kk A May 7, 2020, 6:21 a.m. OK Rust TESTS 26 249 4812800 1600
79458097 drywet A May 9, 2020, 11:26 a.m. OK Scala TESTS 26 701 55910400 1600

remove filters

Back to search problems