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 |
|---|---|---|---|---|---|---|
| 2161 | Pinely Round 5 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 14563523 | Oct. 30, 2025, 4:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 57 ) | H | Cycle Sort | PROGRAMMING |
You are given two integer arrays (a_0, \ldots, a_{n - 1}) and (b_0, \ldots, b_{m - 1}). Each integer among (1, \ldots, n + m) is present exactly once among (a_0, \ldots, a_{n - 1}, b_0, \ldots, b_{m - 1}). We perform (k) operations on the arrays. Namely, for each integer (i) from (0) to (k - 1) in this order if (a_{i \bmod n} > b_{i \bmod m}), we swap (a_{i \bmod n}) and (b_{i \bmod m}) otherwise, we do nothing Determine the final state of both arrays after all (k) operations are completed. 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 first line of each test case contains three integers (n, m, k) ((1 \leq n, m \leq 2 \cdot 10^5), (0 \leq k \leq 10^{18})). The second line contains (n) integers (a_0, \ldots, a_{n - 1}). The third line contains (m) integers (b_0, \ldots, b_{m - 1}). It is guaranteed that the joint sequence (a_0, \ldots, a_{n - 1}, b_0, \ldots, b_{m - 1}) is a permutation of integers from (1) to (n + m). The sum of (n + m) over all testcases doesn't exceed (2 \cdot 10^5). For each testcase, print two lines — the states of the arrays (a_0, \ldots, a_{n - 1}) and (b_0, \ldots, b_{m - 1}) after the (k) operations are performed as described above. The action sequence for the first example |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 346751397 | hungchi17 | H | Oct. 31, 2025, 12:41 a.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 952 | 29184000 | ||
| 346756290 | xuantien123 | H | Oct. 31, 2025, 2:24 a.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 984 | 29388800 | ||
| 346751350 | hungchi17 | H | Oct. 31, 2025, 12:40 a.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 1015 | 29184000 | ||
| 346751695 | Mabingnan__V | H | Oct. 31, 2025, 12:49 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 858 | 29593600 | ||
| 346748498 | ksun48 | H | Oct. 30, 2025, 11:22 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 859 | 29593600 | ||
| 346749495 | CHATTY-Bebob | H | Oct. 30, 2025, 11:49 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 952 | 29491200 |
Back to search problems