Submission #2233379


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=100100;

int main(){
	int n,m,d,dtmp;
	int one[SZ]={},r[31][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 100
Code Size 1519 Byte
Status AC
Exec Time 238 ms
Memory 13312 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 232 ms 13312 KB
01_random01.txt AC 4 ms 12800 KB
01_random02.txt AC 4 ms 12800 KB
01_random03.txt AC 4 ms 12800 KB
01_random04.txt AC 12 ms 12800 KB
01_random05.txt AC 169 ms 13312 KB
01_random06.txt AC 214 ms 13312 KB
01_random07.txt AC 228 ms 13312 KB
02_i.txt AC 7 ms 12800 KB
02_p.txt AC 6 ms 12800 KB
02_random01.txt AC 4 ms 12800 KB
02_random02.txt AC 4 ms 12800 KB
02_random03.txt AC 7 ms 12800 KB
02_random04.txt AC 6 ms 12800 KB
02_random05.txt AC 11 ms 12800 KB
02_random06.txt AC 32 ms 12800 KB
02_random07.txt AC 59 ms 12800 KB
02_random08.txt AC 60 ms 12800 KB
02_rp01.txt AC 6 ms 12800 KB
02_rp02.txt AC 6 ms 12800 KB
02_rp03.txt AC 6 ms 12800 KB
02_rp04.txt AC 6 ms 12800 KB
02_rp05.txt AC 6 ms 12800 KB
03_i.txt AC 4 ms 12800 KB
03_random01.txt AC 8 ms 12800 KB
03_random02.txt AC 38 ms 12800 KB
03_random03.txt AC 32 ms 12800 KB
03_random04.txt AC 32 ms 12800 KB
03_random05.txt AC 10 ms 12800 KB
03_random06.txt AC 9 ms 12800 KB
03_random07.txt AC 12 ms 12800 KB
03_random08.txt AC 5 ms 12800 KB
03_random09.txt AC 14 ms 12800 KB
03_random10.txt AC 22 ms 12800 KB
03_random11.txt AC 36 ms 12800 KB
03_random12.txt AC 37 ms 12800 KB
03_random13.txt AC 30 ms 12800 KB
03_random14.txt AC 25 ms 12800 KB
03_random15.txt AC 12 ms 12800 KB
04_i.txt AC 227 ms 13312 KB
04_p1.txt AC 202 ms 13312 KB
04_p2.txt AC 165 ms 13184 KB
04_random01.txt AC 126 ms 13056 KB
04_random02.txt AC 92 ms 13056 KB
04_random03.txt AC 52 ms 12800 KB
04_random04.txt AC 74 ms 12800 KB
04_random05.txt AC 73 ms 12800 KB
04_random06.txt AC 128 ms 13056 KB
04_random07.txt AC 126 ms 12928 KB
04_random08.txt AC 110 ms 12928 KB
04_random09.txt AC 94 ms 12800 KB
04_random10.txt AC 118 ms 13056 KB
04_random11.txt AC 233 ms 13312 KB
04_random12.txt AC 238 ms 13312 KB
04_random13.txt AC 231 ms 13312 KB
04_rp01.txt AC 208 ms 13312 KB
04_rp02.txt AC 203 ms 13312 KB
04_rp03.txt AC 193 ms 13312 KB
04_rp04.txt AC 194 ms 13312 KB
04_rp05.txt AC 196 ms 13312 KB
04_rp06.txt AC 204 ms 13312 KB
04_rp07.txt AC 193 ms 13312 KB
04_rp08.txt AC 198 ms 13312 KB
04_rp09.txt AC 196 ms 13312 KB
04_rp10.txt AC 195 ms 13312 KB
sample_1.txt AC 4 ms 12800 KB
sample_2.txt AC 4 ms 12800 KB
sample_3.txt AC 5 ms 12800 KB