Codeforces Round 663 (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
1391 Codeforces Round 663 (Div. 2) FINISHED False 7200 134839499 Aug. 9, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15066 ) C Cyclic Permutations PROGRAMMING combinatorics graphs math

B'A permutation of length n 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 ( n=3 but there is 4 in the array). Consider a permutation p of length n , we build a graph of size n using it as follows: In cases where no such j exists, we make no edges. Also, note that we make edges between the corresponding indices, not the values at those indices. For clarity, consider as an example n = 4 , and p = [3,1,4,2] ; here, the edges of the graph are (1,3),(2,1),(2,3),(4,3) . A permutation p is cyclic if the graph built using p has at least one simple cycle. Given n , find the number of cyclic permutations of length n . Since the number may be very large, output it modulo 10^9+7 . Please refer to the Notes section for the formal definition of a simple cycle The first and only line contains a single integer n ( 3 <= n <= 10^6 ). Output a single integer 0 <= q x < 10^9+7 , the number of cyclic permutations of length n modulo 10^9+7 . There are 16 cyclic permutations for n = 4 . [4,2,1,3] is one such permutation, having a cycle of length four: 4 rightarrow 3 rightarrow 2 rightarrow 1 rightarrow 4 . Nodes v_1 , v_2 , ldots , v_k form a simple cycle if the following conditions hold: '...

Tutorials

