Submission #1603686
Source Code Expand
#define _USE_MATH_DEFINES #include <iostream> #include <algorithm> #include <cmath> #include <string> #include <utility> #include <climits> #include <vector> #include <map> using namespace std; #define ll long long const int MOD = 1000000007;//10^9+7 int max(int a, int b) { if (a > b)return a; else return b; } //aとbの大きい方 int min(int a, int b) { if (a < b)return a; else return b; } //aとbの小さい方 int avd_i(int a, int b) { if (a > b)return a - b; else return b - a; } double avd_d(double a, double b) { double re; if (a > b)re = a - b; else re = b - a; return re; } //aとbの差の絶対値 ll powsur(ll a, ll b, ll p) { if (b == 0) { return 1; } else if (b % 2 == 0) { ll d = powsur(a, b / 2, p); return ((d%p)*(d%p)) % p; } else { return ((a%p)*powsur(a, b - 1, p) % p) % p; } } //pは素数,aのb乗をpで割った余り ll CMOD(ll n, ll r, ll p) { ll a = 1, b = 1, c = 1, re; for (int i = 1; i <= n; i++) { a *= i; a = a%p; } for (int i = 1; i <= r; i++) { b *= i; b = b%p; } for (int i = 1; i <= n - r; i++) { c *= i; c = c%p; } b = powsur(b, p - 2, p); c = powsur(c, p - 2, p); re = ((a%p)*(b%p)) % p; re = ((re%p)*c%p) % p; return re; } //pは素数,(nCr)%p int main() { int N, M, D, A[200005], pos[100005], tmp; cin >> N >> M >> D; for (int i = 1; i <= N; i++) { pos[i] = i; } for (int i = 1; i <= M; i++) { cin >> A[i]; tmp = pos[A[i]]; pos[A[i]] = pos[A[i] + 1]; pos[A[i] + 1] = tmp; } for (int i = 1; i <= N; i++) { int now = i; for (int j = 1; j <= D; j++) { now = pos[now]; } cout << now << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - 阿弥陀 |
User | pelno |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1803 Byte |
Status | WA |
Exec Time | 4203 ms |
Memory | 2048 KB |
Judge Result
Set Name | Subtask1 | Subtask2 | Subtask3 | Subtask4 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 10 | 0 / 20 | 0 / 20 | 0 / 50 | ||||||||||||||||||||
Status |
|
|
|
|
Set Name | Test Cases |
---|---|
Subtask1 | sample_1.txt, 01_i.txt, 01_random01.txt, 01_random02.txt, 01_random03.txt, 01_random04.txt, 01_random05.txt, 01_random06.txt, 01_random07.txt |
Subtask2 | sample_1.txt, sample_2.txt, sample_3.txt, 02_i.txt, 02_p.txt, 02_random01.txt, 02_random02.txt, 02_random03.txt, 02_random04.txt, 02_random05.txt, 02_random06.txt, 02_random07.txt, 02_random08.txt, 02_rp01.txt, 02_rp02.txt, 02_rp03.txt, 02_rp04.txt, 02_rp05.txt |
Subtask3 | sample_1.txt, sample_2.txt, 03_i.txt, 03_random01.txt, 03_random02.txt, 03_random03.txt, 03_random04.txt, 03_random05.txt, 03_random06.txt, 03_random07.txt, 03_random08.txt, 03_random09.txt, 03_random10.txt, 03_random11.txt, 03_random12.txt, 03_random13.txt, 03_random14.txt, 03_random15.txt |
Subtask4 | sample_1.txt, sample_2.txt, sample_3.txt, 04_i.txt, 04_p1.txt, 04_p2.txt, 04_random01.txt, 04_random02.txt, 04_random03.txt, 04_random04.txt, 04_random05.txt, 04_random06.txt, 04_random07.txt, 04_random08.txt, 04_random09.txt, 04_random10.txt, 04_random11.txt, 04_random12.txt, 04_random13.txt, 04_rp01.txt, 04_rp02.txt, 04_rp03.txt, 04_rp04.txt, 04_rp05.txt, 04_rp06.txt, 04_rp07.txt, 04_rp08.txt, 04_rp09.txt, 04_rp10.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01_i.txt | AC | 227 ms | 1920 KB |
01_random01.txt | AC | 1 ms | 256 KB |
01_random02.txt | AC | 1 ms | 256 KB |
01_random03.txt | WA | 1 ms | 256 KB |
01_random04.txt | WA | 9 ms | 256 KB |
01_random05.txt | WA | 163 ms | 1280 KB |
01_random06.txt | WA | 205 ms | 1792 KB |
01_random07.txt | WA | 225 ms | 2048 KB |
02_i.txt | AC | 5 ms | 256 KB |
02_p.txt | WA | 4 ms | 256 KB |
02_random01.txt | AC | 1 ms | 256 KB |
02_random02.txt | WA | 1 ms | 256 KB |
02_random03.txt | WA | 4 ms | 256 KB |
02_random04.txt | AC | 4 ms | 256 KB |
02_random05.txt | WA | 9 ms | 384 KB |
02_random06.txt | WA | 29 ms | 640 KB |
02_random07.txt | WA | 56 ms | 1024 KB |
02_random08.txt | WA | 55 ms | 1024 KB |
02_rp01.txt | WA | 4 ms | 256 KB |
02_rp02.txt | WA | 4 ms | 256 KB |
02_rp03.txt | WA | 3 ms | 256 KB |
02_rp04.txt | WA | 4 ms | 256 KB |
02_rp05.txt | WA | 4 ms | 256 KB |
03_i.txt | TLE | 4203 ms | 256 KB |
03_random01.txt | AC | 265 ms | 256 KB |
03_random02.txt | AC | 568 ms | 1024 KB |
03_random03.txt | AC | 1167 ms | 896 KB |
03_random04.txt | WA | 1016 ms | 896 KB |
03_random05.txt | TLE | 4203 ms | 384 KB |
03_random06.txt | TLE | 4203 ms | 384 KB |
03_random07.txt | TLE | 4203 ms | 384 KB |
03_random08.txt | AC | 648 ms | 256 KB |
03_random09.txt | AC | 1817 ms | 512 KB |
03_random10.txt | TLE | 4203 ms | 640 KB |
03_random11.txt | TLE | 4203 ms | 1024 KB |
03_random12.txt | TLE | 4203 ms | 1024 KB |
03_random13.txt | WA | 3210 ms | 768 KB |
03_random14.txt | AC | 397 ms | 768 KB |
03_random15.txt | TLE | 4203 ms | 384 KB |
04_i.txt | TLE | 4203 ms | 1408 KB |
04_p1.txt | TLE | 4203 ms | 1024 KB |
04_p2.txt | TLE | 4203 ms | 896 KB |
04_random01.txt | TLE | 4203 ms | 896 KB |
04_random02.txt | TLE | 4203 ms | 640 KB |
04_random03.txt | TLE | 4203 ms | 640 KB |
04_random04.txt | TLE | 4203 ms | 1024 KB |
04_random05.txt | TLE | 4203 ms | 896 KB |
04_random06.txt | TLE | 4203 ms | 768 KB |
04_random07.txt | TLE | 4203 ms | 1152 KB |
04_random08.txt | TLE | 4203 ms | 1024 KB |
04_random09.txt | TLE | 4203 ms | 1152 KB |
04_random10.txt | TLE | 4203 ms | 768 KB |
04_random11.txt | TLE | 4203 ms | 1408 KB |
04_random12.txt | TLE | 4203 ms | 1408 KB |
04_random13.txt | TLE | 4203 ms | 1408 KB |
04_rp01.txt | TLE | 4203 ms | 1024 KB |
04_rp02.txt | TLE | 4203 ms | 1024 KB |
04_rp03.txt | TLE | 4203 ms | 1024 KB |
04_rp04.txt | TLE | 4203 ms | 1024 KB |
04_rp05.txt | TLE | 4203 ms | 1024 KB |
04_rp06.txt | TLE | 4203 ms | 1024 KB |
04_rp07.txt | TLE | 4203 ms | 1024 KB |
04_rp08.txt | TLE | 4203 ms | 1024 KB |
04_rp09.txt | TLE | 4203 ms | 1024 KB |
04_rp10.txt | TLE | 4203 ms | 1024 KB |
sample_1.txt | WA | 1 ms | 256 KB |
sample_2.txt | AC | 1 ms | 256 KB |
sample_3.txt | WA | 1 ms | 256 KB |