Submission #214732


Source Code Expand

Copy
import java.io.BufferedInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;

public class Main {
	//public static final int C = 1000000007;
	//static BigDecimal map[][];
	//static int N;
	//static int M;

	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder();
		BufferedInputStream bs = new BufferedInputStream(System.in);
		Scanner sc = new Scanner(bs);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int d = sc.nextInt();
		
		//ArrayList<Integer> al = new ArrayList<Integer>();
		int a[] = new int[m];
		for ( int i=0; i < m; i++) {
			a[i] = sc.nextInt();
		}
		
		//int m = sc.nextInt();
		//HashMap<Integer, ArrayList<Integer>> hm = new HashMap<Integer, ArrayList<Integer>>();
		
		int ans[] = new int[n];
		int next[] = new int[n];
		for (int i = 0; i < n; i++) {
			next[i] = i;
			ans[i] = i+1;
		}
		for (int i=0; i < m; i++) {
			int x = next[a[i]-1];
			next[a[i]-1] = next[a[i]];
			next[a[i]] = x;
		}
		for (int i=0; i < d; i++) {
			int x[] = new int[n];
			for (int t=0; t < n; t++) {
				x[next[t]] = ans[t];
			}
			ans = x;
		}
		
		for (int i=0; i < n; i++) {
			
				sb.append(ans[i] + "\n");
			
		}
		
		
		System.out.print(sb);
	
	}
}

Submission Info

Submission Time
Task D - 阿弥陀
User kiki33
Language Java (OpenJDK 1.7.0)
Score 30
Code Size 1346 Byte
Status TLE
Exec Time 4126 ms
Memory 43736 KB

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 10 / 10 20 / 20 0 / 20 0 / 50
Status
AC × 9
AC × 18
AC × 5
TLE × 13
AC × 3
TLE × 26
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 1317 ms 41780 KB
01_random01.txt AC 699 ms 23092 KB
01_random02.txt AC 586 ms 23080 KB
01_random03.txt AC 549 ms 23172 KB
01_random04.txt AC 901 ms 32296 KB
01_random05.txt AC 999 ms 40996 KB
01_random06.txt AC 1445 ms 41028 KB
01_random07.txt AC 1427 ms 43736 KB
02_i.txt AC 943 ms 30016 KB
02_p.txt AC 990 ms 28604 KB
02_random01.txt AC 643 ms 23088 KB
02_random02.txt AC 542 ms 23252 KB
02_random03.txt AC 766 ms 28524 KB
02_random04.txt AC 598 ms 27972 KB
02_random05.txt AC 980 ms 36008 KB
02_random06.txt AC 1308 ms 38444 KB
02_random07.txt AC 1165 ms 38828 KB
02_random08.txt AC 1333 ms 42288 KB
02_rp01.txt AC 683 ms 27076 KB
02_rp02.txt AC 619 ms 26816 KB
02_rp03.txt AC 588 ms 25396 KB
02_rp04.txt AC 796 ms 26948 KB
02_rp05.txt AC 761 ms 27072 KB
03_i.txt TLE 4061 ms 31760 KB
03_random01.txt AC 3382 ms 37584 KB
03_random02.txt TLE 4045 ms 38776 KB
03_random03.txt TLE 4043 ms 39320 KB
03_random04.txt TLE 4065 ms 38768 KB
03_random05.txt TLE 4058 ms 38108 KB
03_random06.txt TLE 4046 ms 37304 KB
03_random07.txt TLE 4039 ms 38052 KB
03_random08.txt AC 3259 ms 31728 KB
03_random09.txt TLE 4040 ms 38080 KB
03_random10.txt TLE 4047 ms 37676 KB
03_random11.txt TLE 4041 ms 38488 KB
03_random12.txt TLE 4042 ms 39112 KB
03_random13.txt TLE 4044 ms 38696 KB
03_random14.txt AC 1833 ms 38348 KB
03_random15.txt TLE 4042 ms 38076 KB
04_i.txt TLE 4054 ms 39356 KB
04_p1.txt TLE 4049 ms 39552 KB
04_p2.txt TLE 4045 ms 39628 KB
04_random01.txt TLE 4040 ms 39064 KB
04_random02.txt TLE 4046 ms 37416 KB
04_random03.txt TLE 4051 ms 39192 KB
04_random04.txt TLE 4043 ms 38824 KB
04_random05.txt TLE 4039 ms 38612 KB
04_random06.txt TLE 4044 ms 39608 KB
04_random07.txt TLE 4049 ms 39488 KB
04_random08.txt TLE 4046 ms 39108 KB
04_random09.txt TLE 4040 ms 39484 KB
04_random10.txt TLE 4069 ms 39476 KB
04_random11.txt TLE 4062 ms 42692 KB
04_random12.txt TLE 4049 ms 43592 KB
04_random13.txt TLE 4043 ms 40316 KB
04_rp01.txt TLE 4076 ms 39584 KB
04_rp02.txt TLE 4044 ms 39624 KB
04_rp03.txt TLE 4126 ms 39380 KB
04_rp04.txt TLE 4049 ms 39128 KB
04_rp05.txt TLE 4043 ms 39428 KB
04_rp06.txt TLE 4040 ms 38888 KB
04_rp07.txt TLE 4055 ms 38608 KB
04_rp08.txt TLE 4057 ms 42740 KB
04_rp09.txt TLE 4052 ms 39344 KB
04_rp10.txt TLE 4062 ms 38972 KB
sample_1.txt AC 1081 ms 23204 KB
sample_2.txt AC 719 ms 23216 KB
sample_3.txt AC 776 ms 23216 KB