Codeforces Round 1028 (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
2116 Codeforces Round 1028 (Div. 2) FINISHED False 7200 27703523 May 31, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 26855 ) A Gellyfish and Tricolor Pansy PROGRAMMING greedy

Gellyfish and Flower are playing a game called "Duel". Gellyfish has (a) HP, while Flower has (b) HP. Each of them has a knight. Gellyfish's knight has (c) HP, while Flower's knight has (d) HP. They will play a game in rounds until one of the players wins. For (k = 1, 2, \ldots) in this order, they will perform the following actions: If (k) is odd and Gellyfish's knight is alive: Gellyfish's knight can attack Flower and reduce (b) by (1). If (b \leq 0), Gellyfish wins . Or, Gellyfish's knight can attack Flower's knight and reduce (d) by (1). If (d \leq 0), Flower's knight dies. Gellyfish's knight can attack Flower and reduce (b) by (1). If (b \leq 0), Gellyfish wins . Or, Gellyfish's knight can attack Flower's knight and reduce (d) by (1). If (d \leq 0), Flower's knight dies. If (k) is even and Flower's knight is alive: Flower's knight can attack Gellyfish and reduce (a) by (1). If (a \leq 0), Flower wins . Or, Flower's knight can attack Gellyfish's knight and reduce (c) by (1). If (c \leq 0), Gellyfish's knight dies. Flower's knight can attack Gellyfish and reduce (a) by (1). If (a \leq 0), Flower wins . Or, Flower's knight can attack Gellyfish's knight and reduce (c) by (1). If (c \leq 0), Gellyfish's knight dies. As one of the smartest people in the world, you want to tell them who will win before the game. Assume both players play optimally. It can be proven that the game will never end in a draw. That is, one player has a strategy to end the game in a finite number of moves. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first and only line of each test case contains four integers (a), (b), (c), (d) ((1 \leq a, b, c, d \leq 10^9)) — the HP of Gellyfish, the HP of Flower, the HP of Gellyfis

Tutorials

