Codeforces Round 1083 (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
2205 Codeforces Round 1083 (Div. 2) FINISHED False 9000 4289123 Feb. 26, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 195 ) G Simons and Diophantus Equation PROGRAMMING bitmasks brute force data structures number theory

Simons has given you two integers (n) and (m). Count the number of ordered tuples ((i, j, k)), such that: (0\le i, j, k\le m), and There exist two integers (x) and (y), such that ((i \oplus j) \cdot x + (j \oplus k) \cdot y = n), where (\oplus) denotes the bitwise XOR operation . 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 contains two integers (n) and (m) ((1\le n\le 10^9), (1\le m\le 3\cdot 10^5)) — the given integers. It is guaranteed that the sum of (m) over all test cases does not exceed (3\cdot10^5). For each test case, output a single integer — the number of ordered tuples ((i,j,k)) that satisfy the condition. In the first test case, there are (18) tuples that satisfy the conditions. For example: ((2,1,2)) is a valid tuple because the equation ((2\oplus 1)\cdot x+(1\oplus 2)\cdot y=3) has an integer solution (x=3), (y=-2). ((1,1,0)) is also a valid tuple because the equation ((1\oplus 1)\cdot x+(1\oplus 0)\cdot y=3) has an integer solution (x=100), (y=3). ((2,0,2)) is not a valid tuple because the equation ((2\oplus 0)\cdot x+(0\oplus 2)\cdot y=3) has no integer solution. ((1,1,1)) is not a valid tuple because the equation ((1\oplus 1)\cdot x+(1\oplus 1)\cdot y=3) has no integer solution. ((3,2,1)) is not a valid tuple because (3 \gt 2).

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
364571561 abtest12345 G Feb. 26, 2026, 11:40 p.m. OK C++17 (GCC 7-32) TESTS 37 1078 96563200
364578793 ta2ly.id G Feb. 27, 2026, 2:36 a.m. OK C++17 (GCC 7-32) TESTS 37 2656 15052800
364547972 darkmatter_druid G Feb. 26, 2026, 6:10 p.m. OK C++17 (GCC 7-32) TESTS 37 3156 66150400
364539528 minirun G Feb. 26, 2026, 4:52 p.m. OK C++17 (GCC 7-32) TESTS 37 3281 103424000
364537248 RockyYue G Feb. 26, 2026, 4:42 p.m. OK C++17 (GCC 7-32) TESTS 37 3281 106291200
364533883 dev12_02 G Feb. 26, 2026, 4:26 p.m. OK C++17 (GCC 7-32) TESTS 37 4890 15257600
364532093 free_time G Feb. 26, 2026, 4:19 p.m. OK C++17 (GCC 7-32) TESTS 37 5281 10240000
364541807 GoatMessi30 G Feb. 26, 2026, 5:01 p.m. OK C++20 (GCC 13-64) TESTS 37 984 15360000
364539254 Rainmaker2627 G Feb. 26, 2026, 4:51 p.m. OK C++20 (GCC 13-64) TESTS 37 1359 251494400
364581093 PoloX898 G Feb. 27, 2026, 3:16 a.m. OK C++20 (GCC 13-64) TESTS 37 1531 130355200
364551637 van122728 G Feb. 26, 2026, 6:45 p.m. OK C++20 (GCC 13-64) TESTS 37 1609 102195200
364587069 generic_placeholder_name G Feb. 27, 2026, 5:08 a.m. OK C++20 (GCC 13-64) TESTS 37 1875 93798400
364580499 Sanae G Feb. 27, 2026, 3:06 a.m. OK C++20 (GCC 13-64) TESTS 37 2218 27545600
364547360 noya2 G Feb. 26, 2026, 6:04 p.m. OK C++20 (GCC 13-64) TESTS 37 2218 38604800
364587836 generic_placeholder_name G Feb. 27, 2026, 5:20 a.m. OK C++20 (GCC 13-64) TESTS 37 2359 14028800
364546437 Rafi22 G Feb. 26, 2026, 5:58 p.m. OK C++20 (GCC 13-64) TESTS 37 3140 378675200
364544943 Kobe_Bryant_Laoda G Feb. 26, 2026, 5:41 p.m. OK C++20 (GCC 13-64) TESTS 37 3453 66969600
364575640 XtremeXSPC G Feb. 27, 2026, 1:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 37 718 50790400
364573856 XtremeXSPC G Feb. 27, 2026, 12:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 37 828 38195200
364537319 tinca_matei G Feb. 26, 2026, 4:42 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 1093 240947200
364589576 generic_placeholder_name G Feb. 27, 2026, 5:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 37 1171 15462400
364588758 generic_placeholder_name G Feb. 27, 2026, 5:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 37 1171 15462400
364522181 sevlll777 G Feb. 26, 2026, 3:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 1234 364748800
364535986 zhibohemain G Feb. 26, 2026, 4:36 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 1250 4915200
364590884 generic_placeholder_name G Feb. 27, 2026, 6:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 37 1250 17612800
364550434 Papaulo G Feb. 26, 2026, 6:32 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 1390 130150400
364547141 Msgnh G Feb. 26, 2026, 6:02 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 1453 11161600
364548710 jdltc G Feb. 26, 2026, 6:16 p.m. OK Java 21 TESTS 37 5531 8499200
364584287 Ayush6386 G Feb. 27, 2026, 4:18 a.m. OK Kotlin 2.2 TESTS 37 2593 50380800
364531922 Sugar_fan G Feb. 26, 2026, 4:18 p.m. OK Rust 2024 TESTS 37 3609 84377600

remove filters

Back to search problems