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 |
|---|---|---|---|---|---|---|
| 2085 | Codeforces Round 1011 (Div. 2) | FINISHED | False | 7200 | 33751523 | March 22, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 13466 ) | C | Serval and The Formula | PROGRAMMING | bitmasks constructive algorithms greedy |
You are given two positive integers (x) and (y) ((1\le x, y\le 10^9)). Find a non-negative integer (k\le 10^{18}), such that ((x+k) + (y+k) = (x+k)\oplus (y+k)) holds(^{\text{∗}}), or determine that such an integer does not exist. (^{\text{∗}})(\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 of each test case contains two integers (x) and (y) ((1\le x, y\le 10^9)) — the given integers. For each test case, output a single integer (k) ((0\le k\le 10^{18})) — the integer you found. Print (-1) if it is impossible to find such an integer. If there are multiple answers, you may print any of them. In the first test case, since ((2 + 0) + (5 + 0) = (2 + 0) \oplus (5 + 0) = 7), (k=0) is a possible answer. Note that (k=4) is also a possible answer because ((2 + 4) + (5 + 4) = (2 + 4) \oplus (5 + 4) = 15). In the second test case, ((x+k)\oplus (y+k) = (6+k)\oplus (6+k) = 0). However, ((x+k)+(y+k) > 0) holds for every (k \ge 0), implying that such an integer (k) does not exist. |
| Codeforces Round #1011 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 311957791 | raghavs1304 | C | March 23, 2025, 5:12 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | ||
| 311955888 | syn-ski | C | March 23, 2025, 4:50 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | ||
| 311953101 | ComplexityMaestro | C | March 23, 2025, 4:14 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | ||
| 311944472 | HungHot | C | March 23, 2025, 1:50 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | ||
| 311942759 | fuyubo | C | March 23, 2025, 1:10 a.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | ||
| 311939969 | Hossam_H2 | C | March 22, 2025, 11:51 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | ||
| 311938169 | Phantom_Dreams | C | March 22, 2025, 11:15 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | ||
| 311935260 | topcomder69 | C | March 22, 2025, 10:33 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | ||
| 311934322 | Citypop | C | March 22, 2025, 10:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | ||
| 311929660 | Axial-Tilted | C | March 22, 2025, 9:33 p.m. | OK | C++17 (GCC 7-32) | TESTS | 13 | 46 | 0 | ||
| 311959935 | StarSilk | C | March 23, 2025, 5:32 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | ||
| 311959014 | baishixi | C | March 23, 2025, 5:24 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | ||
| 311957451 | RohitYuvaraJJadekar | C | March 23, 2025, 5:08 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | ||
| 311956465 | 36champ | C | March 23, 2025, 4:57 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | ||
| 311956024 | mion_sonozaki | C | March 23, 2025, 4:52 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | ||
| 311954392 | Binomial77 | C | March 23, 2025, 4:32 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | ||
| 311952420 | snkkkts | C | March 23, 2025, 4:05 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | ||
| 311949896 | TLE_Automat_Fan | C | March 23, 2025, 3:25 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | ||
| 311948654 | Getaway_Car | C | March 23, 2025, 3:05 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 | ||
| 311948130 | NaQingQing | C | March 23, 2025, 2:56 a.m. | OK | C++20 (GCC 13-64) | TESTS | 13 | 46 | 0 |
Back to search problems