Codeforces Round #663 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
89750906 luogu_bot3 C Aug. 13, 2020, 1:08 a.m. OK FPC TESTS 12 31 0
89779025 luogu_bot4 C Aug. 13, 2020, 9:14 a.m. OK FPC TESTS 12 31 0
89655668 Licykoc C Aug. 12, 2020, 1:44 p.m. OK FPC TESTS 12 46 3481600
90076366 huhst2020_006 C Aug. 16, 2020, 11:02 a.m. OK GNU C11 TESTS 12 31 0
89569704 Rizwan21 C Aug. 11, 2020, 10:43 a.m. OK GNU C11 TESTS 12 31 3686400
89587998 JoseTomas01 C Aug. 11, 2020, 2:57 p.m. OK GNU C11 TESTS 12 31 3993600
90304504 Santanu_1999 C Aug. 18, 2020, 11:51 a.m. OK GNU C11 TESTS 12 46 31948800
89504041 samari06 C Aug. 10, 2020, 11:17 a.m. OK GNU C11 TESTS 12 373 35737600
91195707 FEILI C Aug. 28, 2020, 9:28 a.m. OK GNU C++11 TESTS 12 30 0
89576980 wlqtc C Aug. 11, 2020, 12:38 p.m. OK GNU C++11 TESTS 12 30 3891200
89527040 pranshukas C Aug. 10, 2020, 4:35 p.m. OK GNU C++11 TESTS 12 30 3891200
89483664 Shub124 C Aug. 10, 2020, 5:59 a.m. OK GNU C++11 TESTS 12 30 3891200
89615427 chen-.- C Aug. 12, 2020, 1:56 a.m. OK GNU C++11 TESTS 12 30 4096000
91306037 Ahmad45123 C Aug. 29, 2020, 6:30 p.m. OK GNU C++11 TESTS 12 31 0
91318241 switchpiggy C Aug. 30, 2020, 1:54 a.m. OK GNU C++11 TESTS 12 31 0
91495704 Layn C Aug. 31, 2020, 1:39 p.m. OK GNU C++11 TESTS 12 31 0
91549728 coldiceh C Sept. 1, 2020, 8:43 a.m. OK GNU C++11 TESTS 12 31 0
91708810 tle_error C Sept. 3, 2020, 10:39 a.m. OK GNU C++11 TESTS 12 31 0
89575435 poisonserpent_17 C Aug. 11, 2020, 12:13 p.m. OK GNU C++14 TESTS 12 15 3788800
89502939 Opt_cat C Aug. 10, 2020, 11 a.m. OK GNU C++14 TESTS 12 30 3686400
91324817 rickbaishuak C Aug. 30, 2020, 6:28 a.m. OK GNU C++14 TESTS 12 30 3686400
89573498 DFlameWolf C Aug. 11, 2020, 11:43 a.m. OK GNU C++14 TESTS 12 30 3686400
89569223 binaryboy1234 C Aug. 11, 2020, 10:35 a.m. OK GNU C++14 TESTS 12 30 3686400
89560551 M23102000 C Aug. 11, 2020, 8:15 a.m. OK GNU C++14 TESTS 12 30 3686400
89493854 soumyamehta21 C Aug. 10, 2020, 8:32 a.m. OK GNU C++14 TESTS 12 30 3788800
91646682 CHAOSCONTROL_JR C Sept. 2, 2020, 1:55 p.m. OK GNU C++14 TESTS 12 31 0
91540527 icomplex09 C Sept. 1, 2020, 6:20 a.m. OK GNU C++14 TESTS 12 31 0
91290187 lelouvincx C Aug. 29, 2020, 2:05 p.m. OK GNU C++14 TESTS 12 31 0
91298107 sktcodeforces C Aug. 29, 2020, 4:09 p.m. OK GNU C++17 TESTS 12 30 0
91539402 milon603 C Sept. 1, 2020, 5:59 a.m. OK GNU C++17 TESTS 12 30 0
89487156 IITAPOORV094 C Aug. 10, 2020, 6:54 a.m. OK GNU C++17 TESTS 12 30 3686400
89578102 krishanupaul26 C Aug. 11, 2020, 12:54 p.m. OK GNU C++17 TESTS 12 30 3686400
89568584 CppDebuger C Aug. 11, 2020, 10:24 a.m. OK GNU C++17 TESTS 12 30 3686400
89494644 BigDaddy2404 C Aug. 10, 2020, 8:45 a.m. OK GNU C++17 TESTS 12 30 3686400
89486303 byrtho_kobi C Aug. 10, 2020, 6:42 a.m. OK GNU C++17 TESTS 12 30 3686400
89543438 Archanimal890 C Aug. 11, 2020, 2:34 a.m. OK GNU C++17 TESTS 12 30 3788800
89545347 hahaac18 C Aug. 11, 2020, 3:33 a.m. OK GNU C++17 TESTS 12 30 11776000
91657282 niganiga C Sept. 2, 2020, 4:03 p.m. OK GNU C++17 TESTS 12 31 0
90410343 ddvddv C Aug. 19, 2020, 5:27 p.m. OK GNU C++17 (64) TESTS 12 15 0
91256196 theempireofQin C Aug. 29, 2020, 4:54 a.m. OK GNU C++17 (64) TESTS 12 15 0
89491154 agarwala2512 C Aug. 10, 2020, 7:52 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
90520036 SSYernar C Aug. 21, 2020, 9:39 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
89642295 hltk C Aug. 12, 2020, 10:29 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
89622451 phoenix_0010 C Aug. 12, 2020, 5:13 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
89509163 Dutt852 C Aug. 10, 2020, 12:32 p.m. OK GNU C++17 (64) TESTS 12 15 4300800
89499065 RedBlade098 C Aug. 10, 2020, 9:57 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
90321972 TheOneYouWant C Aug. 18, 2020, 3:23 p.m. OK GNU C++17 (64) TESTS 12 30 0
91640416 Macdu C Sept. 2, 2020, 12:32 p.m. OK GNU C++17 (64) TESTS 12 30 0
89533963 jc881203 C Aug. 10, 2020, 8:05 p.m. OK Go TESTS 12 62 11878400
89520181 cuzynot C Aug. 10, 2020, 2:57 p.m. OK Java 11 TESTS 12 171 23756800
89491368 megyeri99 C Aug. 10, 2020, 7:55 a.m. OK Java 11 TESTS 12 171 23756800
89583968 sha_gun C Aug. 11, 2020, 2:10 p.m. OK Java 11 TESTS 12 186 24064000
89527754 Piyush98 C Aug. 10, 2020, 4:48 p.m. OK Java 11 TESTS 12 186 31846400
89493013 decoder_1671 C Aug. 10, 2020, 8:19 a.m. OK Java 11 TESTS 12 186 64000000
91217131 nagu-pm C Aug. 28, 2020, 2:28 p.m. OK Java 11 TESTS 12 187 0
90323234 anhtaihsgs C Aug. 18, 2020, 3:36 p.m. OK Java 11 TESTS 12 187 0
89494841 parshwa52 C Aug. 10, 2020, 8:48 a.m. OK Java 11 TESTS 12 187 23756800
89575557 _apurv_ C Aug. 11, 2020, 12:15 p.m. OK Java 11 TESTS 12 187 23756800
89567357 In_The_Name_Of_Love C Aug. 11, 2020, 10:05 a.m. OK Java 11 TESTS 12 187 23756800
90378738 OnFireVivek C Aug. 19, 2020, 10:19 a.m. OK Java 8 TESTS 12 109 0
91273377 shojin_pro C Aug. 29, 2020, 9:44 a.m. OK Java 8 TESTS 12 109 5529600
89588831 MartyByrde C Aug. 11, 2020, 3:08 p.m. OK Java 8 TESTS 12 109 20172800
89521117 chesiver C Aug. 10, 2020, 3:10 p.m. OK Java 8 TESTS 12 109 20172800
89599988 rdsaurabh97 C Aug. 11, 2020, 5:47 p.m. OK Java 8 TESTS 12 109 20275200
89556600 lolling C Aug. 11, 2020, 7:15 a.m. OK Java 8 TESTS 12 109 20275200
89508393 kalzor C Aug. 10, 2020, 12:21 p.m. OK Java 8 TESTS 12 109 20275200
90462336 srvptk97 C Aug. 20, 2020, 12:35 p.m. OK Java 8 TESTS 12 124 0
90235430 aearly C Aug. 17, 2020, 2:07 p.m. OK Java 8 TESTS 12 124 0
90047399 Amazed C Aug. 15, 2020, 9:51 p.m. OK Java 8 TESTS 12 124 0
89763381 Timovar C Aug. 13, 2020, 5:41 a.m. OK Kotlin TESTS 12 124 0
89614384 Spheniscine C Aug. 12, 2020, 1:15 a.m. OK Kotlin TESTS 12 124 20480000
89593319 dkozak94 C Aug. 11, 2020, 4:07 p.m. OK Kotlin TESTS 12 140 20275200
90344375 speshuric C Aug. 18, 2020, 9 p.m. OK Kotlin TESTS 12 155 0
89643782 gaozqxin C Aug. 12, 2020, 10:53 a.m. OK Mono C# TESTS 12 93 8601600
90078218 AliceNCsyuk C Aug. 16, 2020, 11:37 a.m. OK MS C++ TESTS 12 46 0
89797184 vjudge2 C Aug. 13, 2020, 1:17 p.m. OK MS C++ 2017 TESTS 12 46 0
90003526 dixmw34 C Aug. 15, 2020, 8:55 a.m. OK MS C++ 2017 TESTS 12 46 0
89648318 Roman02 C Aug. 12, 2020, noon OK MS C++ 2017 TESTS 12 46 3686400
89630272 jdb0ss C Aug. 12, 2020, 7:24 a.m. OK MS C++ 2017 TESTS 12 46 3686400
89603066 SyberiaEmperor C Aug. 11, 2020, 6:41 p.m. OK MS C++ 2017 TESTS 12 46 3686400
89494387 Gold_Fridge C Aug. 10, 2020, 8:41 a.m. OK MS C++ 2017 TESTS 12 46 3686400
89490896 casillas123 C Aug. 10, 2020, 7:49 a.m. OK MS C++ 2017 TESTS 12 46 3686400
90509163 dixmw34 C Aug. 21, 2020, 7:06 a.m. OK MS C++ 2017 TESTS 12 46 3686400
89622230 hww C Aug. 12, 2020, 5:07 a.m. OK MS C++ 2017 TESTS 12 46 3788800
91616157 KRIS1 C Sept. 2, 2020, 6:15 a.m. OK MS C++ 2017 TESTS 12 61 307200
89620646 explorer_sifat C Aug. 12, 2020, 4:27 a.m. OK Node.js TESTS 12 109 14131200
89981909 Mukundan314 C Aug. 15, 2020, 2:55 a.m. OK PyPy 2 TESTS 12 124 102400
89546012 sheraram C Aug. 11, 2020, 3:51 a.m. OK PyPy 2 TESTS 12 155 23244800
89568599 mrinal2233 C Aug. 11, 2020, 10:24 a.m. OK PyPy 2 TESTS 12 171 23449600
90092409 kanfyti C Aug. 16, 2020, 2:39 p.m. OK PyPy 3 TESTS 12 155 1228800
89841877 nantha_manish C Aug. 14, 2020, 5 a.m. OK PyPy 3 TESTS 12 155 1228800
89781736 shanu_im C Aug. 13, 2020, 9:50 a.m. OK PyPy 3 TESTS 12 155 1228800
90352061 rubber_duckieOwOwO C Aug. 19, 2020, 2:17 a.m. OK PyPy 3 TESTS 12 155 1331200
89753738 govindsaj C Aug. 13, 2020, 2:32 a.m. OK PyPy 3 TESTS 12 155 1331200
90264227 pranshukh C Aug. 17, 2020, 9:28 p.m. OK PyPy 3 TESTS 12 155 1433600
90022413 lambda_x C Aug. 15, 2020, 1:37 p.m. OK PyPy 3 TESTS 12 155 1433600
89811647 daikisuyama C Aug. 13, 2020, 4:15 p.m. OK PyPy 3 TESTS 12 155 1433600
90481610 roman_povolotskii C Aug. 20, 2020, 4:33 p.m. OK PyPy 3 TESTS 12 155 1536000
90244863 burfnerd C Aug. 17, 2020, 3:50 p.m. OK PyPy 3 TESTS 12 155 1638400
89544046 eugalt C Aug. 11, 2020, 2:53 a.m. OK Python 2 TESTS 12 467 6963200
89525093 mahesh_183 C Aug. 10, 2020, 4:03 p.m. OK Python 3 TESTS 12 296 6963200
89973548 Liberator187 C Aug. 14, 2020, 9:07 p.m. OK Python 3 TESTS 12 342 512000
89483044 maddenvvs C Aug. 10, 2020, 5:48 a.m. OK Python 3 TESTS 12 343 6758400
90033660 i_love_vim C Aug. 15, 2020, 4:18 p.m. OK Python 3 TESTS 12 358 0
89485255 deepcoder_B C Aug. 10, 2020, 6:25 a.m. OK Python 3 TESTS 12 373 6963200
89523906 sainad C Aug. 10, 2020, 3:46 p.m. OK Python 3 TESTS 12 389 6656000
89604180 HodaAnwer C Aug. 11, 2020, 7:02 p.m. OK Python 3 TESTS 12 405 6656000
89581005 Rakmom C Aug. 11, 2020, 1:33 p.m. OK Python 3 TESTS 12 420 6656000
89523360 sainad C Aug. 10, 2020, 3:38 p.m. OK Python 3 TESTS 12 420 6656000
89523025 sainad C Aug. 10, 2020, 3:34 p.m. OK Python 3 TESTS 12 420 6656000
89769014 xodeChemist C Aug. 13, 2020, 7:04 a.m. OK Ruby TESTS 12 764 204800
90382537 searchstar C Aug. 19, 2020, 11:14 a.m. OK Rust TESTS 12 46 0
90382272 searchstar C Aug. 19, 2020, 11:10 a.m. OK Rust TESTS 12 46 0
90381393 searchstar C Aug. 19, 2020, 10:58 a.m. OK Rust TESTS 12 46 0
89834639 Strorkis C Aug. 14, 2020, 1:54 a.m. OK Rust TESTS 12 46 0
89528474 jrodrigues C Aug. 10, 2020, 5 p.m. OK Rust TESTS 12 46 3788800
89555660 terraformer C Aug. 11, 2020, 7:01 a.m. OK Rust TESTS 12 904 19763200

remove filters

Back to search problems