Codeforces Round 1044 (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
2133 Codeforces Round 1044 (Div. 2) FINISHED False 7200 20359523 Aug. 24, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 30849 ) A Redstone? PROGRAMMING brute force implementation math

Steve stumbled upon a collection of (n) gears, where gear (i) has (a_i) teeth, and he wants to arrange them into a row. After he arranges them, Steve will spin the leftmost gear at a speed of (1) revolution per second. For each of the other gears, let (x) be the number of teeth it has, (y) be the number of teeth of the gear to its left, and (z) be the speed the gear to its left spins at. Then, its speed will be (\frac{y}{x} \cdot z) revolutions per second. Steve considers the contraption satisfactory if the rightmost gear spins at a speed of (1) revolution per second. Determine whether Steve can rearrange the gears into a satisfactory contraption. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 1000)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2 \le n \le 100)) — the number of gears Steve has. The second line of each test case contains (n) integers (a_1,a_2,\ldots,a_n) ((2 \le a_i \le 100)) — the number of teeth of each gear. For each test case, print " YES " if Steve can rearrange the gears in a satisfactory way, and " NO " otherwise. You can output the answer in any case (upper or lower). For example, the strings " yEs ", " yes ", " Yes ", and " YES " will be recognized as positive responses. In the first test case, the second gear will always spin at speed (\frac{5}{5} \cdot 1 = 1) revolution per second, so any arrangement is satisfactory. In the second test case, one possible arrangement is (6, 3, 9, 6). Then: The second gear spins at speed (\frac{6}{3} \cdot 1 = 2) revolutions per second. The third gear spins at speed (\frac{3}{9} \cdot 2 = \frac{2}{3}) revolutions per second. The fourth spins at speed (\frac{9}{6} \cdot \frac{2}{3} = 1) revolution per second. In the third test case, neither of the possible arrangements (2, 3) and $$$[3,

Tutorials

Codeforces Round 1044 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
335409764 IrishJessePinkman A Aug. 24, 2025, 6:34 p.m. OK C# 13 TESTS 3 93 3788800
335403871 Arm07 A Aug. 24, 2025, 5:50 p.m. OK C++17 (GCC 7-32) TESTS 3 30 0
335445268 Om_007 A Aug. 25, 2025, 5:04 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
335442491 lavin A Aug. 25, 2025, 4:22 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
335442109 ash_kumar A Aug. 25, 2025, 4:15 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
335421178 VRMcryptor A Aug. 24, 2025, 8:52 p.m. OK C++17 (GCC 7-32) TESTS 3 31 0
335417913 Anonymo A Aug. 24, 2025, 8:04 p.m. OK C++17 (GCC 7-32) TESTS 3 31 0
335404037 Sinerat A Aug. 24, 2025, 5:52 p.m. OK C++17 (GCC 7-32) TESTS 3 31 0
335448871 samiranchakraborty2006 A Aug. 25, 2025, 5:51 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
335448660 Vache.Kocharyan2012 A Aug. 25, 2025, 5:49 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
335447158 is-this-ntt A Aug. 25, 2025, 5:30 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
335428086 Danielcdo A Aug. 25, 2025, 12:09 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
335431745 wusimin A Aug. 25, 2025, 1:45 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
335445643 majjiteja000 A Aug. 25, 2025, 5:09 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
335445520 TheAria A Aug. 25, 2025, 5:08 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
335431696 Krritin A Aug. 25, 2025, 1:44 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
335429546 Jaylen A Aug. 25, 2025, 12:55 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
335429004 H_Z_J A Aug. 25, 2025, 12:37 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
335424205 lazylooper A Aug. 24, 2025, 10 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
335416620 Ismael101038 A Aug. 24, 2025, 7:47 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
335393194 youmeus A Aug. 24, 2025, 4:25 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
335391010 Rahi_PUC A Aug. 24, 2025, 4:20 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
335432478 Prayag_Kalriya_ A Aug. 25, 2025, 2 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
335447960 thirteem A Aug. 25, 2025, 5:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 102400
335446737 Whitecarrot A Aug. 25, 2025, 5:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
335440970 mvr_ A Aug. 25, 2025, 3:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
335440125 Codingsfan A Aug. 25, 2025, 3:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
335434064 mwh04 A Aug. 25, 2025, 2:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
335431349 Harish_gehlot A Aug. 25, 2025, 1:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
335429249 Bahy. A Aug. 25, 2025, 12:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
335428811 EduardoBrito A Aug. 25, 2025, 12:31 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
335430619 LiJianFu A Aug. 25, 2025, 1:21 a.m. OK GNU C11 TESTS 3 46 0
335417845 Lazy074 A Aug. 24, 2025, 8:03 p.m. OK GNU C11 TESTS 3 46 102400
335389235 VenomCodez A Aug. 24, 2025, 4:16 p.m. OK GNU C11 TESTS 3 46 102400
335410600 Fahim62 A Aug. 24, 2025, 6:41 p.m. OK GNU C11 TESTS 3 61 0
335416314 roomroofroot A Aug. 24, 2025, 7:43 p.m. OK GNU C11 TESTS 3 61 102400
335409987 Alpha_Zeros A Aug. 24, 2025, 6:36 p.m. OK GNU C11 TESTS 3 77 0
335391008 bkdn25.195 A Aug. 24, 2025, 4:20 p.m. OK GNU C11 TESTS 3 78 0
335446266 not_perma A Aug. 25, 2025, 5:18 a.m. OK GNU C11 TESTS 3 92 307200
335446245 mzzz77 A Aug. 25, 2025, 5:17 a.m. OK Go TESTS 3 46 3174400
335428925 uffhottie A Aug. 25, 2025, 12:35 a.m. OK Go TESTS 3 46 4198400
335409761 ziaulhasanhamim A Aug. 24, 2025, 6:34 p.m. OK Go TESTS 3 62 3174400
335431007 LambdaIsAllUNeed A Aug. 25, 2025, 1:30 a.m. OK Haskell TESTS 3 218 0
335419720 pawansrinivas10 A Aug. 24, 2025, 8:29 p.m. OK Java 21 TESTS 3 186 0
335442730 bomakhamchha A Aug. 25, 2025, 4:26 a.m. OK Java 21 TESTS 3 186 921600
335390532 Bit-Warrior A Aug. 24, 2025, 4:19 p.m. OK Java 21 TESTS 3 203 0
335431884 sagbis A Aug. 25, 2025, 1:48 a.m. OK Java 21 TESTS 3 217 0
335439459 NpHardcore_05 A Aug. 25, 2025, 3:30 a.m. OK Java 21 TESTS 3 218 1126400
335410740 amazion23 A Aug. 24, 2025, 6:43 p.m. OK Java 21 TESTS 3 233 0
335418877 hategreedy A Aug. 24, 2025, 8:17 p.m. OK Java 21 TESTS 3 233 512000
335391943 sangeet_04 A Aug. 24, 2025, 4:22 p.m. OK Java 21 TESTS 3 233 512000
335416946 singhdevansh024 A Aug. 24, 2025, 7:51 p.m. OK Java 21 TESTS 3 233 716800
335440635 bhuv2123 A Aug. 25, 2025, 3:50 a.m. OK Java 21 TESTS 3 233 921600
335392924 JLSS-1 A Aug. 24, 2025, 4:24 p.m. OK Java 8 TESTS 3 139 0
335409425 lusifer97 A Aug. 24, 2025, 6:32 p.m. OK Java 8 TESTS 3 156 0
335443524 adhikaridebarghya2004 A Aug. 25, 2025, 4:38 a.m. OK Java 8 TESTS 3 202 0
335392311 JatinBhardwaj4244 A Aug. 24, 2025, 4:23 p.m. OK Java 8 TESTS 3 202 0
335445053 NikhilKumarSingh4002 A Aug. 25, 2025, 5:01 a.m. OK Java 8 TESTS 3 217 0
335444791 tec_demon A Aug. 25, 2025, 4:57 a.m. OK Java 8 TESTS 3 218 0
335390817 tryphe A Aug. 24, 2025, 4:19 p.m. OK Java 8 TESTS 3 233 0
335416696 thishandleiscurrentl A Aug. 24, 2025, 7:48 p.m. OK Java 8 TESTS 3 234 0
335414155 vinayaksuryavanshi762 A Aug. 24, 2025, 7:17 p.m. OK Java 8 TESTS 3 249 0
335402819 Karthikj72 A Aug. 24, 2025, 5:43 p.m. OK Java 8 TESTS 3 249 0
335410396 Mr.Yassin A Aug. 24, 2025, 6:40 p.m. OK Node.js TESTS 3 93 11571200
335441837 prselvak A Aug. 25, 2025, 4:11 a.m. OK PyPy 3 TESTS 3 155 3788800
335441863 Prathmesh_H A Aug. 25, 2025, 4:11 a.m. OK PyPy 3 TESTS 3 155 4505600
335425636 pink____panther A Aug. 24, 2025, 10:41 p.m. OK PyPy 3 TESTS 3 171 5120000
335412789 gursimarsinghmiglani A Aug. 24, 2025, 7:03 p.m. OK PyPy 3 TESTS 3 186 4915200
335422341 Rudra_1232 A Aug. 24, 2025, 9:16 p.m. OK PyPy 3 TESTS 3 187 5734400
335437301 klu2300080337 A Aug. 25, 2025, 3:05 a.m. OK PyPy 3 TESTS 3 202 5120000
335392550 kunalthapliyal07 A Aug. 24, 2025, 4:24 p.m. OK PyPy 3 TESTS 3 202 5734400
335405822 gardengnome A Aug. 24, 2025, 6:03 p.m. OK PyPy 3-64 TESTS 3 77 1843200
335413940 yashjain2005 A Aug. 24, 2025, 7:14 p.m. OK PyPy 3-64 TESTS 3 78 1740800
335403721 Anand_vash_03 A Aug. 24, 2025, 5:50 p.m. OK PyPy 3-64 TESTS 3 108 2150400
335443552 merongcity A Aug. 25, 2025, 4:38 a.m. OK PyPy 3-64 TESTS 3 108 2457600
335405882 verstrapp_1 A Aug. 24, 2025, 6:03 p.m. OK PyPy 3-64 TESTS 3 108 2560000
335430570 Fumo97 A Aug. 25, 2025, 1:20 a.m. OK PyPy 3-64 TESTS 3 108 3788800
335390412 TejaNova A Aug. 24, 2025, 4:19 p.m. OK PyPy 3-64 TESTS 3 108 5734400
335445897 VSS240304946_Aaqib A Aug. 25, 2025, 5:13 a.m. OK PyPy 3-64 TESTS 3 109 2764800
335431885 Sheikah A Aug. 25, 2025, 1:48 a.m. OK PyPy 3-64 TESTS 3 109 2764800
335408475 milki_mh A Aug. 24, 2025, 6:24 p.m. OK PyPy 3-64 TESTS 3 109 2867200
335395154 Arif_Salam A Aug. 24, 2025, 4:29 p.m. OK Python 3 TESTS 3 46 0
335424254 Lado9999 A Aug. 24, 2025, 10:01 p.m. OK Python 3 TESTS 3 46 102400
335391859 kbhatt03 A Aug. 24, 2025, 4:22 p.m. OK Python 3 TESTS 3 61 0
335449547 Afraz_a5 A Aug. 25, 2025, 5:58 a.m. OK Python 3 TESTS 3 62 0
335445808 Naveed-Ahmed A Aug. 25, 2025, 5:12 a.m. OK Python 3 TESTS 3 62 0
335445625 gokulnotre5 A Aug. 25, 2025, 5:09 a.m. OK Python 3 TESTS 3 62 0
335392873 punugotinithya A Aug. 24, 2025, 4:24 p.m. OK Python 3 TESTS 3 62 0
335432043 iluvu3000 A Aug. 25, 2025, 1:52 a.m. OK Python 3 TESTS 3 62 102400
335408025 Avgeek A Aug. 24, 2025, 6:20 p.m. OK Python 3 TESTS 3 62 102400
335448018 Rasel_hosen A Aug. 25, 2025, 5:41 a.m. OK Python 3 TESTS 3 77 0
335404541 taneshqGupta A Aug. 24, 2025, 5:55 p.m. OK Rust 2021 TESTS 3 46 0
335418696 notarmen A Aug. 24, 2025, 8:14 p.m. OK Rust 2021 TESTS 3 62 0
335404302 taneshqGupta A Aug. 24, 2025, 5:53 p.m. OK Rust 2021 TESTS 3 77 102400
335424364 buddha328 A Aug. 24, 2025, 10:04 p.m. OK Rust 2024 TESTS 3 46 0

remove filters

Back to search problems