Codeforces Round 945 (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
1973 Codeforces Round 945 (Div. 2) FINISHED False 7200 21223463 May 17, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 25382 ) A Chess For Three PROGRAMMING brute force dp implementation math 900

B"Three friends gathered to play a few games of chess together. In every game, two of them play against each other. The winner gets 2 points while the loser gets 0 , and in case of a draw, both players get 1 point each. Note that the same pair of players could have played any non-negative number of times (possibly zero). It is also possible that no games were played at all. You've been told that their scores after all the games were played were p_1 , p_2 and p_3 . Additionally, it is guaranteed that p_1 <= q p_2 <= q p_3 holds. Find the maximum number of draws that could have happened and print it. If there isn't any way to obtain p_1 , p_2 and p_3 as a result of a non-negative number of games between the three players, print -1 instead. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 500 ). The description of the test cases follows. The first line of each test case contains three integers p_1 , p_2 and p_3 ( 0 <= q p_1 <= q p_2 <= q p_3 <= q 30 ) -- the scores of the three players, sorted non-decreasingly. For each testcase, print one number -- the maximum possible number of draws that could've happened, or -1 if the scores aren't consistent with any valid set of games and results. In the first example, no games were played at all, so no draws could occur either. For the second example, exactly one game occurred between the second and the third player and it ended in draw, so the answer is 1 . It's easy to see that there's no set of games achieving the scores in third example, so the answer for it is -1 . "...

Tutorials

