Codeforces Round 1021 (Div. 1)

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
2097 Codeforces Round 1021 (Div. 1) FINISHED False 10800 30749123 April 26, 2025, 8:35 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1011 ) C Bermuda Triangle PROGRAMMING chinese remainder theorem constructive algorithms geometry math number theory

The Bermuda Triangle — a mysterious area in the Atlantic Ocean where, according to rumors, ships and airplanes disappear without a trace. Some blame magnetic anomalies, others — portals to other worlds, but the truth remains hidden in a fog of mysteries. A regular passenger flight 814 was traveling from Miami to Nassau on a clear sunny day. Nothing foreshadowed trouble until the plane entered a zone of strange flickering fog. Radio communication was interrupted, the instruments spun wildly, and flashes of unearthly light flickered outside the windows. For simplicity, we will assume that the Bermuda Triangle and the airplane are on a plane, and the vertices of the triangle have coordinates ((0, 0)), ((0, n)), and ((n, 0)). Initially, the airplane is located at the point ((x, y)) strictly inside the Bermuda Triangle and is moving with a velocity vector ((v_x, v_y)). All instruments have failed, so the crew cannot control the airplane. The airplane can escape from the triangle if it ever reaches exactly one of the vertices of the triangle. However, if at any moment (possibly non-integer) the airplane hits the boundary of the triangle (but not at a vertex), its velocity vector is immediately reflected relative to that side(^\dagger), and the airplane continues to move in the new direction. Determine whether the airplane can ever escape from the Bermuda Triangle (i.e., reach exactly one of its vertices). If this is possible, also calculate how many times before that moment the airplane will hit the boundary of the triangle (each touch of the boundary, even at the same point, counts; crossing a vertex does not count). (^\dagger) Reflection occurs according to the usual laws of physics. The angle of incidence equals the angle of reflection. 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 only line of each test case

Tutorials

