Codeforces Round 842 (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
1768 Codeforces Round 842 (Div. 2) FINISHED False 7200 58893899 Jan. 5, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 29060 ) A Greatest Convex PROGRAMMING greedy math number theory

B'You are given an integer k . Find the largest integer x , where 1 <= x < k , such that x! + (x - 1)!^ dagger is a multiple of ^ ddagger k , or determine that no such x exists. ^ dagger y! denotes the factorial of y , which is defined recursively as y! = y cdot (y-1)! for y geq 1 with the base case of 0! = 1 . For example, 5! = 5 cdot 4 cdot 3 cdot 2 cdot 1 cdot 0! = 120 . ^ ddagger If a and b are integers, then a is a multiple of b if there exists an integer c such that a = b cdot c . For example, 10 is a multiple of 5 but 9 is not a multiple of 6 . The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of test cases follows. The only line of each test case contains a single integer k ( 2 <= k <= 10^9 ). For each test case output a single integer -- the largest possible integer x that satisfies the conditions above. If no such x exists, output -1 . In the first test case, 2! + 1! = 2 + 1 = 3 , which is a multiple of 3 . In the third test case, 7! + 6! = 5040 + 720 = 5760 , which is a multiple of 8 . '...

Tutorials

Codeforces Round #842 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
188149433 bluemegane A Jan. 5, 2023, 10:52 p.m. OK C# 8 TESTS 8 140 716800
188146765 the_tadeusz A Jan. 5, 2023, 9:30 p.m. OK C# 8 TESTS 8 171 921600
188152469 Wizard_of_Orz A Jan. 6, 2023, 12:44 a.m. OK Clang++17 Diagnostics TESTS 9 46 0
188162391 kavi_khalique A Jan. 6, 2023, 4:19 a.m. OK Clang++17 Diagnostics TESTS 9 155 0
188132519 oppoman A Jan. 5, 2023, 6:09 p.m. OK Clang++20 Diagnostics TESTS 8 109 0
188136227 AR_aban0ub A Jan. 5, 2023, 6:42 p.m. OK Clang++20 Diagnostics TESTS 8 139 0
188158277 chrisvinh A Jan. 6, 2023, 3:06 a.m. OK Clang++20 Diagnostics TESTS 9 140 0
188160147 aabc A Jan. 6, 2023, 3:40 a.m. OK Clang++20 Diagnostics TESTS 9 155 0
188160102 aabc A Jan. 6, 2023, 3:40 a.m. OK Clang++20 Diagnostics TESTS 9 202 0
188131775 NenadDapic A Jan. 5, 2023, 6:04 p.m. OK FPC TESTS 8 30 0
188127864 edwardnvv57k A Jan. 5, 2023, 5:40 p.m. OK GNU C11 TESTS 8 15 0
188132214 rf_104 A Jan. 5, 2023, 6:07 p.m. OK GNU C11 TESTS 8 46 0
188153968 Lighty2 A Jan. 6, 2023, 1:30 a.m. OK GNU C11 TESTS 9 46 0
188155882 z._oh_94.02.88 A Jan. 6, 2023, 2:19 a.m. OK GNU C11 TESTS 9 46 0
188158042 Archit_130604 A Jan. 6, 2023, 3:02 a.m. OK GNU C11 TESTS 9 46 0
188166233 bkifhr9 A Jan. 6, 2023, 5:14 a.m. OK GNU C11 TESTS 9 46 0
188170183 SP2003 A Jan. 6, 2023, 5:59 a.m. OK GNU C11 TESTS 9 46 0
188170224 chirag_dudhagara49 A Jan. 6, 2023, 6 a.m. OK GNU C11 TESTS 9 46 0
188115634 RameshBabuAsh1 A Jan. 5, 2023, 4:21 p.m. OK GNU C11 TESTS 8 46 0
188128462 Arif_LU84 A Jan. 5, 2023, 5:44 p.m. OK GNU C11 TESTS 8 61 0
188135066 theboringguy A Jan. 5, 2023, 6:30 p.m. OK GNU C++14 TESTS 8 0 0
188167781 Anumoy_nandy A Jan. 6, 2023, 5:32 a.m. OK GNU C++14 TESTS 9 0 1843200
188161379 steven144 A Jan. 6, 2023, 4:03 a.m. OK GNU C++14 TESTS 9 15 0
188161651 Kevin8502 A Jan. 6, 2023, 4:07 a.m. OK GNU C++14 TESTS 9 15 0
188163105 Nanani A Jan. 6, 2023, 4:31 a.m. OK GNU C++14 TESTS 9 15 0
188163836 u2x1 A Jan. 6, 2023, 4:42 a.m. OK GNU C++14 TESTS 9 15 0
188164318 JianrongHai A Jan. 6, 2023, 4:49 a.m. OK GNU C++14 TESTS 9 15 0
188166900 Williamtank A Jan. 6, 2023, 5:22 a.m. OK GNU C++14 TESTS 9 15 0
188167620 silentsolver A Jan. 6, 2023, 5:31 a.m. OK GNU C++14 TESTS 9 15 0
188161485 hero9505 A Jan. 6, 2023, 4:04 a.m. OK GNU C++14 TESTS 9 15 0
188135861 Sattu_45 A Jan. 5, 2023, 6:38 p.m. OK GNU C++17 TESTS 8 0 0
188149248 Omar_mabrouk A Jan. 5, 2023, 10:46 p.m. OK GNU C++17 TESTS 8 0 0
188126209 LazyNagib A Jan. 5, 2023, 5:33 p.m. OK GNU C++17 TESTS 8 0 0
188166587 shivangnegi01 A Jan. 6, 2023, 5:18 a.m. OK GNU C++17 TESTS 9 15 0
188167901 shishankrawat93774 A Jan. 6, 2023, 5:34 a.m. OK GNU C++17 TESTS 9 15 0
188166718 page_fault A Jan. 6, 2023, 5:20 a.m. OK GNU C++17 TESTS 9 15 0
188169837 Hungvu11 A Jan. 6, 2023, 5:55 a.m. OK GNU C++17 TESTS 9 15 0
188169238 Longqiang A Jan. 6, 2023, 5:49 a.m. OK GNU C++17 TESTS 9 15 0
188169088 Tunggg A Jan. 6, 2023, 5:47 a.m. OK GNU C++17 TESTS 9 15 0
188169049 DiabloNemesis A Jan. 6, 2023, 5:47 a.m. OK GNU C++17 TESTS 9 15 0
188146090 michao A Jan. 5, 2023, 9:14 p.m. OK GNU C++17 (64) TESTS 8 0 0
188155169 luogu_bot2 A Jan. 6, 2023, 2:02 a.m. OK GNU C++17 (64) TESTS 9 0 0
188166007 JYJin A Jan. 6, 2023, 5:11 a.m. OK GNU C++17 (64) TESTS 9 15 0
188169636 Maginy_ZYX A Jan. 6, 2023, 5:53 a.m. OK GNU C++17 (64) TESTS 9 15 0
188164728 Kashyap_09 A Jan. 6, 2023, 4:54 a.m. OK GNU C++17 (64) TESTS 9 15 0
188163569 Monir A Jan. 6, 2023, 4:38 a.m. OK GNU C++17 (64) TESTS 9 15 0
188160253 xiaoyiru A Jan. 6, 2023, 3:43 a.m. OK GNU C++17 (64) TESTS 9 15 0
188160227 Cxny A Jan. 6, 2023, 3:42 a.m. OK GNU C++17 (64) TESTS 9 15 0
188159712 TJ_Andeviking A Jan. 6, 2023, 3:33 a.m. OK GNU C++17 (64) TESTS 9 15 0
188156260 LXH-cat A Jan. 6, 2023, 2:27 a.m. OK GNU C++17 (64) TESTS 9 15 0
188161561 KhiNaoTotNghiep A Jan. 6, 2023, 4:05 a.m. OK GNU C++20 (64) TESTS 9 0 0
188161870 Vatsal_Vadher A Jan. 6, 2023, 4:10 a.m. OK GNU C++20 (64) TESTS 9 0 0
188161980 userithm A Jan. 6, 2023, 4:12 a.m. OK GNU C++20 (64) TESTS 9 0 0
188162905 Rinors A Jan. 6, 2023, 4:27 a.m. OK GNU C++20 (64) TESTS 9 0 0
188165365 peikez A Jan. 6, 2023, 5:02 a.m. OK GNU C++20 (64) TESTS 9 0 0
188166020 rakshith21mohan A Jan. 6, 2023, 5:11 a.m. OK GNU C++20 (64) TESTS 9 0 0
188168610 sakuracopic A Jan. 6, 2023, 5:42 a.m. OK GNU C++20 (64) TESTS 9 0 0
188168807 Lhohelhohehmm A Jan. 6, 2023, 5:44 a.m. OK GNU C++20 (64) TESTS 9 0 0
188169461 Anmol626 A Jan. 6, 2023, 5:51 a.m. OK GNU C++20 (64) TESTS 9 0 0
188170052 zwu2021016689 A Jan. 6, 2023, 5:58 a.m. OK GNU C++20 (64) TESTS 9 0 0
188145722 katomasao A Jan. 5, 2023, 9:06 p.m. OK Haskell TESTS 8 46 0
188162617 paras3019 A Jan. 6, 2023, 4:23 a.m. OK Java 11 TESTS 9 171 0
188162597 crazycoder143 A Jan. 6, 2023, 4:22 a.m. OK Java 11 TESTS 9 171 0
188128982 pushkar.lonkar21 A Jan. 5, 2023, 5:47 p.m. OK Java 11 TESTS 8 171 0
188132990 AkhilRaj A Jan. 5, 2023, 6:13 p.m. OK Java 11 TESTS 8 186 0
188132345 sRveSH A Jan. 5, 2023, 6:08 p.m. OK Java 11 TESTS 8 186 24371200
188126343 kartik__sethi A Jan. 5, 2023, 5:34 p.m. OK Java 11 TESTS 8 187 0
188140004 ilasiawo A Jan. 5, 2023, 7:29 p.m. OK Java 11 TESTS 8 233 0
188143415 mustankap A Jan. 5, 2023, 8:21 p.m. OK Java 11 TESTS 8 234 0
188132841 prachigupta A Jan. 5, 2023, 6:12 p.m. OK Java 11 TESTS 8 264 0
188164084 soxehli A Jan. 6, 2023, 4:46 a.m. OK Java 11 TESTS 9 280 0
188127203 not_just_rr A Jan. 5, 2023, 5:37 p.m. OK Java 17 TESTS 8 155 102400
188130483 Srisaivamshi A Jan. 5, 2023, 5:56 p.m. OK Java 17 TESTS 8 171 307200
188130826 ayushdragneel27 A Jan. 5, 2023, 5:58 p.m. OK Java 17 TESTS 8 186 512000
188148693 StacGnihsihp A Jan. 5, 2023, 10:26 p.m. OK Java 17 TESTS 8 202 204800
188135902 merlin_ A Jan. 5, 2023, 6:38 p.m. OK Java 17 TESTS 8 202 921600
188156831 anhdtph23299 A Jan. 6, 2023, 2:38 a.m. OK Java 17 TESTS 9 218 0
188163925 jameszhangrg A Jan. 6, 2023, 4:44 a.m. OK Java 17 TESTS 9 233 819200
188156048 Jatinydv17 A Jan. 6, 2023, 2:23 a.m. OK Java 17 TESTS 9 249 614400
188117218 Shivani_Singh28 A Jan. 5, 2023, 4:25 p.m. OK Java 17 TESTS 8 264 716800
188116969 suchitakhare25 A Jan. 5, 2023, 4:24 p.m. OK Java 17 TESTS 8 265 0
188164003 lpychemistry A Jan. 6, 2023, 4:45 a.m. OK Java 8 TESTS 9 93 0
188163453 Pranay_ A Jan. 6, 2023, 4:36 a.m. OK Java 8 TESTS 9 108 0
188158776 SilveryZz A Jan. 6, 2023, 3:15 a.m. OK Java 8 TESTS 9 108 0
188158635 SilveryZz A Jan. 6, 2023, 3:13 a.m. OK Java 8 TESTS 9 108 0
188128140 Koka A Jan. 5, 2023, 5:42 p.m. OK Java 8 TESTS 8 109 0
188127442 Juhaied_nabid A Jan. 5, 2023, 5:38 p.m. OK Java 8 TESTS 8 155 0
188126109 toufique_husein A Jan. 5, 2023, 5:32 p.m. OK Java 8 TESTS 8 155 0
188165844 The_Bigbull A Jan. 6, 2023, 5:09 a.m. OK Java 8 TESTS 9 171 0
188155264 ArcadioN A Jan. 6, 2023, 2:04 a.m. OK Java 8 TESTS 9 171 0
188159242 amit_roy A Jan. 6, 2023, 3:23 a.m. OK Java 8 TESTS 9 202 0
188128720 Krantzy A Jan. 5, 2023, 5:45 p.m. OK Kotlin 1.7 TESTS 8 390 1228800
188139317 mostafahany1212 A Jan. 5, 2023, 7:20 p.m. OK MS C++ 2017 TESTS 8 46 0
188126993 Ray_2448 A Jan. 5, 2023, 5:36 p.m. OK MS C++ 2017 TESTS 8 46 0
188117936 Devang25 A Jan. 5, 2023, 4:27 p.m. OK MS C++ 2017 TESTS 8 46 0
188167469 pursuita A Jan. 6, 2023, 5:29 a.m. OK MS C++ 2017 TESTS 9 62 0
188168157 guvanch006 A Jan. 6, 2023, 5:37 a.m. OK PascalABC.NET TESTS 9 436 0
188126237 rsFalse A Jan. 5, 2023, 5:33 p.m. OK Perl TESTS 8 15 819200
188141878 Khatarnak_Khandu A Jan. 5, 2023, 7:56 p.m. OK PyPy 3 TESTS 8 124 3686400
188131920 ShujanS A Jan. 5, 2023, 6:05 p.m. OK PyPy 3 TESTS 8 187 5529600
188126206 torqueaj A Jan. 5, 2023, 5:33 p.m. OK PyPy 3 TESTS 8 248 5427200
188136468 Margo08 A Jan. 5, 2023, 6:44 p.m. OK PyPy 3 TESTS 8 249 4812800
188120171 darluk6 A Jan. 5, 2023, 4:32 p.m. OK PyPy 3 TESTS 8 249 5017600
188165574 xgon6576 A Jan. 6, 2023, 5:05 a.m. OK PyPy 3 TESTS 9 264 4608000
188157284 mathsworm A Jan. 6, 2023, 2:47 a.m. OK PyPy 3 TESTS 9 264 4608000
188146508 DedMartyn A Jan. 5, 2023, 9:24 p.m. OK PyPy 3 TESTS 8 265 5017600
188150967 Betanine A Jan. 5, 2023, 11:49 p.m. OK PyPy 3-64 TESTS 8 62 2355200
188130641 denilb A Jan. 5, 2023, 5:57 p.m. OK PyPy 3-64 TESTS 8 77 4300800
188135550 FrozenKandy A Jan. 5, 2023, 6:35 p.m. OK PyPy 3-64 TESTS 8 77 5017600
188128572 mrdhnv A Jan. 5, 2023, 5:44 p.m. OK PyPy 3-64 TESTS 8 77 5120000
188153544 RobinFromTheHood A Jan. 6, 2023, 1:18 a.m. OK PyPy 3-64 TESTS 9 77 5222400
188137055 SophieHatter A Jan. 5, 2023, 6:51 p.m. OK PyPy 3-64 TESTS 8 77 5222400
188135913 gardengnome A Jan. 5, 2023, 6:38 p.m. OK PyPy 3-64 TESTS 8 77 5222400
188164790 Youarenotgood A Jan. 6, 2023, 4:55 a.m. OK PyPy 3-64 TESTS 9 77 5324800
188148695 ste7an A Jan. 5, 2023, 10:26 p.m. OK PyPy 3-64 TESTS 8 77 5324800
188132353 Trem0r A Jan. 5, 2023, 6:08 p.m. OK PyPy 3-64 TESTS 8 77 5324800
188169672 rumanbhuiyan A Jan. 6, 2023, 5:54 a.m. OK Python 3 TESTS 9 46 204800
188169542 vjudge5 A Jan. 6, 2023, 5:52 a.m. OK Python 3 TESTS 9 46 204800
188166681 yaojia123 A Jan. 6, 2023, 5:19 a.m. OK Python 3 TESTS 9 46 307200
188132401 Trem0r A Jan. 5, 2023, 6:08 p.m. OK Python 3 TESTS 8 62 307200
188159564 DLDM A Jan. 6, 2023, 3:30 a.m. OK Python 3 TESTS 9 62 512000
188164195 ATCG A Jan. 6, 2023, 4:47 a.m. OK Python 3 TESTS 9 77 0
188127994 Mohamed_Hamed A Jan. 5, 2023, 5:41 p.m. OK Python 3 TESTS 8 77 102400
188168791 bkifhr6 A Jan. 6, 2023, 5:44 a.m. OK Python 3 TESTS 9 93 0
188168562 bkifhr8 A Jan. 6, 2023, 5:41 a.m. OK Python 3 TESTS 9 93 0
188164293 bkifhr8 A Jan. 6, 2023, 4:48 a.m. OK Python 3 TESTS 9 93 0
188167967 pr0grammer A Jan. 6, 2023, 5:34 a.m. OK Rust 2021 TESTS 9 93 0
188165050 rumanbhuiyan A Jan. 6, 2023, 4:59 a.m. OK Rust 2021 TESTS 9 93 0
188164938 vjudge1 A Jan. 6, 2023, 4:57 a.m. OK Rust 2021 TESTS 9 93 0
188139721 variance A Jan. 5, 2023, 7:25 p.m. OK Rust 2021 TESTS 8 93 0
188167133 bkifhr8 A Jan. 6, 2023, 5:25 a.m. OK Rust 2021 TESTS 9 108 0
188167001 vjudge5 A Jan. 6, 2023, 5:23 a.m. OK Rust 2021 TESTS 9 109 0

remove filters

Back to search problems