Submission #73324127
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<pair<int,int>> A;
for(int i=0;i<N;i++) {
cin >> A[i].first;
A[i].second = i+1;
}
vector<set<int>> s(N);
for(int i=0;i<N;i++) {
while(s[i].count(A[i].first)){
s[i].insert(A[i].first);
int y = A[(A[i].first)-1].first;
A[i].first = y;
}
cout << A[i].first << endl;
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Sugoroku Destination |
| User | takumu0427 |
| Language | C++23 (GCC 15.2.0) |
| Score | 0 |
| Code Size | 467 Byte |
| Status | RE |
| Exec Time | 113 ms |
| Memory | 3308 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | RE | 113 ms | 3288 KiB |
| 00_sample_01.txt | RE | 107 ms | 3124 KiB |
| 00_sample_02.txt | RE | 108 ms | 3152 KiB |
| 01_random_03.txt | RE | 109 ms | 3272 KiB |
| 01_random_04.txt | RE | 108 ms | 3280 KiB |
| 01_random_05.txt | RE | 109 ms | 3308 KiB |
| 01_random_06.txt | RE | 108 ms | 3280 KiB |
| 01_random_07.txt | RE | 108 ms | 3288 KiB |
| 01_random_08.txt | RE | 107 ms | 3308 KiB |
| 01_random_09.txt | RE | 106 ms | 3252 KiB |
| 01_random_10.txt | RE | 107 ms | 3252 KiB |
| 01_random_11.txt | RE | 107 ms | 3284 KiB |
| 01_random_12.txt | RE | 107 ms | 3308 KiB |
| 01_random_13.txt | RE | 106 ms | 3248 KiB |
| 01_random_14.txt | RE | 107 ms | 3152 KiB |
| 01_random_15.txt | RE | 107 ms | 3248 KiB |
| 01_random_16.txt | RE | 108 ms | 3152 KiB |
| 01_random_17.txt | RE | 107 ms | 3124 KiB |