Codeforces Round 1114 (Div. 3)

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
2254 Codeforces Round 1114 (Div. 3) FINISHED False 8100 2301884 Aug. 4, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 33578 ) A Riptide PROGRAMMING implementation sortings

Alice, Bob, and Charlie are playing a game with tokens. They start with (a), (b), and (c) tokens, respectively. The game is played in rounds. Before the beginning of each round, they check the number of tokens everyone has: If any two players have the exact same number of tokens, the game immediately ends. Otherwise, the round begins, all three players have a strictly different number of tokens. The player with the strictly most tokens gives exactly (1) token to the player with the strictly fewest tokens. Given the starting tokens (a), (b), and (c), determine exactly how many rounds the game will last before it ends. The first line contains a single integer (t) ((1 \le t \le 10^3)) — the number of test cases. Each test case consists of a single line containing three integers (a), (b), and (c) ((1 \le a, b, c \le 10)). For each test case, output a single integer — the number of rounds the game will last before it ends. In the first test case: No two players have the same number of tokens. Charlie has the most tokens ((3) tokens), and Alice has the fewest tokens ((1) token). Therefore, Charlie gives Alice a token. Now, Alice has (2) tokens, Bob has (2) tokens, and Charlie has (2) tokens. Since there are two players (or more) with the same number of tokens, the game ends. The game ended after (1) round, so the answer is (1). In the second test case, the game is played as follows: Bob gives Charlie a token, now Alice has (4) tokens, Bob has (5) tokens, and Charlie has (2) tokens. Bob gives Charlie a token, now Alice has (4) tokens, Bob has (4) tokens, and Charlie has (3) tokens. Since two players have the same number of tokens, the game ends. The game lasted (2) rounds. In the third test case, two players already have the same number of tokens. So the answer is (0) since no rounds were played.

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
385836327 Taj025 A Aug. 6, 2026, 5:27 a.m. OK C# 13 TESTS 2 31 0
385828407 zhaicy A Aug. 6, 2026, 3:21 a.m. OK C++17 (GCC 7-32) TESTS 2 0 0
385827266 Nobzee A Aug. 6, 2026, 3:08 a.m. OK C++17 (GCC 7-32) TESTS 2 0 0
385823064 zhangshijie548 A Aug. 6, 2026, 2:22 a.m. OK C++17 (GCC 7-32) TESTS 2 0 0
385811774 nealzane A Aug. 5, 2026, 10:01 p.m. OK C++17 (GCC 7-32) TESTS 2 0 0
385810515 Z3TARA_ A Aug. 5, 2026, 9:27 p.m. OK C++17 (GCC 7-32) TESTS 2 0 0
385807526 Demon_Is_Bad A Aug. 5, 2026, 8:25 p.m. OK C++17 (GCC 7-32) TESTS 2 0 0
385806236 BugSlayer_123 A Aug. 5, 2026, 8:05 p.m. OK C++17 (GCC 7-32) TESTS 2 0 0
385805480 Vats.noir A Aug. 5, 2026, 7:53 p.m. OK C++17 (GCC 7-32) TESTS 2 0 0
385801891 motra_1904 A Aug. 5, 2026, 7:07 p.m. OK C++17 (GCC 7-32) TESTS 2 0 0
385803448 Vivan_hy A Aug. 5, 2026, 7:25 p.m. OK C++17 (GCC 7-32) TESTS 2 0 0
385699117 kirafan A Aug. 4, 2026, 11:54 p.m. OK C++20 (GCC 13-64) TESTS 2 0 0
385794258 srj_5035 A Aug. 5, 2026, 6:05 p.m. OK C++20 (GCC 13-64) TESTS 2 0 0
385719965 VicG A Aug. 5, 2026, 5:45 a.m. OK C++20 (GCC 13-64) TESTS 2 0 0
385714199 TamanK A Aug. 5, 2026, 4:25 a.m. OK C++20 (GCC 13-64) TESTS 2 0 0
385702679 codeturtle33 A Aug. 5, 2026, 1:14 a.m. OK C++20 (GCC 13-64) TESTS 2 0 0
385699513 vaibhav_319 A Aug. 5, 2026, 12:04 a.m. OK C++20 (GCC 13-64) TESTS 2 0 0
385695315 SuReBuDdY A Aug. 4, 2026, 10:24 p.m. OK C++20 (GCC 13-64) TESTS 2 0 0
385715153 tarunnnnn A Aug. 5, 2026, 4:40 a.m. OK C++20 (GCC 13-64) TESTS 2 0 102400
385829209 hari_shankar_karthik A Aug. 6, 2026, 3:32 a.m. OK C++20 (GCC 13-64) TESTS 2 0 102400
385697205 albgondiga A Aug. 4, 2026, 11:08 p.m. OK C++20 (GCC 13-64) TESTS 2 0 102400
385800764 isaz A Aug. 5, 2026, 6:55 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 0 0
385837780 fishingpoleroid A Aug. 6, 2026, 5:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 2 0 0
385825616 philhill A Aug. 6, 2026, 2:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 2 0 0
385815130 Tarek_Soliman7 A Aug. 5, 2026, 11:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 0 0
385812325 maybe_mee A Aug. 5, 2026, 10:17 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 0 0
385809373 SoherHatem A Aug. 5, 2026, 9:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 0 0
385809206 miinmaher A Aug. 5, 2026, 8:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 0 0
385804427 kushagra5214 A Aug. 5, 2026, 7:38 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 0 0
385803894 bhardwajshekhar61 A Aug. 5, 2026, 7:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 0 0
385803580 _F4d3l A Aug. 5, 2026, 7:27 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 0 0
385710162 alif_islam A Aug. 5, 2026, 3:24 a.m. OK C# 8 TESTS 2 62 204800
385838507 dinesh_rahul8 A Aug. 6, 2026, 5:59 a.m. OK GNU C11 TESTS 2 0 102400
385838042 soumya2506 A Aug. 6, 2026, 5:53 a.m. OK GNU C11 TESTS 2 0 102400
385833511 atindra_3301 A Aug. 6, 2026, 4:43 a.m. OK GNU C11 TESTS 2 0 102400
385797158 Praket_Thakur A Aug. 5, 2026, 6:24 p.m. OK GNU C11 TESTS 2 15 0
385711705 URBITA A Aug. 5, 2026, 3:47 a.m. OK GNU C11 TESTS 2 15 0
385700612 Blaurin A Aug. 5, 2026, 12:31 a.m. OK GNU C11 TESTS 2 15 0
385674429 logeshwarangovind2007 A Aug. 4, 2026, 4:49 p.m. OK GNU C11 TESTS 2 15 0
385671841 Jinxfr12 A Aug. 4, 2026, 4:46 p.m. OK GNU C11 TESTS 2 15 0
385671530 Durja.004 A Aug. 4, 2026, 4:45 p.m. OK GNU C11 TESTS 2 15 0
385674151 16242896______ A Aug. 4, 2026, 4:49 p.m. OK GNU C11 TESTS 2 31 0
385835732 _kratos_ A Aug. 6, 2026, 5:18 a.m. OK Go TESTS 2 15 102400
385821465 FurudeRika A Aug. 6, 2026, 2:05 a.m. OK Go TESTS 2 31 0
385831503 Shadow_Dragoon A Aug. 6, 2026, 4:09 a.m. OK Go TESTS 2 46 0
385826149 Paras6726 A Aug. 6, 2026, 2:57 a.m. OK Java 21 TESTS 2 93 0
385711839 dharshu28 A Aug. 5, 2026, 3:49 a.m. OK Java 21 TESTS 2 93 307200
385669468 chetana_s A Aug. 4, 2026, 4:41 p.m. OK Java 21 TESTS 2 109 0
385833783 Mega6776 A Aug. 6, 2026, 4:48 a.m. OK Java 21 TESTS 2 109 102400
385838191 rex1224 A Aug. 6, 2026, 5:55 a.m. OK Java 21 TESTS 2 125 0
385699247 sachinadhikari933 A Aug. 4, 2026, 11:58 p.m. OK Java 21 TESTS 2 125 921600
385811356 Outlastqr A Aug. 5, 2026, 9:50 p.m. OK Java 21 TESTS 2 140 0
385795667 Subham_TLE A Aug. 5, 2026, 6:15 p.m. OK Java 21 TESTS 2 140 0
385719980 Moddheswarsp A Aug. 5, 2026, 5:45 a.m. OK Java 21 TESTS 2 140 0
385713455 shrinidhi_16 A Aug. 5, 2026, 4:14 a.m. OK Java 21 TESTS 2 140 0
385807063 Mara0512 A Aug. 5, 2026, 8:18 p.m. OK Java 8 TESTS 2 62 0
385699597 Mouriya_001 A Aug. 5, 2026, 12:07 a.m. OK Java 8 TESTS 2 93 0
385694306 Harshit_Pundir A Aug. 4, 2026, 10:02 p.m. OK Java 8 TESTS 2 93 0
385839049 ashi.jain.1411 A Aug. 6, 2026, 6:06 a.m. OK Java 8 TESTS 2 109 0
385801462 Yaser2004 A Aug. 5, 2026, 7:02 p.m. OK Java 8 TESTS 2 109 0
385710885 CodeAddict_Abhi A Aug. 5, 2026, 3:35 a.m. OK Java 8 TESTS 2 109 0
385706630 kushalkasparaju A Aug. 5, 2026, 2:24 a.m. OK Java 8 TESTS 2 109 0
385838727 2023kuec2001 A Aug. 6, 2026, 6:02 a.m. OK Java 8 TESTS 2 125 0
385834839 Kaikondar A Aug. 6, 2026, 5:04 a.m. OK Java 8 TESTS 2 125 0
385800073 100abhishekagrawal A Aug. 5, 2026, 6:48 p.m. OK Java 8 TESTS 2 125 0
385829638 J_O_E_22 A Aug. 6, 2026, 3:39 a.m. OK Node.js TESTS 2 62 1024000
385674587 ilyas A Aug. 4, 2026, 4:49 p.m. OK PyPy 3 TESTS 2 46 1536000
385669026 Arvind215271 A Aug. 4, 2026, 4:41 p.m. OK PyPy 3 TESTS 2 78 2662400
385720775 kaido_sama_ A Aug. 5, 2026, 5:55 a.m. OK PyPy 3 TESTS 2 78 2969600
385700960 zouarimoezzz A Aug. 5, 2026, 12:40 a.m. OK PyPy 3 TESTS 2 93 2662400
385834630 good_6776 A Aug. 6, 2026, 5:01 a.m. OK PyPy 3 TESTS 2 93 2764800
385690388 Kolya A Aug. 4, 2026, 8:35 p.m. OK PyPy 3 TESTS 2 109 2457600
385831238 adriannliu A Aug. 6, 2026, 4:04 a.m. OK PyPy 3 TESTS 2 125 2764800
385800946 Georgy_Hryashev A Aug. 5, 2026, 6:57 p.m. OK PyPy 3 TESTS 2 125 2764800
385719208 ramank_2005 A Aug. 5, 2026, 5:35 a.m. OK PyPy 3 TESTS 2 125 2867200
385818945 Muhammadzaki_Juraev A Aug. 6, 2026, 1:36 a.m. OK PyPy 3-64 TESTS 2 46 1433600
385806828 IamNoobSpareMe A Aug. 5, 2026, 8:14 p.m. OK PyPy 3-64 TESTS 2 46 1433600
385799018 vaibhavsinghvps A Aug. 5, 2026, 6:38 p.m. OK PyPy 3-64 TESTS 2 46 1433600
385712348 Rudy_Indian A Aug. 5, 2026, 3:57 a.m. OK PyPy 3-64 TESTS 2 46 1433600
385705623 r0amer A Aug. 5, 2026, 2:04 a.m. OK PyPy 3-64 TESTS 2 46 1433600
385699761 grxchx A Aug. 5, 2026, 12:11 a.m. OK PyPy 3-64 TESTS 2 46 1433600
385699153 SharadenduDwiv A Aug. 4, 2026, 11:55 p.m. OK PyPy 3-64 TESTS 2 46 1433600
385695075 WaterG A Aug. 4, 2026, 10:19 p.m. OK PyPy 3-64 TESTS 2 46 1433600
385834961 22me01018 A Aug. 6, 2026, 5:06 a.m. OK PyPy 3-64 TESTS 2 46 1536000
385803614 MEDLRxdxd A Aug. 5, 2026, 7:27 p.m. OK PyPy 3-64 TESTS 2 46 1536000
385820918 AdrianKnox2000 A Aug. 6, 2026, 1:59 a.m. OK Python 3 TESTS 2 15 0
385715527 gooonn A Aug. 5, 2026, 4:46 a.m. OK Python 3 TESTS 2 15 0
385713781 lohi_06 A Aug. 5, 2026, 4:19 a.m. OK Python 3 TESTS 2 15 0
385671822 EmeraldBeast A Aug. 4, 2026, 4:46 p.m. OK Python 3 TESTS 2 15 716800
385832712 3lielkhodary A Aug. 6, 2026, 4:30 a.m. OK Python 3 TESTS 2 31 0
385829315 nausin.fatma A Aug. 6, 2026, 3:34 a.m. OK Python 3 TESTS 2 31 0
385824259 jakoblanda1 A Aug. 6, 2026, 2:35 a.m. OK Python 3 TESTS 2 31 0
385823197 Alpha678923 A Aug. 6, 2026, 2:23 a.m. OK Python 3 TESTS 2 31 0
385818712 ampere_xx A Aug. 6, 2026, 1:31 a.m. OK Python 3 TESTS 2 31 0
385805956 Hilogen A Aug. 5, 2026, 8:01 p.m. OK Python 3 TESTS 2 31 0
385699644 chmpro A Aug. 5, 2026, 12:08 a.m. OK Ruby 3 TESTS 2 156 512000
385670293 Vinith_77 A Aug. 4, 2026, 4:43 p.m. OK Ruby 3 TESTS 2 171 204800
385710557 Tantellam A Aug. 5, 2026, 3:30 a.m. OK Rust 2024 TESTS 2 15 0
385698207 ivantdev A Aug. 4, 2026, 11:33 p.m. OK Rust 2024 TESTS 2 15 0
385815599 kroyl A Aug. 6, 2026, 12:14 a.m. OK Rust 2024 TESTS 2 31 0
385699547 nilclass A Aug. 5, 2026, 12:06 a.m. OK Rust 2024 TESTS 2 31 0

remove filters

Back to search problems