| Task: | Fishers |
| Sender: | aalto26jw_001 |
| Submission time: | 2026-11-11 17:49:21 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | RUNTIME ERROR | 0.00 s | details |
| #2 | WRONG ANSWER | 0.00 s | details |
| #3 | RUNTIME ERROR | 0.00 s | details |
| #4 | RUNTIME ERROR | 0.00 s | details |
| #5 | RUNTIME ERROR | 0.00 s | details |
| #6 | WRONG ANSWER | 0.00 s | details |
| #7 | RUNTIME ERROR | 0.00 s | details |
| #8 | RUNTIME ERROR | 0.00 s | details |
| #9 | RUNTIME ERROR | 0.00 s | details |
| #10 | RUNTIME ERROR | 0.00 s | details |
| #11 | RUNTIME ERROR | 0.00 s | details |
| #12 | RUNTIME ERROR | 0.00 s | details |
| #13 | RUNTIME ERROR | 0.00 s | details |
| #14 | RUNTIME ERROR | 0.00 s | details |
| #15 | WRONG ANSWER | 0.00 s | details |
| #16 | RUNTIME ERROR | 0.00 s | details |
| #17 | WRONG ANSWER | 0.00 s | details |
| #18 | RUNTIME ERROR | 0.00 s | details |
| #19 | WRONG ANSWER | 0.00 s | details |
| #20 | RUNTIME ERROR | 0.00 s | details |
| #21 | RUNTIME ERROR | 0.00 s | details |
| #22 | RUNTIME ERROR | 0.00 s | details |
| #23 | RUNTIME ERROR | 0.00 s | details |
| #24 | RUNTIME ERROR | 0.00 s | details |
| #25 | WRONG ANSWER | 0.00 s | details |
| #26 | RUNTIME ERROR | 0.00 s | details |
| #27 | WRONG ANSWER | 0.00 s | details |
| #28 | RUNTIME ERROR | 0.00 s | details |
| #29 | WRONG ANSWER | 0.00 s | details |
| #30 | RUNTIME ERROR | 0.00 s | details |
| #31 | RUNTIME ERROR | 0.00 s | details |
| #32 | RUNTIME ERROR | 0.01 s | details |
| #33 | RUNTIME ERROR | 0.01 s | details |
| #34 | RUNTIME ERROR | 0.01 s | details |
| #35 | WRONG ANSWER | 0.00 s | details |
| #36 | RUNTIME ERROR | 0.01 s | details |
| #37 | WRONG ANSWER | 0.00 s | details |
| #38 | RUNTIME ERROR | 0.00 s | details |
| #39 | WRONG ANSWER | 0.00 s | details |
| #40 | RUNTIME ERROR | 0.01 s | details |
| #41 | RUNTIME ERROR | 0.01 s | details |
| #42 | RUNTIME ERROR | 0.01 s | details |
| #43 | RUNTIME ERROR | 0.01 s | details |
| #44 | RUNTIME ERROR | 0.01 s | details |
| #45 | WRONG ANSWER | 0.01 s | details |
| #46 | RUNTIME ERROR | 0.01 s | details |
| #47 | WRONG ANSWER | 0.01 s | details |
| #48 | RUNTIME ERROR | 0.01 s | details |
| #49 | WRONG ANSWER | 0.01 s | details |
| #50 | RUNTIME ERROR | 0.01 s | details |
| #51 | RUNTIME ERROR | 0.01 s | details |
| #52 | RUNTIME ERROR | 0.01 s | details |
| #53 | RUNTIME ERROR | 0.01 s | details |
| #54 | RUNTIME ERROR | 0.01 s | details |
| #55 | WRONG ANSWER | 0.01 s | details |
| #56 | RUNTIME ERROR | 0.01 s | details |
| #57 | WRONG ANSWER | 0.01 s | details |
| #58 | RUNTIME ERROR | 0.01 s | details |
| #59 | WRONG ANSWER | 0.01 s | details |
| #60 | RUNTIME ERROR | 0.01 s | details |
| #61 | RUNTIME ERROR | 0.54 s | details |
| #62 | RUNTIME ERROR | 0.54 s | details |
| #63 | RUNTIME ERROR | 0.54 s | details |
| #64 | RUNTIME ERROR | 0.54 s | details |
| #65 | WRONG ANSWER | 0.40 s | details |
Code
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> fishers(n+1, 0);
vector<int> edges(n*2+1);
for(int i = 1; i <= 2*n; i++){
int aux;
cin >> aux;
aux = abs(aux);
if(fishers[aux] == 0) fishers[aux] = i;
else{
edges[i] = fishers[aux];
edges[fishers[aux]] = i;
}
}
bool found = false;
queue<pair<int, int>> ranges;
ranges.push({1, edges[1]});
ranges.push({edges[1], n*2 + 1});
for(int i = 1; i <= 2*n; i++) cout << i << " " << edges[i] << endl;
while(!found || !ranges.empty()){
pair<int, int> new_range = ranges.front();
ranges.pop();
int pos = new_range.first + 1;
while(pos < new_range.second && !found){
cout << pos << endl;
if(edges[pos] < new_range.second) ranges.push({pos, edges[pos]});
else found = true;
if(edges[pos] + 1 > 2*n) break;
else pos = edges[pos] + 1;
}
}
if(!found) cout << "No" << endl;
else cout << "Yes" << endl;
}Test details
Test 1
Verdict: RUNTIME ERROR
| input |
|---|
| 1 -1 1 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 2 2 1 |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 2 1 -2 -1 2 |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 3 2 4 3 1 4 2 2 ... |
Test 3
Verdict: RUNTIME ERROR
| input |
|---|
| 2 -2 2 1 -1 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 2 2 1 3 4 4 3 3 |
Test 4
Verdict: RUNTIME ERROR
| input |
|---|
| 3 -2 -3 -1 1 3 2 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 6 2 5 3 4 4 3 5 2 ... |
Test 5
Verdict: RUNTIME ERROR
| input |
|---|
| 3 -2 -1 -3 3 1 2 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 6 2 5 3 4 4 3 5 2 ... |
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 3 2 3 -2 -1 1 -3 |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 3 2 6 3 1 4 5 5 4 ... |
Test 7
Verdict: RUNTIME ERROR
| input |
|---|
| 4 3 2 1 -1 -2 -3 4 -4 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 6 2 5 3 4 4 3 5 2 ... |
Test 8
Verdict: RUNTIME ERROR
| input |
|---|
| 4 -3 1 -1 3 -2 -4 4 2 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 4 2 3 3 2 4 1 5 8 ... |
Test 9
Verdict: RUNTIME ERROR
| input |
|---|
| 4 3 -3 2 -4 1 -1 4 -2 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 2 2 1 3 8 4 7 5 6 ... |
Test 10
Verdict: RUNTIME ERROR
| input |
|---|
| 4 -1 1 -2 2 3 4 -4 -3 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 2 2 1 3 4 4 3 5 8 ... |
Test 11
Verdict: RUNTIME ERROR
| input |
|---|
| 5 4 3 5 -2 -1 1 2 -5 -3 -4 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 10 2 9 3 8 4 7 5 6 ... |
Test 12
Verdict: RUNTIME ERROR
| input |
|---|
| 5 1 2 -2 -1 4 3 -5 5 -3 -4 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 4 2 3 3 2 4 1 5 10 ... |
Test 13
Verdict: RUNTIME ERROR
| input |
|---|
| 5 2 -5 5 1 3 4 -4 -3 -1 -2 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 10 2 3 3 2 4 9 5 8 ... |
Test 14
Verdict: RUNTIME ERROR
| input |
|---|
| 5 2 -2 1 -5 -4 4 5 -1 -3 3 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 2 2 1 3 8 4 7 5 6 ... |
Test 15
Verdict: WRONG ANSWER
| input |
|---|
| 5 -1 -4 5 3 2 -5 1 4 -3 -2 |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 7 2 8 3 6 4 9 5 10 ... |
Test 16
Verdict: RUNTIME ERROR
| input |
|---|
| 5 1 2 -3 -5 -4 4 5 3 -2 -1 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 10 2 9 3 8 4 7 5 6 ... |
Test 17
Verdict: WRONG ANSWER
| input |
|---|
| 5 4 -1 -5 -4 2 5 -3 1 -2 3 |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 4 2 8 3 6 4 1 5 9 ... |
Test 18
Verdict: RUNTIME ERROR
| input |
|---|
| 5 -2 4 -4 2 3 1 5 -5 -1 -3 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 4 2 3 3 2 4 1 5 10 ... |
Test 19
Verdict: WRONG ANSWER
| input |
|---|
| 5 -4 -5 -1 3 1 -2 2 -3 4 5 |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 9 2 10 3 5 4 8 5 3 ... |
Test 20
Verdict: RUNTIME ERROR
| input |
|---|
| 5 -5 4 1 -1 -4 2 3 -3 -2 5 |
| correct output |
|---|
| No |
| user output |
|---|
| 1 10 2 5 3 4 4 3 5 2 ... |
Test 21
Verdict: RUNTIME ERROR
| input |
|---|
| 10 1 -7 7 -1 -2 -5 5 2 -10 4 -9 9... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 4 2 3 3 2 4 1 5 8 ... |
Test 22
Verdict: RUNTIME ERROR
| input |
|---|
| 10 5 -5 -6 -7 10 9 1 -1 -9 -10 8 ... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 2 2 1 3 20 4 19 5 10 ... |
Test 23
Verdict: RUNTIME ERROR
| input |
|---|
| 10 -9 1 3 2 -2 5 -5 6 8 7 -7 -8 -... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 20 2 19 3 18 4 5 5 4 ... |
Test 24
Verdict: RUNTIME ERROR
| input |
|---|
| 10 1 2 -2 -1 -3 4 -4 8 -8 5 -5 -7... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 4 2 3 3 2 4 1 5 20 ... |
Test 25
Verdict: WRONG ANSWER
| input |
|---|
| 10 6 3 5 -2 2 -4 10 -6 9 -1 7 8 -... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 8 2 20 3 19 4 5 5 4 ... |
Test 26
Verdict: RUNTIME ERROR
| input |
|---|
| 10 6 -9 7 -7 1 -1 9 -6 -3 4 2 -10... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 8 2 7 3 4 4 3 5 6 ... |
Test 27
Verdict: WRONG ANSWER
| input |
|---|
| 10 -3 6 8 -9 -1 4 -7 -6 -4 2 5 1 ... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 20 2 8 3 18 4 13 5 12 ... |
Test 28
Verdict: RUNTIME ERROR
| input |
|---|
| 10 -4 4 -7 2 -1 10 -3 9 -9 8 -5 -... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 2 2 1 3 20 4 19 5 18 ... |
Test 29
Verdict: WRONG ANSWER
| input |
|---|
| 10 -2 -6 7 -1 -8 -5 6 1 4 -4 5 2 ... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 12 2 7 3 18 4 8 5 17 ... |
Test 30
Verdict: RUNTIME ERROR
| input |
|---|
| 10 8 -8 -7 -5 -3 10 6 -2 1 -1 2 -... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 2 2 1 3 20 4 19 5 18 ... |
Test 31
Verdict: RUNTIME ERROR
| input |
|---|
| 100 -14 14 -65 -19 100 44 -73 56 -... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 2 2 1 3 200 4 199 5 198 ... |
Test 32
Verdict: RUNTIME ERROR
| input |
|---|
| 100 -96 29 -90 80 -6 20 43 39 76 -... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 174 2 173 3 172 4 43 5 42 ... |
Test 33
Verdict: RUNTIME ERROR
| input |
|---|
| 100 79 -86 -28 40 -5 -11 13 69 -2 ... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 182 2 23 3 22 4 21 5 20 ... |
Test 34
Verdict: RUNTIME ERROR
| input |
|---|
| 100 74 -80 51 39 -39 -51 80 -74 26... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 8 2 7 3 6 4 5 5 4 ... |
Test 35
Verdict: WRONG ANSWER
| input |
|---|
| 100 -53 -48 27 -91 73 38 -80 -12 5... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 176 2 157 3 108 4 81 5 27 ... |
Test 36
Verdict: RUNTIME ERROR
| input |
|---|
| 100 82 75 -18 36 59 93 33 74 -16 -... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 154 2 153 3 152 4 151 5 150 ... |
Test 37
Verdict: WRONG ANSWER
| input |
|---|
| 100 -100 72 -43 63 95 -37 -48 23 3... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 37 2 162 3 89 4 159 5 43 ... |
Test 38
Verdict: RUNTIME ERROR
| input |
|---|
| 100 -74 -89 88 23 -66 16 -21 99 -5... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 84 2 83 3 82 4 81 5 80 ... |
Test 39
Verdict: WRONG ANSWER
| input |
|---|
| 100 -78 36 -4 -7 -54 85 10 -61 22 ... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 90 2 197 3 102 4 103 5 21 ... |
Test 40
Verdict: RUNTIME ERROR
| input |
|---|
| 100 58 46 -79 14 -11 38 5 39 66 -8... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 182 2 181 3 180 4 179 5 178 ... |
Test 41
Verdict: RUNTIME ERROR
| input |
|---|
| 200 -133 -37 78 101 -124 26 -200 6... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 400 2 399 3 398 4 397 5 396 ... |
Test 42
Verdict: RUNTIME ERROR
| input |
|---|
| 200 80 -151 138 -132 -186 145 60 -... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 400 2 399 3 20 4 19 5 18 ... |
Test 43
Verdict: RUNTIME ERROR
| input |
|---|
| 200 24 157 -185 185 -157 -24 62 -1... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 6 2 5 3 4 4 3 5 2 ... |
Test 44
Verdict: RUNTIME ERROR
| input |
|---|
| 200 17 84 -43 54 -140 193 -193 140... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 12 2 11 3 10 4 9 5 8 ... |
Test 45
Verdict: WRONG ANSWER
| input |
|---|
| 200 62 -196 90 -173 -143 -58 32 -1... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 176 2 126 3 227 4 291 5 188 ... |
Test 46
Verdict: RUNTIME ERROR
| input |
|---|
| 200 32 117 -59 80 79 29 92 -78 -94... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 210 2 209 3 208 4 207 5 206 ... |
Test 47
Verdict: WRONG ANSWER
| input |
|---|
| 200 -31 -111 144 -198 -49 149 -35 ... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 194 2 261 3 340 4 298 5 326 ... |
Test 48
Verdict: RUNTIME ERROR
| input |
|---|
| 200 -148 -131 86 -140 176 -41 -200... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 84 2 83 3 82 4 81 5 80 ... |
Test 49
Verdict: WRONG ANSWER
| input |
|---|
| 200 -52 187 95 133 143 -123 -88 -1... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 309 2 15 3 63 4 108 5 52 ... |
Test 50
Verdict: RUNTIME ERROR
| input |
|---|
| 200 -101 -182 82 -96 187 114 -129 ... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 356 2 355 3 354 4 353 5 352 ... |
Test 51
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 -117 815 548 -910 710 -273 -94... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 18 2 17 3 16 4 15 5 14 ... |
Error:
free(): double free detected in tcache 2
Test 52
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 586 754 -867 772 941 456 -456 ... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 1962 2 1961 3 10 4 9 5 8 ... |
Error:
free(): double free detected in tcache 2
Test 53
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 247 -998 -430 897 395 134 993 ... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 1982 2 1981 3 28 4 27 5 26 ... |
Test 54
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 -145 981 -405 444 881 -428 640... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 18 2 17 3 16 4 15 5 14 ... |
Error:
free(): double free detected in tcache 2
Test 55
Verdict: WRONG ANSWER
| input |
|---|
| 1000 637 313 687 -543 -78 -785 628 ... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 888 2 1138 3 1608 4 1915 5 1969 ... |
Test 56
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 -616 377 749 -717 -582 436 33 ... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 826 2 825 3 824 4 823 5 822 ... |
Test 57
Verdict: WRONG ANSWER
| input |
|---|
| 1000 534 -329 -984 -689 -411 275 -7... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 1846 2 649 3 1605 4 498 5 480 ... |
Test 58
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 -231 -855 815 805 -665 354 497... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 1782 2 1781 3 1780 4 1779 5 1778 ... |
Test 59
Verdict: WRONG ANSWER
| input |
|---|
| 1000 -25 824 -712 979 -456 -17 -356... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 107 2 1663 3 1324 4 1763 5 363 ... |
Test 60
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 378 153 -125 298 -622 151 -554... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 1370 2 1369 3 1368 4 1367 5 1366 ... |
Error:
free(): double free detected in tcache 2
Test 61
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 2482 97936 75560 -55358 -61956... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 199984 2 199983 3 199982 4 199981 5 40 ... |
Error:
double free or corruption (top)
Test 62
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 -48238 -24424 51980 7303 55103... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 28 2 27 3 26 4 25 5 24 ... |
Error:
corrupted size vs. prev_size while consolidating
Test 63
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 74971 50837 90459 -64742 -7834... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 199994 2 199993 3 199992 4 199991 5 199990 ... |
Error:
corrupted size vs. prev_size while consolidating
Test 64
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 -62002 67632 -67632 62002 8747... |
| correct output |
|---|
| No |
| user output |
|---|
| 1 4 2 3 3 2 4 1 5 200000 ... |
Error:
double free or corruption (!prev)
Test 65
Verdict: WRONG ANSWER
| input |
|---|
| 100000 -69625 37139 -26540 -24951 357... |
| correct output |
|---|
| Yes |
| user output |
|---|
| 1 92432 2 96663 3 68946 4 10060 5 110427 ... |
