提出 #35893901


ソースコード 拡げる

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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);

    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
    }

    vector<int> sedai = {0};
    for (int i = 0; i < n; i++) {
        int p = a.at(i);
        int q = sedai.at(p - 1);
        sedai.push_back(q + 1);
        sedai.push_back(q + 1);
    }

    for (int i = 0; i < 2 * n + 1; i++) {
        cout << sedai.at(i);
        if (i == 2 * n) break;
        cout << endl;
    } 
}

提出情報

提出日時
問題 C - Ameba
ユーザ Awes
言語 C++ (GCC 9.2.1)
得点 300
コード長 522 Byte
結果 AC
実行時間 590 ms
メモリ 6152 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 2
AC × 18
セット名 テストケース
Sample sample_01.txt, sample_02.txt
All 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, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, sample_01.txt, sample_02.txt
ケース名 結果 実行時間 メモリ
random_01.txt AC 590 ms 6088 KiB
random_02.txt AC 553 ms 5888 KiB
random_03.txt AC 575 ms 5932 KiB
random_04.txt AC 98 ms 3776 KiB
random_05.txt AC 577 ms 6152 KiB
random_06.txt AC 494 ms 5872 KiB
random_07.txt AC 575 ms 6032 KiB
random_08.txt AC 438 ms 5968 KiB
random_09.txt AC 590 ms 6092 KiB
random_10.txt AC 564 ms 6076 KiB
random_11.txt AC 578 ms 5988 KiB
random_12.txt AC 186 ms 4176 KiB
random_13.txt AC 576 ms 5932 KiB
random_14.txt AC 582 ms 5932 KiB
random_15.txt AC 584 ms 5900 KiB
random_16.txt AC 5 ms 3532 KiB
sample_01.txt AC 3 ms 3392 KiB
sample_02.txt AC 3 ms 3456 KiB