AtCoder Beginner Contest 013

Submission #7470708

Source codeソースコード

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n-1);i>=0;i--)
#define FOR(i,n,m) for(int i=n;i<=(int)(m);i++)
#define RFOR(i,n,m) for(int i=(int)(n);i>=m;i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) int(x.size())
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
int main(){
    int n,m,d;
    cin>>n>>m>>d;
    vector<int> vec(n);
    rep(i,n) vec[i]=i;
    vector<int> a(m);
    rep(i,m){
        cin>>a[i];
        a[i]--;
    }
    reverse(all(a));
    rep(i,m){
        swap(vec[a[i]],vec[a[i]+1]);
    }
    //for(int x:vec) cout<<x+1<<endl;
    
    vector<vector<int>> t(28,vector<int>(n));
    rep(j,n) t[0][j]=vec[j];
    FOR(i,1,27){
        rep(j,n){
            t[i][j]=t[i-1][t[i-1][j]];
        }
    }
    
    rep(i,n){
        int now=i;
        rep(j,28){
            if(d&(1<<j)){
                now=t[j][now];
            }
        }
        cout<<now+1<<endl;
    }
}

Submission

Task問題 D - 阿弥陀
User nameユーザ名 gyouzasushi
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 WA
Score得点 30
Source lengthソースコード長 1066 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Subtask1 10 / 10 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 20 / 20 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 0 / 20 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 0 / 50 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
01_i.txt AC 220 ms 12920 KB
01_random01.txt AC 1 ms 256 KB
01_random02.txt AC 1 ms 256 KB
01_random03.txt AC 1 ms 256 KB
01_random04.txt AC 8 ms 640 KB
01_random05.txt AC 172 ms 12280 KB
01_random06.txt AC 213 ms 12792 KB
01_random07.txt AC 221 ms 12920 KB
02_i.txt AC 3 ms 384 KB
02_p.txt AC 3 ms 384 KB
02_random01.txt AC 1 ms 256 KB
02_random02.txt AC 1 ms 256 KB
02_random03.txt AC 3 ms 384 KB
02_random04.txt AC 3 ms 384 KB
02_random05.txt AC 7 ms 384 KB
02_random06.txt AC 24 ms 768 KB
02_random07.txt AC 45 ms 1152 KB
02_random08.txt AC 45 ms 1152 KB
02_rp01.txt AC 3 ms 384 KB
02_rp02.txt AC 3 ms 384 KB
02_rp03.txt AC 3 ms 384 KB
02_rp04.txt AC 3 ms 384 KB
02_rp05.txt AC 3 ms 384 KB
03_i.txt AC 1 ms 256 KB
03_random01.txt AC 4 ms 256 KB
03_random02.txt AC 31 ms 1024 KB
03_random03.txt AC 26 ms 896 KB
03_random04.txt AC 26 ms 896 KB
03_random05.txt AC 6 ms 384 KB
03_random06.txt WA
03_random07.txt WA
03_random08.txt AC 2 ms 256 KB
03_random09.txt AC 10 ms 512 KB
03_random10.txt WA
03_random11.txt WA
03_random12.txt WA
03_random13.txt AC 24 ms 768 KB
03_random14.txt AC 19 ms 768 KB
03_random15.txt AC 8 ms 384 KB
04_i.txt AC 222 ms 12920 KB
04_p1.txt WA
04_p2.txt AC 155 ms 10056 KB
04_random01.txt WA
04_random02.txt WA
04_random03.txt WA
04_random04.txt WA
04_random05.txt WA
04_random06.txt WA
04_random07.txt WA
04_random08.txt AC 97 ms 4608 KB
04_random09.txt WA
04_random10.txt WA
04_random11.txt AC 222 ms 12920 KB
04_random12.txt WA
04_random13.txt AC 220 ms 12920 KB
04_rp01.txt AC 195 ms 12536 KB
04_rp02.txt AC 191 ms 12536 KB
04_rp03.txt WA
04_rp04.txt AC 193 ms 12536 KB
04_rp05.txt AC 193 ms 12536 KB
04_rp06.txt AC 200 ms 12536 KB
04_rp07.txt AC 195 ms 12536 KB
04_rp08.txt AC 194 ms 12536 KB
04_rp09.txt WA
04_rp10.txt WA
sample_1.txt AC 1 ms 256 KB
sample_2.txt AC 1 ms 256 KB
sample_3.txt AC 1 ms 256 KB