Pinely Round 3 (Div. 1 + 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
1909 Pinely Round 3 (Div. 1 + Div. 2) FINISHED False 10800 28481099 Dec. 23, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1410 ) E Multiple Lamps PROGRAMMING brute force constructive algorithms number theory

B"You have n lamps, numbered from 1 to n . Initially, all the lamps are turned off. You also have n buttons. The i -th button toggles all the lamps whose index is a multiple of i . When a lamp is toggled, if it was off it turns on, and if it was on it turns off. You have to press some buttons according to the following rules. You don't want to waste too much electricity. Find a way to press buttons such that at the end at most lfloor n/5 rfloor lamps are on, or print -1 if it is impossible. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains two integers n and m ( 1 <= q n <= q 2 cdot 10^5 , 0 <= q m <= q 2 cdot 10^5 ) -- the number of lamps and the number of pairs, respectively. Each of the next m lines contains two integers u_i , v_i ( 1 <= q u_i, v_i <= q n , u_i neq v_i ). If you press the button u_i , you also have to press the button v_i . It is guaranteed that the pairs (u_i, v_i) are distinct. It is guaranteed that the sum of n and the sum of m over all test cases do not exceed 2 cdot 10^5 . For each test case: In the first test case, you need to turn at most lfloor 4/5 rfloor lamps on, which means that no lamp can be turned on. You can show that no choice of at least one button turns 0 lamps on. In the second test case, you can press buttons 3 , 5 , 1 , 2 . This is valid because In the third test case, pressing the buttons 8 , 9 , 10 turns only the lamps 8 , 9 , 10 on. "...

Tutorials

