Codeforces Round 654 (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
1371 Codeforces Round 654 (Div. 2) FINISHED False 7200 143655863 July 1, 2020, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5298 ) E1 Asterism (Easy Version) PROGRAMMING brute force combinatorics implementation math number theory sortings

B"This is the easy version of the problem. The difference between versions is the constraints on n and a_i . You can make hacks only if all versions of the problem are solved. First, Aoi came up with the following idea for the competitive programming problem: Yuzu is a girl who collecting candies. Originally, she has x candies. There are also n enemies numbered with integers from 1 to n . Enemy i has a_i candies. Yuzu is going to determine a permutation P . A permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, {2,3,1,5,4 } is a permutation, but {1,2,2 } is not a permutation ( 2 appears twice in the array) and {1,3,4 } is also not a permutation (because n=3 but there is the number 4 in the array). After that, she will do n duels with the enemies with the following rules: Yuzu wants to win all duels. How many valid permutations P exist? This problem was easy and wasn't interesting for Akari, who is a friend of Aoi. And Akari made the following problem from the above idea: Let's define f(x) as the number of valid permutations for the integer x . You are given n , a and a prime number p <= n . Let's call a positive integer x good, if the value f(x) is not divisible by p . Find all good integers x . Your task is to solve this problem made by Akari. The first line contains two integers n , p (2 <= p <= n <= 2000) . It is guaranteed, that the number p is prime (it has exactly two divisors 1 and p ). The second line contains n integers a_1, a_2, ldots, a_n (1 <= a_i <= 2000) . In the first line, print the number of good integers x . In the second line, output all good integers x in the ascending order. It is guaranteed that the number of good integers x does not exceed 10^5$$"...

Tutorials