Codeforces Round 1028 (Div.1, Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
322346043 og.kostya A June 1, 2025, 5:43 a.m. OK C# 10 TESTS 4 77 0
322323060 Maestro.SHA A May 31, 2025, 9:59 p.m. OK C# 10 TESTS 4 108 2867200
322346010 og.kostya A June 1, 2025, 5:43 a.m. OK C# 13 TESTS 4 77 0
322338562 asutosh1998 A June 1, 2025, 4:08 a.m. OK C# 13 TESTS 4 124 4198400
322338753 _Equinox A June 1, 2025, 4:10 a.m. OK C# 13 TESTS 4 202 8396800
322342261 monopoly21 A June 1, 2025, 4:58 a.m. OK C++17 (GCC 7-32) TESTS 4 31 0
322347928 vision111 A June 1, 2025, 6:02 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
322347538 MizukiHiroshi A June 1, 2025, 5:58 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
322347285 Ash_K.24 A June 1, 2025, 5:56 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
322347204 piyush_m18 A June 1, 2025, 5:55 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
322345741 0xAD A June 1, 2025, 5:39 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
322344495 Divyansh1128 A June 1, 2025, 5:26 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
322344291 Shenyurou A June 1, 2025, 5:23 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
322343486 udaysr17 A June 1, 2025, 5:13 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
322343209 24je0427 A June 1, 2025, 5:10 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
322316375 Kurohige_no_Piyush A May 31, 2025, 8:01 p.m. OK C++20 (GCC 13-64) TESTS 4 30 102400
322347843 Sayan_001 A June 1, 2025, 6:01 a.m. OK C++20 (GCC 13-64) TESTS 4 31 0
322343488 MinhajHasan A June 1, 2025, 5:14 a.m. OK C++20 (GCC 13-64) TESTS 4 31 0
322343059 anonymous_om_ A June 1, 2025, 5:08 a.m. OK C++20 (GCC 13-64) TESTS 4 31 0
322325815 KablammoMan A May 31, 2025, 11:25 p.m. OK C++20 (GCC 13-64) TESTS 4 31 0
322300154 Kushi A May 31, 2025, 5:46 p.m. OK C++20 (GCC 13-64) TESTS 4 31 0
322306765 Mahm2od A May 31, 2025, 6:25 p.m. OK C++20 (GCC 13-64) TESTS 4 31 16076800
322348195 xy3m A June 1, 2025, 6:04 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
322346392 ujjwalsi2 A June 1, 2025, 5:46 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
322346270 ByangJ A June 1, 2025, 5:45 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
322341987 Surya_1 A June 1, 2025, 4:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
322335259 CaptainFaizz A June 1, 2025, 3:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
322321844 abdullahelshebrawy A May 31, 2025, 9:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
322309005 hackerr22 A May 31, 2025, 6:42 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
322298507 DARKDEVILISM A May 31, 2025, 5:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
322303067 noushil004 A May 31, 2025, 6:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 9318400
322347614 Mohamed_Asad A June 1, 2025, 5:59 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 46 0
322347330 Ljj18 A June 1, 2025, 5:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 46 0
322347185 WickedManSaad A June 1, 2025, 5:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 46 0
322347121 cocoli A June 1, 2025, 5:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 46 0
322331799 MtanvirA A June 1, 2025, 2:26 a.m. OK GNU C11 TESTS 4 62 102400
322338816 AsifM A June 1, 2025, 4:11 a.m. OK GNU C11 TESTS 4 77 0
322342609 a_pandey A June 1, 2025, 5:02 a.m. OK GNU C11 TESTS 4 77 102400
322303563 Ashraf_HC A May 31, 2025, 6:04 p.m. OK GNU C11 TESTS 4 77 102400
322314212 PracToTop A May 31, 2025, 7:33 p.m. OK GNU C11 TESTS 4 93 102400
322309672 fadeevich A May 31, 2025, 6:48 p.m. OK GNU C11 TESTS 4 93 102400
322346086 dils2k A June 1, 2025, 5:43 a.m. OK Go TESTS 4 62 1024000
322339405 tekka_ity A June 1, 2025, 4:20 a.m. OK Java 21 TESTS 4 186 102400
322330189 reekdev A June 1, 2025, 1:55 a.m. OK Java 21 TESTS 4 233 307200
322306079 guptadhairya167 A May 31, 2025, 6:20 p.m. OK Java 21 TESTS 4 233 409600
322319292 M_Dawwas A May 31, 2025, 8:44 p.m. OK Java 21 TESTS 4 234 409600
322341192 ak_vishwakarma_1 A June 1, 2025, 4:44 a.m. OK Java 21 TESTS 4 234 512000
322341917 Gitansh_shekhar A June 1, 2025, 4:54 a.m. OK Java 21 TESTS 4 249 409600
322302125 BeQuiet A May 31, 2025, 5:56 p.m. OK Java 21 TESTS 4 265 0
322311702 sagarth764 A May 31, 2025, 7:05 p.m. OK Java 21 TESTS 4 265 1331200
322311598 Sagar_TH_45 A May 31, 2025, 7:04 p.m. OK Java 21 TESTS 4 265 1331200
322347406 yashvardhan3 A June 1, 2025, 5:57 a.m. OK Java 21 TESTS 4 280 716800
322317278 sam_131526 A May 31, 2025, 8:13 p.m. OK Java 8 TESTS 4 124 0
322294729 BrutHawk A May 31, 2025, 4:34 p.m. OK Java 8 TESTS 4 124 0
322317147 sourav2999 A May 31, 2025, 8:11 p.m. OK Java 8 TESTS 4 140 0
322348092 ashuramajestic A June 1, 2025, 6:03 a.m. OK Java 8 TESTS 4 155 0
322345970 jagadeeshmamilla129 A June 1, 2025, 5:42 a.m. OK Java 8 TESTS 4 233 0
322347436 wydwyd0101 A June 1, 2025, 5:57 a.m. OK Java 8 TESTS 4 234 0
322346357 srijanchakraborty A June 1, 2025, 5:46 a.m. OK Java 8 TESTS 4 234 0
322345668 not_mohith A June 1, 2025, 5:39 a.m. OK Java 8 TESTS 4 234 0
322331565 sadgirpooja20 A June 1, 2025, 2:23 a.m. OK Java 8 TESTS 4 249 0
322312638 anirudh_08 A May 31, 2025, 7:15 p.m. OK Java 8 TESTS 4 249 0
322301300 npnainav A May 31, 2025, 5:52 p.m. OK PHP TESTS 4 77 204800
322300287 AlienX_11 A May 31, 2025, 5:47 p.m. OK PHP TESTS 4 77 204800
322330716 Saicoder89 A June 1, 2025, 2:07 a.m. OK PyPy 3 TESTS 4 265 6348800
322290347 Dharanidharram A May 31, 2025, 4:29 p.m. OK PyPy 3 TESTS 4 265 8704000
322316174 Arvind215271 A May 31, 2025, 7:58 p.m. OK PyPy 3 TESTS 4 281 6553600
322332056 Charles_swj A June 1, 2025, 2:31 a.m. OK PyPy 3 TESTS 4 296 9420800
322304889 _Tremor_ A May 31, 2025, 6:12 p.m. OK PyPy 3 TESTS 4 312 9625600
322335761 rameshiitd A June 1, 2025, 3:28 a.m. OK PyPy 3 TESTS 4 312 9728000
322305968 transcend_lexa A May 31, 2025, 6:19 p.m. OK PyPy 3 TESTS 4 343 10035200
322337357 gardengnome A June 1, 2025, 3:51 a.m. OK PyPy 3-64 TESTS 4 124 3584000
322304678 Pie854 A May 31, 2025, 6:11 p.m. OK PyPy 3-64 TESTS 4 124 5427200
322301144 welshman_11 A May 31, 2025, 5:51 p.m. OK PyPy 3-64 TESTS 4 125 4198400
322329480 tomowama A June 1, 2025, 1:36 a.m. OK PyPy 3-64 TESTS 4 125 6963200
322316063 sktb A May 31, 2025, 7:57 p.m. OK PyPy 3-64 TESTS 4 139 6656000
322302689 titia A May 31, 2025, 5:59 p.m. OK PyPy 3-64 TESTS 4 139 6656000
322316112 mayman007 A May 31, 2025, 7:57 p.m. OK PyPy 3-64 TESTS 4 140 5120000
322332284 ruben.coorahua A June 1, 2025, 2:35 a.m. OK PyPy 3-64 TESTS 4 140 6144000
322313946 OpenTC A May 31, 2025, 7:30 p.m. OK PyPy 3-64 TESTS 4 155 5017600
322306188 uneasywatermelon A May 31, 2025, 6:21 p.m. OK PyPy 3-64 TESTS 4 155 8089600
322292761 brodyagaelf848 A May 31, 2025, 4:32 p.m. OK Python 3 TESTS 4 61 204800
322289695 dora73aquaman A May 31, 2025, 4:28 p.m. OK Python 3 TESTS 4 62 307200
322293724 hantosebyrator898 A May 31, 2025, 4:33 p.m. OK Python 3 TESTS 4 77 204800
322292099 cpuonajrjc A May 31, 2025, 4:31 p.m. OK Python 3 TESTS 4 77 204800
322291941 vlqsjjzrro A May 31, 2025, 4:31 p.m. OK Python 3 TESTS 4 77 204800
322291250 laafal A May 31, 2025, 4:30 p.m. OK Python 3 TESTS 4 77 204800
322289694 cncqagdvhg A May 31, 2025, 4:28 p.m. OK Python 3 TESTS 4 77 204800
322288475 bonnfaster686 A May 31, 2025, 4:26 p.m. OK Python 3 TESTS 4 77 204800
322292666 mailvile42bigbang A May 31, 2025, 4:32 p.m. OK Python 3 TESTS 4 77 307200
322291911 toybonniewhite A May 31, 2025, 4:31 p.m. OK Python 3 TESTS 4 77 307200
322343798 jaysuryaray1998 A June 1, 2025, 5:17 a.m. OK Rust 2021 TESTS 4 46 0
322331342 neulfox A June 1, 2025, 2:19 a.m. OK Rust 2021 TESTS 4 62 409600

remove filters

Back to search problems