#include <iostream>
using namespace std;
int cnt[200001], N, M, u;
int main(){
cin >> N >> M;
for(int i = 0; i < 2 * (N + M - 1); i++){
cin >> u;
if(cnt[u] > 0) cout << cnt[u] << " 1" << endl;
cnt[u]++;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
380 KB |
Output is correct |
3 |
Correct |
581 ms |
2564 KB |
Output is correct |
4 |
Correct |
657 ms |
2784 KB |
Output is correct |
5 |
Correct |
123 ms |
764 KB |
Output is correct |
6 |
Correct |
681 ms |
2784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
376 KB |
Output is correct |
3 |
Correct |
5 ms |
256 KB |
Output is correct |
4 |
Correct |
5 ms |
256 KB |
Output is correct |
5 |
Correct |
5 ms |
256 KB |
Output is correct |
6 |
Correct |
5 ms |
376 KB |
Output is correct |
7 |
Correct |
5 ms |
376 KB |
Output is correct |
8 |
Correct |
5 ms |
256 KB |
Output is correct |
9 |
Correct |
5 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
376 KB |
Output is correct |
2 |
Correct |
8 ms |
376 KB |
Output is correct |
3 |
Correct |
7 ms |
256 KB |
Output is correct |
4 |
Correct |
7 ms |
376 KB |
Output is correct |
5 |
Correct |
5 ms |
256 KB |
Output is correct |
6 |
Correct |
9 ms |
256 KB |
Output is correct |
7 |
Correct |
7 ms |
256 KB |
Output is correct |
8 |
Correct |
5 ms |
376 KB |
Output is correct |
9 |
Correct |
6 ms |
376 KB |
Output is correct |
10 |
Correct |
8 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
380 KB |
Output is correct |
3 |
Correct |
581 ms |
2564 KB |
Output is correct |
4 |
Correct |
657 ms |
2784 KB |
Output is correct |
5 |
Correct |
123 ms |
764 KB |
Output is correct |
6 |
Correct |
681 ms |
2784 KB |
Output is correct |
7 |
Correct |
5 ms |
256 KB |
Output is correct |
8 |
Correct |
5 ms |
376 KB |
Output is correct |
9 |
Correct |
5 ms |
256 KB |
Output is correct |
10 |
Correct |
5 ms |
256 KB |
Output is correct |
11 |
Correct |
5 ms |
256 KB |
Output is correct |
12 |
Correct |
5 ms |
376 KB |
Output is correct |
13 |
Correct |
5 ms |
376 KB |
Output is correct |
14 |
Correct |
5 ms |
256 KB |
Output is correct |
15 |
Correct |
5 ms |
376 KB |
Output is correct |
16 |
Correct |
5 ms |
376 KB |
Output is correct |
17 |
Correct |
8 ms |
376 KB |
Output is correct |
18 |
Correct |
7 ms |
256 KB |
Output is correct |
19 |
Correct |
7 ms |
376 KB |
Output is correct |
20 |
Correct |
5 ms |
256 KB |
Output is correct |
21 |
Correct |
9 ms |
256 KB |
Output is correct |
22 |
Correct |
7 ms |
256 KB |
Output is correct |
23 |
Correct |
5 ms |
376 KB |
Output is correct |
24 |
Correct |
6 ms |
376 KB |
Output is correct |
25 |
Correct |
8 ms |
376 KB |
Output is correct |
26 |
Correct |
50 ms |
504 KB |
Output is correct |
27 |
Correct |
585 ms |
2680 KB |
Output is correct |
28 |
Correct |
605 ms |
2808 KB |
Output is correct |
29 |
Correct |
355 ms |
1272 KB |
Output is correct |
30 |
Correct |
580 ms |
2456 KB |
Output is correct |
31 |
Correct |
105 ms |
632 KB |
Output is correct |
32 |
Correct |
67 ms |
504 KB |
Output is correct |
33 |
Correct |
558 ms |
1912 KB |
Output is correct |
34 |
Correct |
506 ms |
1656 KB |
Output is correct |
35 |
Correct |
606 ms |
2172 KB |
Output is correct |
36 |
Correct |
595 ms |
1912 KB |
Output is correct |
37 |
Correct |
5 ms |
256 KB |
Output is correct |