Codeforces Round #654 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
85692971 Gassa E1 July 1, 2020, 3:30 p.m. OK D TESTS 81 61 4198400
85679524 daut-dlang E1 July 1, 2020, 3:02 p.m. OK D TESTS 81 93 6144000
85702483 ruban E1 July 1, 2020, 5:02 p.m. OK Delphi TESTS 81 873 45363200
85702549 ruban E1 July 1, 2020, 5:03 p.m. OK FPC TESTS 81 140 45158400
85689360 yhc19990202 E1 July 1, 2020, 3:22 p.m. OK GNU C11 TESTS 81 31 0
85711274 rainboy E1 July 1, 2020, 6:35 p.m. OK GNU C11 TESTS 82 31 409600
85700334 physics0523 E1 July 1, 2020, 4:50 p.m. OK GNU C11 TESTS 81 46 2150400
85679769 hieu_2004 E1 July 1, 2020, 3:02 p.m. OK GNU C++11 TESTS 81 31 0
85675458 zzfzzfzzfs E1 July 1, 2020, 2:54 p.m. OK GNU C++11 TESTS 81 31 0
85673956 huangxiaohua E1 July 1, 2020, 2:51 p.m. OK GNU C++11 TESTS 81 31 0
85682540 liangjingtao E1 July 1, 2020, 3:08 p.m. OK GNU C++11 TESTS 81 31 0
85685310 Shaad7 E1 July 1, 2020, 3:14 p.m. OK GNU C++11 TESTS 81 31 0
85687117 cshuenss E1 July 1, 2020, 3:18 p.m. OK GNU C++11 TESTS 81 31 0
85684007 urzzy E1 July 1, 2020, 3:11 p.m. OK GNU C++11 TESTS 81 31 102400
85736399 Tremail E1 July 2, 2020, 4:55 a.m. OK GNU C++11 TESTS 82 31 102400
85704566 its_Atrap E1 July 1, 2020, 5:20 p.m. OK GNU C++11 TESTS 82 31 102400
85693372 romoho E1 July 1, 2020, 3:30 p.m. OK GNU C++11 TESTS 81 31 102400
85718783 uacoder123 E1 July 1, 2020, 8:51 p.m. OK GNU C++14 TESTS 82 31 0
85716962 exploooosion E1 July 1, 2020, 8:08 p.m. OK GNU C++14 TESTS 82 31 0
85716206 obaydullahmhs E1 July 1, 2020, 7:53 p.m. OK GNU C++14 TESTS 82 31 0
85712370 obaydullahmhs E1 July 1, 2020, 6:51 p.m. OK GNU C++14 TESTS 82 31 0
85710429 jainil4801 E1 July 1, 2020, 6:25 p.m. OK GNU C++14 TESTS 82 31 0
85703558 rijndael E1 July 1, 2020, 5:10 p.m. OK GNU C++14 TESTS 82 31 0
85692400 buihoatpt2k3 E1 July 1, 2020, 3:29 p.m. OK GNU C++14 TESTS 81 31 0
85729143 Boboge E1 July 2, 2020, 2:26 a.m. OK GNU C++14 TESTS 82 31 0
85721259 squarepanties E1 July 1, 2020, 10:02 p.m. OK GNU C++14 TESTS 82 31 0
85720148 destructor_19 E1 July 1, 2020, 9:29 p.m. OK GNU C++14 TESTS 82 31 0
85740526 divianshu_14 E1 July 2, 2020, 5:57 a.m. OK GNU C++17 TESTS 82 31 0
85737268 cypherop E1 July 2, 2020, 5:08 a.m. OK GNU C++17 TESTS 82 31 0
85732638 gol_en_05 E1 July 2, 2020, 3:43 a.m. OK GNU C++17 TESTS 82 31 0
85705861 Temmie E1 July 1, 2020, 5:32 p.m. OK GNU C++17 TESTS 82 31 0
85705584 Drice E1 July 1, 2020, 5:29 p.m. OK GNU C++17 TESTS 82 31 0
85703519 Andreus E1 July 1, 2020, 5:10 p.m. OK GNU C++17 TESTS 82 31 0
85700954 WeirdBugsButOkay E1 July 1, 2020, 4:53 p.m. OK GNU C++17 TESTS 81 31 0
85695873 Rivatus E1 July 1, 2020, 3:34 p.m. OK GNU C++17 TESTS 81 31 0
85683660 AlexJokel E1 July 1, 2020, 3:11 p.m. OK GNU C++17 TESTS 81 31 0
85673126 rqdmap E1 July 1, 2020, 2:49 p.m. OK GNU C++17 TESTS 81 31 0
85719773 Clu3l3ss E1 July 1, 2020, 9:18 p.m. OK GNU C++17 (64) TESTS 82 31 0
85727963 AQZZ E1 July 2, 2020, 1:57 a.m. OK GNU C++17 (64) TESTS 82 31 0
85717732 CodingKnight E1 July 1, 2020, 8:25 p.m. OK GNU C++17 (64) TESTS 82 31 204800
85717343 CodingKnight E1 July 1, 2020, 8:16 p.m. OK GNU C++17 (64) TESTS 82 31 307200
85717245 CodingKnight E1 July 1, 2020, 8:14 p.m. OK GNU C++17 (64) TESTS 82 31 307200
85713987 hemant1729 E1 July 1, 2020, 7:15 p.m. OK GNU C++17 (64) TESTS 82 31 307200
85710119 AlexFetisov E1 July 1, 2020, 6:20 p.m. OK GNU C++17 (64) TESTS 82 31 307200
85726530 Bekh E1 July 2, 2020, 1:19 a.m. OK GNU C++17 (64) TESTS 82 31 307200
85720328 lightseba E1 July 1, 2020, 9:34 p.m. OK GNU C++17 (64) TESTS 82 31 307200
85717479 CodingKnight E1 July 1, 2020, 8:19 p.m. OK GNU C++17 (64) TESTS 82 31 307200
85710436 Xylenox E1 July 1, 2020, 6:25 p.m. OK Go TESTS 82 46 102400
85690363 maguroguma E1 July 1, 2020, 3:25 p.m. OK Go TESTS 81 78 921600
85723406 Oopsimbad E1 July 1, 2020, 11:20 p.m. OK Java 11 TESTS 82 187 0
85722786 AshrafEzz E1 July 1, 2020, 10:55 p.m. OK Java 11 TESTS 82 202 0
85676330 blackBird E1 July 1, 2020, 2:55 p.m. OK Java 11 TESTS 81 202 0
85706319 fivefourthreeone E1 July 1, 2020, 5:37 p.m. OK Java 11 TESTS 82 217 0
85734689 pikapika00 E1 July 2, 2020, 4:24 a.m. OK Java 11 TESTS 82 218 0
85704024 bobib E1 July 1, 2020, 5:14 p.m. OK Java 11 TESTS 82 218 0
85676666 14visheshjain E1 July 1, 2020, 2:56 p.m. OK Java 11 TESTS 81 218 0
85720509 BNL E1 July 1, 2020, 9:39 p.m. OK Java 11 TESTS 82 218 18636800
85714810 Dukkha E1 July 1, 2020, 7:28 p.m. OK Java 11 TESTS 82 233 0
85714078 Dukkha E1 July 1, 2020, 7:17 p.m. OK Java 11 TESTS 82 233 0
85731748 pulkit14 E1 July 2, 2020, 3:25 a.m. OK Java 8 TESTS 82 124 0
85696116 flyman3046 E1 July 1, 2020, 3:34 p.m. OK Java 8 TESTS 81 124 0
85682496 robinz62 E1 July 1, 2020, 3:08 p.m. OK Java 8 TESTS 81 124 0
85676881 pulkit1411 E1 July 1, 2020, 2:56 p.m. OK Java 8 TESTS 81 139 0
85689675 monkeynhucci E1 July 1, 2020, 3:23 p.m. OK Java 8 TESTS 81 140 0
85682931 ashish1729 E1 July 1, 2020, 3:09 p.m. OK Java 8 TESTS 81 140 0
85677062 RohanC E1 July 1, 2020, 2:57 p.m. OK Java 8 TESTS 81 140 0
85672702 spar5h E1 July 1, 2020, 2:48 p.m. OK Java 8 TESTS 81 140 0
85672332 l0ngcon E1 July 1, 2020, 2:47 p.m. OK Java 8 TESTS 81 140 0
85668522 Failure E1 July 1, 2020, 2:40 p.m. OK Java 8 TESTS 81 140 0
85716185 Hakiobo E1 July 1, 2020, 7:52 p.m. OK Kotlin TESTS 82 140 614400
85695244 Tlatoani E1 July 1, 2020, 3:33 p.m. OK Kotlin TESTS 81 171 1228800
85675426 batkhuyag E1 July 1, 2020, 2:53 p.m. OK Kotlin TESTS 81 171 1228800
85667527 koboshi E1 July 1, 2020, 2:38 p.m. OK Kotlin TESTS 81 218 0
85701025 qlf9 E1 July 1, 2020, 4:53 p.m. OK Kotlin TESTS 81 233 1126400
85691594 golions E1 July 1, 2020, 3:27 p.m. OK Kotlin TESTS 81 233 1126400
85682676 yakamoto E1 July 1, 2020, 3:08 p.m. OK Kotlin TESTS 81 233 1126400
85680491 fancy_lettuce E1 July 1, 2020, 3:04 p.m. OK Mono C# TESTS 81 93 204800
85661792 Arnyev E1 July 1, 2020, 2:28 p.m. OK Mono C# TESTS 81 108 3993600
85662081 hibatibati E1 July 1, 2020, 2:28 p.m. OK Mono C# TESTS 81 108 3993600
85672298 terry_u16 E1 July 1, 2020, 2:47 p.m. OK Mono C# TESTS 81 108 3993600
85673157 eSeF_ E1 July 1, 2020, 2:49 p.m. OK Mono C# TESTS 81 108 71577600
85669069 mban259 E1 July 1, 2020, 2:41 p.m. OK Mono C# TESTS 81 139 3891200
85672997 r57shell E1 July 1, 2020, 2:49 p.m. OK MS C++ TESTS 81 109 102400
85688752 deuslovelt E1 July 1, 2020, 3:21 p.m. OK MS C++ 2017 TESTS 81 31 0
85700947 DavitMarg E1 July 1, 2020, 4:53 p.m. OK MS C++ 2017 TESTS 81 31 10137600
85671771 beastie E1 July 1, 2020, 2:46 p.m. OK MS C++ 2017 TESTS 81 46 0
85665804 Gravekper E1 July 1, 2020, 2:35 p.m. OK MS C++ 2017 TESTS 81 46 0
85684164 Present E1 July 1, 2020, 3:12 p.m. OK MS C++ 2017 TESTS 81 46 0
85700160 grey E1 July 1, 2020, 4:49 p.m. OK MS C++ 2017 TESTS 81 46 0
85739928 rhksdn6227 E1 July 2, 2020, 5:50 a.m. OK MS C++ 2017 TESTS 82 46 0
85686101 Numbervan E1 July 1, 2020, 3:16 p.m. OK MS C++ 2017 TESTS 81 46 0
85677861 PrankMaN E1 July 1, 2020, 2:58 p.m. OK MS C++ 2017 TESTS 81 46 0
85677386 JulesIMF E1 July 1, 2020, 2:57 p.m. OK MS C++ 2017 TESTS 81 46 0
85669706 darkkcyan E1 July 1, 2020, 2:42 p.m. OK Node.js TESTS 81 108 409600
85716783 raj1307 E1 July 1, 2020, 8:03 p.m. OK PyPy 2 TESTS 82 140 1331200
85677103 pajenegod E1 July 1, 2020, 2:57 p.m. OK PyPy 2 TESTS 81 140 1740800
85716850 raj1307 E1 July 1, 2020, 8:05 p.m. OK PyPy 2 TESTS 82 155 1331200
85680906 bazzyadb E1 July 1, 2020, 3:05 p.m. OK PyPy 2 TESTS 81 156 1228800
85672415 Hitikkumar E1 July 1, 2020, 2:48 p.m. OK PyPy 2 TESTS 81 202 2252800
85713990 ap1008 E1 July 1, 2020, 7:15 p.m. OK PyPy 2 TESTS 82 639 2969600
85689576 c1729 E1 July 1, 2020, 3:23 p.m. OK PyPy 2 TESTS 81 654 3379200
85700634 conqueror_of_tourist E1 July 1, 2020, 4:51 p.m. OK PyPy 3 TESTS 81 140 1945600
85703663 KnowledgeIsMine E1 July 1, 2020, 5:11 p.m. OK PyPy 3 TESTS 82 155 1945600
85689253 Bruteforceman E1 July 1, 2020, 3:22 p.m. OK PyPy 3 TESTS 81 155 2048000
85691176 smoke_bellew E1 July 1, 2020, 3:26 p.m. OK PyPy 3 TESTS 81 155 2764800
85718637 thekushalghosh E1 July 1, 2020, 8:48 p.m. OK PyPy 3 TESTS 82 155 3379200
85705081 titia E1 July 1, 2020, 5:25 p.m. OK PyPy 3 TESTS 82 156 2764800
85716472 Alex_Savitskiy E1 July 1, 2020, 7:58 p.m. OK PyPy 3 TESTS 82 171 2150400
85674069 anhdungle634 E1 July 1, 2020, 2:51 p.m. OK PyPy 3 TESTS 81 171 2252800
85699654 PBatch E1 July 1, 2020, 4:47 p.m. OK PyPy 3 TESTS 81 171 2355200
85694895 titia E1 July 1, 2020, 3:33 p.m. OK PyPy 3 TESTS 81 171 2764800
85714793 taoboquan1 E1 July 1, 2020, 7:28 p.m. OK Python 3 TESTS 82 109 307200
85701345 sh1194 E1 July 1, 2020, 4:55 p.m. OK Python 3 TESTS 81 109 307200
85700477 sh1194 E1 July 1, 2020, 4:50 p.m. OK Python 3 TESTS 81 109 307200
85708540 AAYush0 E1 July 1, 2020, 6:01 p.m. OK Python 3 TESTS 82 124 307200
85701031 sh1194 E1 July 1, 2020, 4:53 p.m. OK Python 3 TESTS 81 124 307200
85699883 sh1194 E1 July 1, 2020, 4:48 p.m. OK Python 3 TESTS 81 124 307200
85664957 kingmoshe E1 July 1, 2020, 2:33 p.m. OK Python 3 TESTS 81 124 307200
85728981 dlesces E1 July 2, 2020, 2:22 a.m. OK Python 3 TESTS 82 155 716800
85725767 dlesces E1 July 2, 2020, 12:54 a.m. OK Python 3 TESTS 82 155 716800
85724869 dlesces E1 July 2, 2020, 12:21 a.m. OK Python 3 TESTS 82 155 716800
85678399 t_uchida E1 July 1, 2020, 3 p.m. OK Rust TESTS 81 46 0
85675420 robostac E1 July 1, 2020, 2:53 p.m. OK Rust TESTS 81 93 102400
85689039 bqn E1 July 1, 2020, 3:22 p.m. OK Rust TESTS 81 155 102400

remove filters

Back to search problems