Submission #214642


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.println(sb);
	
	}
}

Submission Info

Submission Time
Task D - 阿弥陀
User kiki33
Language Java (OpenJDK 1.7.0)
Score 0
Code Size 1348 Byte
Status WA
Exec Time 4049 ms
Memory 41928 KB

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 0 / 10 0 / 20 0 / 20 0 / 50
Status
WA × 9
WA × 18
WA × 5
TLE × 13
WA × 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 WA 1034 ms 41348 KB
01_random01.txt WA 758 ms 23200 KB
01_random02.txt WA 459 ms 23220 KB
01_random03.txt WA 448 ms 23216 KB
01_random04.txt WA 658 ms 33172 KB
01_random05.txt WA 862 ms 41300 KB
01_random06.txt WA 973 ms 41048 KB
01_random07.txt WA 1025 ms 41928 KB
02_i.txt WA 562 ms 30528 KB
02_p.txt WA 545 ms 28612 KB
02_random01.txt WA 462 ms 23220 KB
02_random02.txt WA 466 ms 23212 KB
02_random03.txt WA 603 ms 28848 KB
02_random04.txt WA 484 ms 27988 KB
02_random05.txt WA 728 ms 36736 KB
02_random06.txt WA 810 ms 38420 KB
02_random07.txt WA 905 ms 39004 KB
02_random08.txt WA 915 ms 38812 KB
02_rp01.txt WA 524 ms 27076 KB
02_rp02.txt WA 525 ms 26820 KB
02_rp03.txt WA 547 ms 25392 KB
02_rp04.txt WA 528 ms 26812 KB
02_rp05.txt WA 523 ms 27072 KB
03_i.txt TLE 4038 ms 31728 KB
03_random01.txt WA 2950 ms 37168 KB
03_random02.txt TLE 4038 ms 39324 KB
03_random03.txt TLE 4046 ms 38840 KB
03_random04.txt TLE 4049 ms 38356 KB
03_random05.txt TLE 4037 ms 37584 KB
03_random06.txt TLE 4037 ms 36368 KB
03_random07.txt TLE 4044 ms 37476 KB
03_random08.txt WA 2827 ms 31612 KB
03_random09.txt TLE 4038 ms 37616 KB
03_random10.txt TLE 4039 ms 38696 KB
03_random11.txt TLE 4039 ms 38004 KB
03_random12.txt TLE 4037 ms 38876 KB
03_random13.txt TLE 4038 ms 39248 KB
03_random14.txt WA 1726 ms 38488 KB
03_random15.txt TLE 4041 ms 37892 KB
04_i.txt TLE 4042 ms 40352 KB
04_p1.txt TLE 4040 ms 39728 KB
04_p2.txt TLE 4040 ms 39012 KB
04_random01.txt TLE 4043 ms 38664 KB
04_random02.txt TLE 4037 ms 38328 KB
04_random03.txt TLE 4040 ms 38236 KB
04_random04.txt TLE 4038 ms 38920 KB
04_random05.txt TLE 4039 ms 38840 KB
04_random06.txt TLE 4039 ms 38480 KB
04_random07.txt TLE 4043 ms 39288 KB
04_random08.txt TLE 4039 ms 39140 KB
04_random09.txt TLE 4043 ms 39040 KB
04_random10.txt TLE 4038 ms 38692 KB
04_random11.txt TLE 4044 ms 39244 KB
04_random12.txt TLE 4039 ms 39792 KB
04_random13.txt TLE 4039 ms 40008 KB
04_rp01.txt TLE 4039 ms 39296 KB
04_rp02.txt TLE 4039 ms 39164 KB
04_rp03.txt TLE 4040 ms 40028 KB
04_rp04.txt TLE 4040 ms 39648 KB
04_rp05.txt TLE 4040 ms 39692 KB
04_rp06.txt TLE 4038 ms 39772 KB
04_rp07.txt TLE 4045 ms 39468 KB
04_rp08.txt TLE 4037 ms 39020 KB
04_rp09.txt TLE 4043 ms 39372 KB
04_rp10.txt TLE 4040 ms 40160 KB
sample_1.txt WA 452 ms 23220 KB
sample_2.txt WA 451 ms 23168 KB
sample_3.txt WA 451 ms 23220 KB