Submission #73312735
Source Code Expand
#include <algorithm>
//#include <atcoder/all>
//#include <array>
//#include <bitset>
//#include <cmath>
//#include <deque>
#include <iostream>
#include <map>
//#include <numeric>
#include <queue>
//#include <ranges>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define pb push_back
#define fr first
#define sc second
#define sor(v) sort(v.begin(), v.end())
#define rev(v) reverse(v.begin(), v.end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using pint = pair<int,int>;
//using pll = pair<ll,ll>;
//using pqdec = priority_queue<int,vector<int>,greater<int>>;
//using pqdecl = priority_queue<ll,vector<ll>,greater<ll>>;
template <typename T>
using graph = vector<vector<T>>;
const ll LLMAX = 9223372*1e10;
const int IMAX = 214*1e7;
/*--------考察--------------------
2^10 ~ 10^3
10^100 ~ 2^340
1e10動いた先をとりあえず求めるか
----------CODING----------------*/
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n; cin >> n;
vector<int> v(n);
rep(i,n){cin >> v[i]; v[i]--;}
vector<int> vv(n);
rep(i,n) vv[i] = i;
rep(i,100){
vector<int> vn(n);
rep(i,10){
rep(j,n){
vn[j] = v[vv[j]];
}
rep(j,n) vv[j] = vn[j];
}
rep(j,n) v[j] = vv[j];
}
for(int i : v) cout << i+1 << " ";
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Sugoroku Destination |
| User | scotch_at |
| Language | C++23 (GCC 15.2.0) |
| Score | 300 |
| Code Size | 1471 Byte |
| Status | AC |
| Exec Time | 334 ms |
| Memory | 9848 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 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 | AC | 1 ms | 3688 KiB |
| 00_sample_01.txt | AC | 1 ms | 3596 KiB |
| 00_sample_02.txt | AC | 1 ms | 3568 KiB |
| 01_random_03.txt | AC | 327 ms | 9848 KiB |
| 01_random_04.txt | AC | 332 ms | 9832 KiB |
| 01_random_05.txt | AC | 333 ms | 9848 KiB |
| 01_random_06.txt | AC | 333 ms | 9844 KiB |
| 01_random_07.txt | AC | 334 ms | 9840 KiB |
| 01_random_08.txt | AC | 329 ms | 9848 KiB |
| 01_random_09.txt | AC | 332 ms | 9836 KiB |
| 01_random_10.txt | AC | 331 ms | 9840 KiB |
| 01_random_11.txt | AC | 109 ms | 5556 KiB |
| 01_random_12.txt | AC | 92 ms | 5208 KiB |
| 01_random_13.txt | AC | 294 ms | 8824 KiB |
| 01_random_14.txt | AC | 19 ms | 3944 KiB |
| 01_random_15.txt | AC | 326 ms | 9848 KiB |
| 01_random_16.txt | AC | 2 ms | 3576 KiB |
| 01_random_17.txt | AC | 333 ms | 9840 KiB |