142316

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
317336783 og.kostya C April 26, 2025, 12:56 p.m. OK C# 10 TESTS 10 93 204800
317335141 Teja-Smart C April 26, 2025, 12:44 p.m. OK C++17 (GCC 7-32) TESTS 10 62 0
317317199 reform C April 26, 2025, 10:51 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
317299563 pp_orange C April 26, 2025, 9:36 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
317400507 wanggk C April 27, 2025, 12:30 a.m. OK C++17 (GCC 7-32) TESTS 10 62 102400
317365130 HoangMC2009 C April 26, 2025, 5:14 p.m. OK C++17 (GCC 7-32) TESTS 10 62 102400
317302232 Egg_eating_master C April 26, 2025, 9:46 a.m. OK C++17 (GCC 7-32) TESTS 10 62 8089600
317402884 ywjylx C April 27, 2025, 1:37 a.m. OK C++17 (GCC 7-32) TESTS 10 77 0
317393683 max0000561 C April 26, 2025, 9:38 p.m. OK C++17 (GCC 7-32) TESTS 10 77 0
317355863 OdtreeKing C April 26, 2025, 3:37 p.m. OK C++17 (GCC 7-32) TESTS 10 77 0
317334138 sillylittleidiot77 C April 26, 2025, 12:36 p.m. OK C++17 (GCC 7-32) TESTS 10 77 0
317344191 ali2005_syr C April 26, 2025, 1:53 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
317334555 StayAlone C April 26, 2025, 12:39 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
317331836 frost_ice C April 26, 2025, 12:20 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
317404871 aryxn5 C April 27, 2025, 2:33 a.m. OK C++20 (GCC 13-64) TESTS 10 46 102400
317336420 cockatooo_2025GM C April 26, 2025, 12:53 p.m. OK C++20 (GCC 13-64) TESTS 10 46 102400
317407730 Donaldqian0712 C April 27, 2025, 3:39 a.m. OK C++20 (GCC 13-64) TESTS 10 61 0
317404938 aryxn5 C April 27, 2025, 2:35 a.m. OK C++20 (GCC 13-64) TESTS 10 61 0
317400369 mathiasgw C April 27, 2025, 12:25 a.m. OK C++20 (GCC 13-64) TESTS 10 61 0
317365930 mika_uwu C April 26, 2025, 5:22 p.m. OK C++20 (GCC 13-64) TESTS 10 61 102400
317354826 AIF_is_carving C April 26, 2025, 3:28 p.m. OK C++20 (GCC 13-64) TESTS 10 61 102400
317402997 erekle C April 27, 2025, 1:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
317346863 424479543 C April 26, 2025, 2:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
317340604 pengpeng_fudan C April 26, 2025, 1:25 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
317333666 ShirayukiNoa C April 26, 2025, 12:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
317309814 YuukiS C April 26, 2025, 10:18 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
317302226 isaf27 C April 26, 2025, 9:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
317300457 cdxcdxcdxcdx C April 26, 2025, 9:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
317398223 boyliguanhan C April 26, 2025, 11:22 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 102400
317395316 Dominater069 C April 26, 2025, 10:11 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 102400
317388200 Mdominykas C April 26, 2025, 8:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 102400
317367100 ahmedafeef C April 26, 2025, 5:31 p.m. OK GNU C11 TESTS 10 124 102400
317319773 arnabmanna C April 26, 2025, 11:03 a.m. OK Java 8 TESTS 10 171 0
317311687 MATDORI C April 26, 2025, 10:26 a.m. OK PyPy 2 TESTS 10 609 15360000
317326606 SPD_9X2 C April 26, 2025, 11:33 a.m. OK PyPy 3 TESTS 10 484 10342400
317332527 ow3nL C April 26, 2025, 12:25 p.m. OK PyPy 3-64 TESTS 10 186 6860800
317318553 Piashy C April 26, 2025, 10:57 a.m. OK PyPy 3-64 TESTS 10 202 7884800
317332640 ow3nL C April 26, 2025, 12:26 p.m. OK PyPy 3-64 TESTS 10 218 6656000
317298273 harurun4635 C April 26, 2025, 9:31 a.m. OK PyPy 3-64 TESTS 10 218 8806400
317340219 Vitaly239239 C April 26, 2025, 1:22 p.m. OK PyPy 3-64 TESTS 10 249 8908800
317322076 meow_love C April 26, 2025, 11:14 a.m. OK PyPy 3-64 TESTS 10 249 9113600
317310435 tassei903 C April 26, 2025, 10:20 a.m. OK PyPy 3-64 TESTS 10 250 8704000
317309125 Jrke C April 26, 2025, 10:14 a.m. OK PyPy 3-64 TESTS 10 280 8806400
317324140 iridescent_1024 C April 26, 2025, 11:23 a.m. OK PyPy 3-64 TESTS 10 280 9318400
317316304 kai824 C April 26, 2025, 10:47 a.m. OK PyPy 3-64 TESTS 10 296 5939200
317321657 shashanksp851 C April 26, 2025, 11:12 a.m. OK Python 3 TESTS 10 140 4505600
317325325 IsaacMoris C April 26, 2025, 11:28 a.m. OK Python 3 TESTS 10 233 2252800
317314129 shade34 C April 26, 2025, 10:37 a.m. OK Python 3 TESTS 10 312 614400
317340427 Ming_Xu C April 26, 2025, 1:24 p.m. OK Rust 2021 TESTS 10 46 0
317405510 JakeMate14 C April 27, 2025, 2:48 a.m. OK Rust 2021 TESTS 10 46 102400
317315743 Dpkasd_12 C April 26, 2025, 10:44 a.m. OK Rust 2021 TESTS 10 62 102400
317318656 darkkcyan C April 26, 2025, 10:58 a.m. OK Rust 2021 TESTS 10 92 102400

remove filters

Back to search problems