Editorial for Codeforces Round #945 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
261742058 Magg724 A May 20, 2024, 8:04 a.m. OK C# 10 TESTS 4 62 0 900
262266866 mar1g A May 23, 2024, 1:42 p.m. OK C# 10 TESTS 4 77 0 900
262211290 limyu A May 23, 2024, 3:08 a.m. OK C# 10 TESTS 4 77 102400 900
262194935 KevinTorres01 A May 22, 2024, 8:57 p.m. OK C# 10 TESTS 4 77 102400 900
263143849 Aatrowen A May 29, 2024, 12:56 p.m. OK C# 10 TESTS 4 78 102400 900
263154136 Lismar A May 29, 2024, 2:14 p.m. OK C# 10 TESTS 4 93 102400 900
261926606 subinayp108 A May 20, 2024, 6:56 p.m. OK C++14 (GCC 6-32) TESTS 4 30 0 900
262286883 chicken_65_ A May 23, 2024, 4:30 p.m. OK C++14 (GCC 6-32) TESTS 4 30 0 900
262237572 caicaicai1 A May 23, 2024, 10 a.m. OK C++14 (GCC 6-32) TESTS 4 30 0 900
261697215 Zefdf2 A May 19, 2024, 7:37 p.m. OK C++14 (GCC 6-32) TESTS 4 30 1024000 900
262511017 abhidhn_05 A May 25, 2024, 12:49 p.m. OK C++14 (GCC 6-32) TESTS 4 31 0 900
263448741 _Yash_bharadwaj_ A May 31, 2024, 10:10 a.m. OK C++14 (GCC 6-32) TESTS 4 31 0 900
262964407 fucker188 A May 28, 2024, 6 a.m. OK C++14 (GCC 6-32) TESTS 4 31 0 900
262849796 one_punch_Moon A May 27, 2024, 8:22 a.m. OK C++14 (GCC 6-32) TESTS 4 31 0 900
262672962 bkifhr9 A May 26, 2024, 8:21 a.m. OK C++14 (GCC 6-32) TESTS 4 31 0 900
262515994 _mactep A May 25, 2024, 1:43 p.m. OK C++14 (GCC 6-32) TESTS 4 31 0 900
263162707 Kaz0806 A May 29, 2024, 3:29 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0 900
263259149 sachinbarupal A May 30, 2024, 1:55 p.m. OK C++17 (GCC 7-32) TESTS 4 30 0 900
263645600 HuTa A June 1, 2024, 2:55 p.m. OK C++17 (GCC 7-32) TESTS 4 30 0 900
263612133 xpresscode A June 1, 2024, 10:18 a.m. OK C++17 (GCC 7-32) TESTS 4 30 0 900
263164742 mr_chen116 A May 29, 2024, 3:49 p.m. OK C++17 (GCC 7-32) TESTS 4 30 0 900
263048838 arshad739811 A May 28, 2024, 5:49 p.m. OK C++17 (GCC 7-32) TESTS 4 30 0 900
263018308 thecyberman A May 28, 2024, 1:34 p.m. OK C++17 (GCC 7-32) TESTS 4 30 0 900
262952570 kartikey1511 A May 28, 2024, 3:52 a.m. OK C++17 (GCC 7-32) TESTS 4 30 0 900
262869267 Ismail_Upal A May 27, 2024, 11:10 a.m. OK C++17 (GCC 7-32) TESTS 4 30 0 900
262703412 8.6YY1.9 A May 26, 2024, 12:29 p.m. OK C++17 (GCC 7-32) TESTS 4 30 0 900
262315271 springbreak A May 23, 2024, 10:02 p.m. OK C++20 (GCC 13-64) TESTS 4 30 0 900
263698817 blackdark A June 2, 2024, 4:34 a.m. OK C++20 (GCC 13-64) TESTS 4 30 0 900
263666086 rliu4936 A June 1, 2024, 5:51 p.m. OK C++20 (GCC 13-64) TESTS 4 30 0 900
263476139 hty_735 A May 31, 2024, 11:13 a.m. OK C++20 (GCC 13-64) TESTS 4 30 0 900
263232701 De_Lesseps A May 30, 2024, 11:47 a.m. OK C++20 (GCC 13-64) TESTS 4 30 0 900
263173444 gtcodes A May 29, 2024, 5:48 p.m. OK C++20 (GCC 13-64) TESTS 4 30 0 900
263141206 ylylyly A May 29, 2024, 12:34 p.m. OK C++20 (GCC 13-64) TESTS 4 30 0 900
262447312 OBlingyundu A May 25, 2024, 1:46 a.m. OK C++20 (GCC 13-64) TESTS 4 30 0 900
262430252 chauhan_09 A May 24, 2024, 7:18 p.m. OK C++20 (GCC 13-64) TESTS 4 30 0 900
262360950 metamallav A May 24, 2024, 9:16 a.m. OK C++20 (GCC 13-64) TESTS 4 30 0 900
262171471 cpy A May 22, 2024, 4:44 p.m. OK D TESTS 4 374 0 900
263599672 armurox A June 1, 2024, 8:34 a.m. OK GNU C11 TESTS 4 30 0 900
263592139 Brajeshpai A June 1, 2024, 7:31 a.m. OK GNU C11 TESTS 4 30 0 900
262610896 Sho707 A May 25, 2024, 5:26 p.m. OK GNU C11 TESTS 4 31 0 900
262185130 nibsu05 A May 22, 2024, 6:49 p.m. OK GNU C11 TESTS 4 31 0 900
261759498 Akshay_devadiga A May 20, 2024, 9:51 a.m. OK GNU C11 TESTS 4 31 102400 900
263399532 boraerkilic A May 31, 2024, 2:19 a.m. OK GNU C11 TESTS 4 31 102400 900
262084121 light616 A May 22, 2024, 4:06 a.m. OK GNU C11 TESTS 4 31 204800 900
263168441 notgopi A May 29, 2024, 4:34 p.m. OK GNU C11 TESTS 4 46 0 900
263308988 Virat_Garg A May 30, 2024, 3:12 p.m. OK GNU C11 TESTS 4 46 0 900
263154638 xiaosang A May 29, 2024, 2:18 p.m. OK GNU C11 TESTS 4 46 0 900
262852021 nguyenquocthao00 A May 27, 2024, 8:41 a.m. OK Go TESTS 4 46 102400 900
261712177 AlanZzzzz A May 20, 2024, 1:23 a.m. OK Go TESTS 4 46 102400 900
262781916 DeadFox61 A May 26, 2024, 5:05 p.m. OK Go TESTS 4 92 102400 900
261704293 october_rain A May 19, 2024, 9:30 p.m. OK Haskell TESTS 4 62 0 900
262318119 MinglangChen A May 23, 2024, 11:22 p.m. OK Java 21 TESTS 4 171 512000 900
262708311 oneafter A May 26, 2024, 1:12 p.m. OK Java 21 TESTS 4 187 102400 900
263090264 Nick A May 29, 2024, 5:34 a.m. OK Java 21 TESTS 4 202 614400 900
262040299 lapsha A May 21, 2024, 3:19 p.m. OK Java 21 TESTS 4 217 512000 900
261978656 daminShiLongCheng A May 21, 2024, 7:59 a.m. OK Java 21 TESTS 4 217 716800 900
262003139 bhavya_boda A May 21, 2024, 11:04 a.m. OK Java 21 TESTS 4 218 307200 900
261722850 CONOR72 A May 20, 2024, 4:57 a.m. OK Java 21 TESTS 4 218 614400 900
262988214 Mayank_07312003_ A May 28, 2024, 9:27 a.m. OK Java 21 TESTS 4 218 819200 900
263134419 Winners_eye A May 29, 2024, 11:40 a.m. OK Java 21 TESTS 4 233 921600 900
262197020 Victor_cpp A May 22, 2024, 9:38 p.m. OK Java 21 TESTS 4 233 1228800 900
261804873 Samez A May 20, 2024, 2:46 p.m. OK Java 8 TESTS 4 124 0 900
263636033 harsh_1806 A June 1, 2024, 1:32 p.m. OK Java 8 TESTS 4 124 0 900
262464126 azhar556 A May 25, 2024, 5:51 a.m. OK Java 8 TESTS 4 124 0 900
261730753 iam_ljk A May 20, 2024, 6:37 a.m. OK Java 8 TESTS 4 124 0 900
263635381 harsh_1806 A June 1, 2024, 1:27 p.m. OK Java 8 TESTS 4 140 0 900
262199161 RahulAhuja2901 A May 22, 2024, 10:26 p.m. OK Java 8 TESTS 4 140 0 900
261703349 nithin_bharathi A May 19, 2024, 9:11 p.m. OK Java 8 TESTS 4 155 0 900
263398174 cmpunk.rockzz A May 31, 2024, 1:51 a.m. OK Java 8 TESTS 4 155 0 900
262180422 prex A May 22, 2024, 6:02 p.m. OK Java 8 TESTS 4 155 0 900
263086331 Rohit_saini A May 29, 2024, 4:44 a.m. OK Java 8 TESTS 4 156 0 900
263067280 HaHarkka A May 28, 2024, 9:49 p.m. OK Kotlin 1.9 TESTS 4 155 102400 900
262354647 linxiaotian A May 24, 2024, 8:23 a.m. OK Kotlin 1.9 TESTS 4 217 921600 900
261969062 tej2210030075 A May 21, 2024, 6:09 a.m. OK PHP TESTS 4 77 0 900
261963537 klh_2210030077 A May 21, 2024, 4:54 a.m. OK PHP TESTS 4 77 0 900
262487993 klu-2100030642 A May 25, 2024, 9:24 a.m. OK PyPy 3 TESTS 4 92 102400 900
263083203 sankeerthanajadi A May 29, 2024, 3:54 a.m. OK PyPy 3 TESTS 4 92 1433600 900
261729601 7JJJXFV9_XC A May 20, 2024, 6:23 a.m. OK PyPy 3 TESTS 4 93 0 900
262595556 Dyarun A May 25, 2024, 4:29 p.m. OK PyPy 3 TESTS 4 93 0 900
261729757 pulkit_garg14 A May 20, 2024, 6:25 a.m. OK PyPy 3 TESTS 4 93 1740800 900
262596326 Dyarun A May 25, 2024, 4:31 p.m. OK PyPy 3 TESTS 4 108 0 900
262313283 rashadalsharpini A May 23, 2024, 9:17 p.m. OK PyPy 3 TESTS 4 108 1433600 900
262619436 shadonra Whosyourjay A May 25, 2024, 7:41 p.m. OK PyPy 3 TESTS 4 108 1433600 900
262622492 batchunikhil A May 25, 2024, 8:16 p.m. OK PyPy 3 TESTS 4 109 0 900
261702425 hena_bakos A May 19, 2024, 8:56 p.m. OK PyPy 3 TESTS 4 109 1331200 900
261941792 OmarMoBadr A May 20, 2024, 10:48 p.m. OK PyPy 3-64 TESTS 4 62 0 900
262054023 ad_left A May 21, 2024, 5:09 p.m. OK PyPy 3-64 TESTS 4 77 0 900
261769608 s2003 A May 20, 2024, 11:23 a.m. OK PyPy 3-64 TESTS 4 77 0 900
261949094 _twi_nami A May 21, 2024, 1:44 a.m. OK PyPy 3-64 TESTS 4 77 0 900
263429636 toam A May 31, 2024, 7:31 a.m. OK PyPy 3-64 TESTS 4 77 0 900
262445820 lpt2000 A May 25, 2024, 12:54 a.m. OK PyPy 3-64 TESTS 4 77 0 900
262212708 nam_dei_nai A May 23, 2024, 3:29 a.m. OK PyPy 3-64 TESTS 4 77 0 900
262211159 Yuvraj_2004 A May 23, 2024, 3:06 a.m. OK PyPy 3-64 TESTS 4 77 0 900
262480212 jimini23kjm A May 25, 2024, 8:21 a.m. OK PyPy 3-64 TESTS 4 77 614400 900
262221689 bergus A May 23, 2024, 7:28 a.m. OK PyPy 3-64 TESTS 4 77 1331200 900
262676606 MinakoKojima A May 26, 2024, 8:49 a.m. OK Python 3 TESTS 4 46 0 900
262893023 cc_yuan A May 27, 2024, 2:13 p.m. OK Python 3 TESTS 4 46 0 900
261783810 naveenprolific123 A May 20, 2024, 1:09 p.m. OK Python 3 TESTS 4 46 0 900
262412398 YoungDragon A May 24, 2024, 4:18 p.m. OK Python 3 TESTS 4 61 0 900
263524203 menna02 A May 31, 2024, 4:10 p.m. OK Python 3 TESTS 4 61 0 900
263499633 Emtinan_tarek A May 31, 2024, 12:46 p.m. OK Python 3 TESTS 4 61 0 900
263035152 alewaraafat A May 28, 2024, 3:50 p.m. OK Python 3 TESTS 4 61 0 900
262515505 anishg_07 A May 25, 2024, 1:39 p.m. OK Python 3 TESTS 4 61 0 900
262450928 quickbot-17 A May 25, 2024, 3 a.m. OK Python 3 TESTS 4 61 0 900
262414207 Aeon1092 A May 24, 2024, 4:34 p.m. OK Python 3 TESTS 4 61 0 900
262339069 n0b0dy01 A May 24, 2024, 5:50 a.m. OK Rust 2021 TESTS 4 30 0 900
261698893 jyom A May 19, 2024, 8:01 p.m. OK Rust 2021 TESTS 4 46 0 900
262970696 BetterThanNobita A May 28, 2024, 6:57 a.m. OK Rust 2021 TESTS 4 46 0 900
263158011 bqn A May 29, 2024, 2:46 p.m. OK Rust 2021 TESTS 4 46 0 900

remove filters

Back to search problems