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 |
---|---|---|---|---|---|---|
1906 | 2023-2024 ICPC, Asia Jakarta Regional Contest (Online Mirror, Unrated, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 35601863 | Dec. 3, 2023, 4:35 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 627 ) | B | Button Pressing | PROGRAMMING | bitmasks constructive algorithms hashing |
B'You are given N buttons (numbered from 1 to N ) and N lamps (numbered from 1 to N ). Each lamp can either be on or off. Initially, lamp i is on if A_i = 1 , and off if A_i = 0 . Button i is connected to lamp i - 1 (if i > 1 ) and lamp i + 1 (if i < N ). In one move, you can press a button i only if lamp i is on. When a button is pressed, the state of the lamps connected to this button is toggled. Formally, the lamps will be on if it was off previously, and the lamps will be off if it was on previously. Note that lamp i is not connected to button i , thus, the state of lamp i does not change if button i is pressed. After zero or more moves, you want lamp i to be on if B_i = 1 , and off if B_i = 0 . Determine if it is possible to achieve this task. This problem has multiple test cases. The first line consists of an integer T ( 1 <= q T <= q 1000 ), which represents the number of test cases. Each test case consists of three lines. The first line of each test case consists of an integer N ( 3 <= N <= 200 ,000 ). The sum of N over all test cases does not exceed 200 ,000 . The second line of each test case consists of a string A of length N . Each character of A can either be 0 or 1. The i -th character represents the initial state of lamp i . The third line of each test case consists of a string A of length N . Each character of B can either be 0 or 1. The i -th character represents the desired final state of lamp i . For each test case, output YES in a single line if the final state of all lamps can be reached after zero or more moves, or NO otherwise. Explanation for the sample input/output #1 For the first test case, by pressing the buttons 4, 2, 4, 3, 1, 2 in sequence, the condition of the buttons changes as: 0101 rightarrow 0111 righ'... |
problem_analysis.pdf |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
235471129 | StarSilk | B | Dec. 3, 2023, 6:03 a.m. | OK | GNU C++14 | TESTS | 32 | 30 | 716800 | ||
235495751 | aymanrasheed7 serotonin Alpha_Q | B | Dec. 3, 2023, 9:13 a.m. | OK | GNU C++14 | TESTS | 32 | 30 | 1024000 | ||
235483220 | piyush_pransukhka Atekichan itz_archit | B | Dec. 3, 2023, 7:44 a.m. | OK | GNU C++14 | TESTS | 32 | 30 | 2457600 | ||
235496892 | RealReliauk minstdfx MegalovaniaJ | B | Dec. 3, 2023, 9:21 a.m. | OK | GNU C++14 | TESTS | 32 | 31 | 2150400 | ||
235473250 | AnosVoldigoad Linmobi HHH666666 | B | Dec. 3, 2023, 6:23 a.m. | OK | GNU C++14 | TESTS | 32 | 31 | 2150400 | ||
235481161 | hohohahahihi Normie28 ilovevoi | B | Dec. 3, 2023, 7:30 a.m. | OK | GNU C++17 | TESTS | 32 | 15 | 512000 | ||
235480357 | gisp_zjz triple__a Roundgod | B | Dec. 3, 2023, 7:23 a.m. | OK | GNU C++17 | TESTS | 32 | 15 | 3174400 | ||
235490045 | KKT_89 Puranya_ ikefumy | B | Dec. 3, 2023, 8:33 a.m. | OK | GNU C++17 | TESTS | 32 | 30 | 716800 | ||
235497710 | utk AAK brobat | B | Dec. 3, 2023, 9:26 a.m. | OK | GNU C++17 | TESTS | 32 | 30 | 5324800 | ||
235487003 | aa2985759 AkaiLemon yang12138 | B | Dec. 3, 2023, 8:11 a.m. | OK | GNU C++17 | TESTS | 32 | 31 | 409600 | ||
235524610 | subhasravani | B | Dec. 3, 2023, 1:14 p.m. | OK | GNU C++17 | TESTS | 32 | 31 | 716800 | ||
235513305 | Samsara_soul | B | Dec. 3, 2023, 11:38 a.m. | OK | GNU C++17 | TESTS | 32 | 31 | 716800 | ||
235506605 | lunilay2002 | B | Dec. 3, 2023, 10:39 a.m. | OK | GNU C++17 | TESTS | 32 | 31 | 716800 | ||
235503207 | cuom1999 | B | Dec. 3, 2023, 10:10 a.m. | OK | GNU C++17 | TESTS | 32 | 31 | 921600 | ||
235479784 | n0sk1ll NemanjaSo2005 | B | Dec. 3, 2023, 7:18 a.m. | OK | GNU C++17 | TESTS | 32 | 31 | 921600 | ||
235640560 | N_z__ | B | Dec. 3, 2023, 11:31 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 15 | 102400 | ||
235475573 | rniya | B | Dec. 3, 2023, 6:44 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 15 | 716800 | ||
235500549 | Karuna | B | Dec. 3, 2023, 9:47 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 15 | 2252800 | ||
235495339 | Luqman wiwitrifai jonathanirvings | B | Dec. 3, 2023, 9:09 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 31 | 10342400 | ||
235472785 | S00021 lzc0115 DJQ | B | Dec. 3, 2023, 6:19 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 61 | 2355200 | ||
235475069 | cxm1024 IceYukino pp_orange | B | Dec. 3, 2023, 6:40 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 62 | 819200 | ||
235487276 | DanWin zhouzepeng_2023 Yaimsea | B | Dec. 3, 2023, 8:12 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 62 | 3686400 | ||
235465676 | heno239 | B | Dec. 3, 2023, 5 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 156 | 18841600 | ||
235575896 | rgnerdplayer | B | Dec. 3, 2023, 3:38 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 15 | 819200 | ||
235617680 | chappy1 | B | Dec. 3, 2023, 6:02 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 15 | 1024000 | ||
235502481 | tushaar9876 | B | Dec. 3, 2023, 10:04 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 15 | 1024000 | ||
235481199 | cabbit Kuroni | B | Dec. 3, 2023, 7:30 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 15 | 1024000 | ||
235474468 | ecnerwala ksun48 | B | Dec. 3, 2023, 6:34 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 15 | 1024000 | ||
235500922 | muhammadhasan01 | B | Dec. 3, 2023, 9:50 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 15 | 1228800 | ||
235497004 | TYpeWriting The_way_to_Rome hjl666 | B | Dec. 3, 2023, 9:21 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 15 | 1228800 | ||
235495477 | zech | B | Dec. 3, 2023, 9:10 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 15 | 1228800 | ||
235482490 | baluteshih icube | B | Dec. 3, 2023, 7:39 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 15 | 1228800 | ||
235469029 | HollwoQ_Pelw khuepr123 thenymphsofdelphi | B | Dec. 3, 2023, 5:40 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 15 | 1740800 | ||
235567227 | arvindf232 | B | Dec. 3, 2023, 3:22 p.m. | OK | Kotlin 1.6 | TESTS | 32 | 436 | 9011200 | ||
235496074 | huangxw | B | Dec. 3, 2023, 9:15 a.m. | OK | PyPy 3-64 | TESTS | 32 | 140 | 12595200 |
Back to search problems