Submission #2233358


Source Code Expand

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;
const int SZ=10010;

int main(){
	int n,m,d,dtmp;
	int one[SZ]={},r[30][SZ]={};
	cin>>n>>m>>dtmp;
	FORQ(i,1,n)r[0][i]=i;
	FOR(i,0,m){
		int a;
		cin>>a;
		swap(r[0][a],r[0][a+1]);
	}
	FORQ(i,1,n)one[r[0][i]]=i;
	//FORQ(i,1,n)cout<<r[i]<<endl;
	FORQ(i,1,n)r[0][i]=one[i];
	FORQ(i,1,n)cout<<" "<<r[0][i]<<endl;
	FOR(j,0,30)FORQ(i,1,n){
		r[j+1][i]=r[j][r[j][i]];
	}
	FORQ(i,1,n){
		int now=i;
		FOR(j,0,30){
			if((dtmp&(1<<j))!=0){
				now=r[j][now];
			}
		}
		cout<<now<<endl;
	}

    return 0;
}

Submission Info

Submission Time
Task D - 阿弥陀
User kt_tenel
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1516 Byte
Status RE
Exec Time 330 ms
Memory 2048 KB

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 0 / 10 0 / 20 0 / 20 0 / 50
Status
WA × 4
RE × 5
WA × 4
RE × 14
WA × 18
WA × 2
RE × 27
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 RE 330 ms 2048 KB
01_random01.txt WA 2 ms 1408 KB
01_random02.txt WA 2 ms 1408 KB
01_random03.txt WA 2 ms 1408 KB
01_random04.txt RE 105 ms 1408 KB
01_random05.txt RE 270 ms 2048 KB
01_random06.txt RE 307 ms 2048 KB
01_random07.txt RE 324 ms 2048 KB
02_i.txt RE 99 ms 1408 KB
02_p.txt RE 102 ms 1408 KB
02_random01.txt WA 2 ms 1408 KB
02_random02.txt WA 2 ms 1408 KB
02_random03.txt RE 101 ms 1408 KB
02_random04.txt RE 100 ms 1408 KB
02_random05.txt RE 105 ms 1408 KB
02_random06.txt RE 126 ms 1408 KB
02_random07.txt RE 150 ms 1408 KB
02_random08.txt RE 150 ms 1408 KB
02_rp01.txt RE 99 ms 1408 KB
02_rp02.txt RE 101 ms 1408 KB
02_rp03.txt RE 101 ms 1408 KB
02_rp04.txt RE 101 ms 1408 KB
02_rp05.txt RE 98 ms 1408 KB
03_i.txt WA 2 ms 1408 KB
03_random01.txt WA 5 ms 1408 KB
03_random02.txt WA 36 ms 1408 KB
03_random03.txt WA 30 ms 1536 KB
03_random04.txt WA 30 ms 1408 KB
03_random05.txt WA 7 ms 1408 KB
03_random06.txt WA 6 ms 1408 KB
03_random07.txt WA 10 ms 1408 KB
03_random08.txt WA 2 ms 1408 KB
03_random09.txt WA 12 ms 1408 KB
03_random10.txt WA 20 ms 1408 KB
03_random11.txt WA 33 ms 1408 KB
03_random12.txt WA 34 ms 1408 KB
03_random13.txt WA 28 ms 1408 KB
03_random14.txt WA 23 ms 1408 KB
03_random15.txt WA 10 ms 1408 KB
04_i.txt RE 327 ms 2048 KB
04_p1.txt RE 288 ms 2048 KB
04_p2.txt RE 253 ms 1920 KB
04_random01.txt RE 222 ms 1792 KB
04_random02.txt RE 184 ms 1664 KB
04_random03.txt RE 148 ms 1536 KB
04_random04.txt RE 167 ms 1536 KB
04_random05.txt RE 168 ms 1536 KB
04_random06.txt RE 222 ms 1792 KB
04_random07.txt RE 219 ms 1664 KB
04_random08.txt RE 200 ms 1664 KB
04_random09.txt RE 195 ms 1536 KB
04_random10.txt RE 214 ms 1792 KB
04_random11.txt RE 327 ms 2048 KB
04_random12.txt RE 329 ms 2048 KB
04_random13.txt RE 326 ms 2048 KB
04_rp01.txt RE 292 ms 2048 KB
04_rp02.txt RE 291 ms 2048 KB
04_rp03.txt RE 292 ms 2048 KB
04_rp04.txt RE 288 ms 2048 KB
04_rp05.txt RE 289 ms 2048 KB
04_rp06.txt RE 307 ms 2048 KB
04_rp07.txt RE 291 ms 2048 KB
04_rp08.txt RE 291 ms 2048 KB
04_rp09.txt RE 291 ms 2048 KB
04_rp10.txt RE 294 ms 2048 KB
sample_1.txt WA 2 ms 1408 KB
sample_2.txt WA 2 ms 1408 KB
sample_3.txt RE 98 ms 1408 KB