Editorial of Pinely Round 3 (Div. 1 + Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
238585389 Gassa E Dec. 23, 2023, 5:28 p.m. OK D TESTS 62 529 17408000
238598070 Gassa E Dec. 23, 2023, 7:27 p.m. OK D TESTS 62 546 17408000
238575706 SimpleCloud E Dec. 23, 2023, 4:54 p.m. OK GNU C++14 TESTS 62 265 92876800
238615517 -LAP- E Dec. 24, 2023, 2:53 a.m. OK GNU C++14 TESTS 62 296 2867200
238587423 Sukwants E Dec. 23, 2023, 5:34 p.m. OK GNU C++14 TESTS 62 296 2867200
238594739 boiling_hyta_in_prison E Dec. 23, 2023, 6:49 p.m. OK GNU C++14 TESTS 62 312 3072000
238579695 414sboy E Dec. 23, 2023, 5:07 p.m. OK GNU C++14 TESTS 62 358 2457600
238622020 honey E Dec. 24, 2023, 5 a.m. OK GNU C++14 TESTS 62 608 1228800
238583639 OIer_JoeyJ E Dec. 23, 2023, 5:22 p.m. OK GNU C++14 TESTS 62 826 3276800
238618087 woee E Dec. 24, 2023, 3:50 a.m. OK GNU C++14 TESTS 62 1029 2867200
238587383 Gold14526 E Dec. 23, 2023, 5:34 p.m. OK GNU C++14 TESTS 62 1466 2662400
238575715 intmain111 E Dec. 23, 2023, 4:54 p.m. OK GNU C++14 TESTS 62 1481 6246400
238578287 LLyw6 E Dec. 23, 2023, 5:02 p.m. OK GNU C++17 TESTS 62 202 2867200
238586566 ImaniAm E Dec. 23, 2023, 5:32 p.m. OK GNU C++17 TESTS 62 202 19660800
238620977 cs142857 E Dec. 24, 2023, 4:42 a.m. OK GNU C++17 TESTS 62 233 4915200
238607245 El3ageed_Abu_Shehab E Dec. 23, 2023, 10:10 p.m. OK GNU C++17 TESTS 62 234 8601600
238584922 al3xstr33t E Dec. 23, 2023, 5:27 p.m. OK GNU C++17 TESTS 62 249 25292800
238598414 celin E Dec. 23, 2023, 7:32 p.m. OK GNU C++17 TESTS 62 265 15155200
238600656 Khaled_k E Dec. 23, 2023, 8:03 p.m. OK GNU C++17 TESTS 62 280 4403200
238576681 schtamas E Dec. 23, 2023, 4:57 p.m. OK GNU C++17 TESTS 62 280 4403200
238583397 -Complex- E Dec. 23, 2023, 5:22 p.m. OK GNU C++17 TESTS 62 312 4915200
238577045 Enchom E Dec. 23, 2023, 4:58 p.m. OK GNU C++17 TESTS 62 312 11776000
238607205 353cerega E Dec. 23, 2023, 10:09 p.m. OK GNU C++17 (64) TESTS 62 217 9318400
238576895 Bungmint E Dec. 23, 2023, 4:57 p.m. OK GNU C++17 (64) TESTS 62 217 9318400
238577840 lethalboy E Dec. 23, 2023, 5:01 p.m. OK GNU C++17 (64) TESTS 62 218 10547200
238578981 prairie2022 E Dec. 23, 2023, 5:05 p.m. OK GNU C++17 (64) TESTS 62 249 1228800
238608869 y_combinator E Dec. 23, 2023, 11:03 p.m. OK GNU C++17 (64) TESTS 62 249 2867200
238583985 PineapplesOnPizza E Dec. 23, 2023, 5:24 p.m. OK GNU C++17 (64) TESTS 62 249 3686400
238575704 trainwithoutpain E Dec. 23, 2023, 4:54 p.m. OK GNU C++17 (64) TESTS 62 295 9318400
238614126 LXH-cat E Dec. 24, 2023, 2:20 a.m. OK GNU C++17 (64) TESTS 62 296 1228800
238581473 wrhaco E Dec. 23, 2023, 5:14 p.m. OK GNU C++17 (64) TESTS 62 296 43417600
238617950 anhkha1004 E Dec. 24, 2023, 3:48 a.m. OK GNU C++17 (64) TESTS 62 312 11571200
238609051 hyforces E Dec. 23, 2023, 11:10 p.m. OK GNU C++20 (64) TESTS 62 140 33689600
238577871 cmk666 E Dec. 23, 2023, 5:01 p.m. OK GNU C++20 (64) TESTS 62 156 1843200
238579638 SSH_automaton E Dec. 23, 2023, 5:07 p.m. OK GNU C++20 (64) TESTS 62 156 3788800
238614587 Nakagawa.Kanon E Dec. 24, 2023, 2:30 a.m. OK GNU C++20 (64) TESTS 62 156 5529600
238584020 valeriu E Dec. 23, 2023, 5:24 p.m. OK GNU C++20 (64) TESTS 62 171 5529600
238591686 KevinWan E Dec. 23, 2023, 6:23 p.m. OK GNU C++20 (64) TESTS 62 187 1228800
238579595 darkkcyan E Dec. 23, 2023, 5:07 p.m. OK GNU C++20 (64) TESTS 62 202 1228800
238604250 Wobert E Dec. 23, 2023, 9:02 p.m. OK GNU C++20 (64) TESTS 62 202 2867200
238581462 2qbingxuan E Dec. 23, 2023, 5:14 p.m. OK GNU C++20 (64) TESTS 62 202 4710400
238591750 ttamx E Dec. 23, 2023, 6:24 p.m. OK GNU C++20 (64) TESTS 62 202 9318400
238579871 Maruzensky E Dec. 23, 2023, 5:08 p.m. OK PyPy 3-64 TESTS 62 404 48128000
238609936 SamuelTull E Dec. 23, 2023, 11:46 p.m. OK PyPy 3-64 TESTS 62 608 40243200
238609700 SamuelTull E Dec. 23, 2023, 11:36 p.m. OK PyPy 3-64 TESTS 62 639 40345600
238609244 SamuelTull E Dec. 23, 2023, 11:18 p.m. OK PyPy 3-64 TESTS 62 655 40243200
238609098 SamuelTull E Dec. 23, 2023, 11:12 p.m. OK PyPy 3-64 TESTS 62 655 62873600
238608362 dirac_de E Dec. 23, 2023, 10:46 p.m. OK PyPy 3-64 TESTS 62 811 51507200
238608385 SamuelTull E Dec. 23, 2023, 10:47 p.m. OK PyPy 3-64 TESTS 62 1310 62566400
238608259 SamuelTull E Dec. 23, 2023, 10:43 p.m. OK PyPy 3-64 TESTS 62 1388 62464000
238608085 SamuelTull E Dec. 23, 2023, 10:37 p.m. OK PyPy 3-64 TESTS 62 1418 63180800
238590442 hxu10 E Dec. 23, 2023, 6:16 p.m. OK PyPy 3-64 TESTS 62 1466 54886400
238604470 kost E Dec. 23, 2023, 9:07 p.m. OK Rust 2021 TESTS 62 124 26624000

remove filters

Back to search problems