提出 #32716093


ソースコード 拡げる

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;

typedef long long int ll;
typedef unsigned long long int ull;
typedef modint1000000007 mint;
typedef modint998244353 mint2;

#define MOD 1000000007
#define MOD2 998244353
#define pi 3.1415926535
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
#define nqs(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())

int main(void) {
    int N, K, Q;
    cin >> N >> K >> Q;
    vector<int> A(K);
    map<int,int> cnt;
    rep(i,K){
        cin >> A[i];
        cnt[A[i]] = 1;
    }
    
    rep(i,Q){
        int L;
        cin >> L;
        L--;
        if(A[L] == N){
            continue;
        } else {
            if(true){
                if(cnt[A[L]+1] == 0){
                    // ずらす
                    cnt[A[L]+1] = 1;
                    cnt[A[L]] = 0;
                    A[L]++;
                }
            }
        }
    }

    rep(i,K){
        cout << A[i] << " ";
    }
    return 0;
}

提出情報

提出日時
問題 B - 1D Pawn
ユーザ iis062
言語 C++ (GCC 9.2.1)
得点 200
コード長 1136 Byte
結果 AC
実行時間 8 ms
メモリ 3628 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 19
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 8 ms 3540 KiB
example_01.txt AC 3 ms 3540 KiB
example_02.txt AC 2 ms 3620 KiB
hand_00.txt AC 2 ms 3628 KiB
hand_01.txt AC 2 ms 3528 KiB
hand_02.txt AC 6 ms 3496 KiB
hand_03.txt AC 4 ms 3552 KiB
hand_04.txt AC 3 ms 3612 KiB
hand_05.txt AC 2 ms 3588 KiB
random_00.txt AC 2 ms 3608 KiB
random_01.txt AC 2 ms 3440 KiB
random_02.txt AC 2 ms 3460 KiB
random_03.txt AC 4 ms 3524 KiB
random_04.txt AC 3 ms 3620 KiB
random_05.txt AC 3 ms 3624 KiB
random_06.txt AC 3 ms 3440 KiB
random_07.txt AC 3 ms 3604 KiB
random_08.txt AC 3 ms 3496 KiB
random_09.txt AC 4 ms 3544 KiB