Submission #213986


Source Code Expand

Copy
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<25;
typedef pair<int,int> P;
typedef long long ll;
typedef unsigned long long ull;

void apply(vector<int>& a, vector<int> b){
	for(int i = 0; i < a.size(); i++){
		a[i] = b[a[i]];
	}
}

int main(){
	int n,m,d;
	cin>>n>>m>>d;
	vector<int> r(n);
	vector<int> a(m);
	for(int i = 0; i < n; i++){
		r[i] = i;
	}
	vector<int> res(r);
	for(int i = 0; i < m; i++){
		cin>>a[i];
	}
	reverse(a.begin(), a.end());
	for(int i = 0; i < m; i++){
		swap(r[a[i]-1],r[a[i]]);
	}

	for(;d;d>>=1){
		if(d&1){
			apply(res, r);
		}
		apply(r, r);
	}

	for(int i = 0; i < n; i++){
		cout<<res[i]+1<<endl;
	}
	
	return 0;
}

Submission Info

Submission Time
Task D - 阿弥陀
User Lepton
Language C++ (G++ 4.6.4)
Score 100
Code Size 1117 Byte
Status AC
Exec Time 504 ms
Memory 3320 KB

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 10 / 10 20 / 20 20 / 20 50 / 50
Status
AC × 9
AC × 18
AC × 18
AC × 29
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 484 ms 3288 KB
01_random01.txt AC 22 ms 804 KB
01_random02.txt AC 21 ms 916 KB
01_random03.txt AC 22 ms 800 KB
01_random04.txt AC 38 ms 932 KB
01_random05.txt AC 415 ms 2644 KB
01_random06.txt AC 476 ms 3104 KB
01_random07.txt AC 499 ms 3228 KB
02_i.txt AC 26 ms 796 KB
02_p.txt AC 25 ms 924 KB
02_random01.txt AC 23 ms 804 KB
02_random02.txt AC 21 ms 924 KB
02_random03.txt AC 26 ms 920 KB
02_random04.txt AC 26 ms 744 KB
02_random05.txt AC 33 ms 928 KB
02_random06.txt AC 60 ms 1312 KB
02_random07.txt AC 92 ms 1692 KB
02_random08.txt AC 96 ms 1696 KB
02_rp01.txt AC 25 ms 928 KB
02_rp02.txt AC 24 ms 924 KB
02_rp03.txt AC 25 ms 924 KB
02_rp04.txt AC 25 ms 796 KB
02_rp05.txt AC 25 ms 808 KB
03_i.txt AC 21 ms 924 KB
03_random01.txt AC 25 ms 808 KB
03_random02.txt AC 69 ms 1564 KB
03_random03.txt AC 62 ms 1432 KB
03_random04.txt AC 60 ms 1312 KB
03_random05.txt AC 29 ms 864 KB
03_random06.txt AC 28 ms 928 KB
03_random07.txt AC 33 ms 868 KB
03_random08.txt AC 24 ms 764 KB
03_random09.txt AC 36 ms 932 KB
03_random10.txt AC 47 ms 1184 KB
03_random11.txt AC 67 ms 1444 KB
03_random12.txt AC 70 ms 1440 KB
03_random13.txt AC 58 ms 1440 KB
03_random14.txt AC 51 ms 1316 KB
03_random15.txt AC 32 ms 1056 KB
04_i.txt AC 500 ms 3320 KB
04_p1.txt AC 449 ms 2848 KB
04_p2.txt AC 363 ms 2412 KB
04_random01.txt AC 282 ms 2132 KB
04_random02.txt AC 216 ms 1656 KB
04_random03.txt AC 105 ms 1376 KB
04_random04.txt AC 129 ms 1696 KB
04_random05.txt AC 141 ms 1572 KB
04_random06.txt AC 299 ms 2108 KB
04_random07.txt AC 268 ms 2096 KB
04_random08.txt AC 211 ms 1956 KB
04_random09.txt AC 172 ms 1828 KB
04_random10.txt AC 288 ms 1976 KB
04_random11.txt AC 504 ms 3232 KB
04_random12.txt AC 500 ms 3220 KB
04_random13.txt AC 498 ms 3228 KB
04_rp01.txt AC 453 ms 2844 KB
04_rp02.txt AC 454 ms 2848 KB
04_rp03.txt AC 455 ms 2956 KB
04_rp04.txt AC 447 ms 2840 KB
04_rp05.txt AC 458 ms 2836 KB
04_rp06.txt AC 452 ms 2844 KB
04_rp07.txt AC 456 ms 2840 KB
04_rp08.txt AC 455 ms 2848 KB
04_rp09.txt AC 453 ms 2844 KB
04_rp10.txt AC 456 ms 2840 KB
sample_1.txt AC 21 ms 928 KB
sample_2.txt AC 24 ms 796 KB
sample_3.txt AC 20 ms 928 KB