Submission #4392607


Source Code Expand

import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
    public static void main(String[] $) {
        Scanner sc = new Scanner(in);
        int n=sc.nextInt(),m=sc.nextInt(),d=sc.nextInt();
        int[] a=new int[m];
        for (int i = 0; i < m; i++) {
            a[i]=sc.nextInt();
        }
        int[] s=new int[n+1];
        for (int i = 1; i <= n; i++) {
            s[i]=i;
        }
        for (int i = 0; i < m; i++) {
            swap(s,a[i]);
        }
        int[] g=new int[n+1];
        for (int i = 1; i <= n; i++) {
            g[s[i]]=i;
        }
        for (int i = 1; i <= n; i++) {
            int t=g[i];
            for (int j = 1; j < d; j++) {
                t=g[t];
            }
            out.println(t);
        }
    }
    static void swap(int[] to,int a){
        int t=to[a];
        to[a]=to[a+1];
        to[a+1]=t;
    }
}

Submission Info

Submission Time
Task D - 阿弥陀
User NS601023
Language Java8 (OpenJDK 1.8.0)
Score 30
Code Size 956 Byte
Status TLE
Exec Time 4209 ms
Memory 92584 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 × 10
TLE × 8
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 998 ms 69472 KB
01_random01.txt AC 90 ms 18628 KB
01_random02.txt AC 92 ms 18900 KB
01_random03.txt AC 94 ms 18640 KB
01_random04.txt AC 239 ms 30140 KB
01_random05.txt AC 938 ms 55908 KB
01_random06.txt AC 975 ms 65220 KB
01_random07.txt AC 1014 ms 92584 KB
02_i.txt AC 180 ms 22544 KB
02_p.txt AC 166 ms 26480 KB
02_random01.txt AC 92 ms 21588 KB
02_random02.txt AC 93 ms 17748 KB
02_random03.txt AC 191 ms 26588 KB
02_random04.txt AC 125 ms 19156 KB
02_random05.txt AC 280 ms 40056 KB
02_random06.txt AC 426 ms 49624 KB
02_random07.txt AC 530 ms 65220 KB
02_random08.txt AC 522 ms 64236 KB
02_rp01.txt AC 169 ms 23352 KB
02_rp02.txt AC 167 ms 23344 KB
02_rp03.txt AC 165 ms 25968 KB
02_rp04.txt AC 167 ms 23752 KB
02_rp05.txt AC 181 ms 23380 KB
03_i.txt TLE 4208 ms 19028 KB
03_random01.txt AC 466 ms 36288 KB
03_random02.txt AC 1042 ms 63980 KB
03_random03.txt AC 1614 ms 58256 KB
03_random04.txt AC 1447 ms 60152 KB
03_random05.txt TLE 4208 ms 42232 KB
03_random06.txt TLE 4208 ms 37944 KB
03_random07.txt TLE 4209 ms 45968 KB
03_random08.txt AC 836 ms 28304 KB
03_random09.txt AC 2173 ms 46564 KB
03_random10.txt TLE 4209 ms 47396 KB
03_random11.txt TLE 4209 ms 62312 KB
03_random12.txt TLE 4209 ms 65120 KB
03_random13.txt AC 3634 ms 62404 KB
03_random14.txt AC 792 ms 48964 KB
03_random15.txt TLE 4209 ms 46228 KB
04_i.txt TLE 4209 ms 62704 KB
04_p1.txt TLE 4205 ms 49956 KB
04_p2.txt TLE 4205 ms 45908 KB
04_random01.txt TLE 4209 ms 47340 KB
04_random02.txt TLE 4209 ms 44236 KB
04_random03.txt TLE 4208 ms 51392 KB
04_random04.txt TLE 4209 ms 64364 KB
04_random05.txt TLE 4209 ms 65172 KB
04_random06.txt TLE 4209 ms 48064 KB
04_random07.txt TLE 4209 ms 63320 KB
04_random08.txt TLE 4209 ms 63056 KB
04_random09.txt TLE 4209 ms 63152 KB
04_random10.txt TLE 4209 ms 48176 KB
04_random11.txt TLE 4209 ms 63808 KB
04_random12.txt TLE 4209 ms 62712 KB
04_random13.txt TLE 4205 ms 63168 KB
04_rp01.txt TLE 4209 ms 46932 KB
04_rp02.txt TLE 4209 ms 50764 KB
04_rp03.txt TLE 4209 ms 45720 KB
04_rp04.txt TLE 4209 ms 46268 KB
04_rp05.txt TLE 4209 ms 48416 KB
04_rp06.txt TLE 4209 ms 49996 KB
04_rp07.txt TLE 4209 ms 52116 KB
04_rp08.txt TLE 4209 ms 50212 KB
04_rp09.txt TLE 4208 ms 50556 KB
04_rp10.txt TLE 4209 ms 49540 KB
sample_1.txt AC 91 ms 21972 KB
sample_2.txt AC 92 ms 18644 KB
sample_3.txt AC 93 ms 22100 KB