Submission #50144676


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

void solve(){
    int q;
    cin>>q;

    vector<int> v;
    for(int i = 0; i < q; i++){
        int t;
        cin>>t;
        if(t == 1){
            int x;
            cin>>x;
            v.push_back(x);
        } else{
            int k;
            cin>>k;
            cout << v[(int)v.size() - k] << '\n';
        }
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    // cin>>t;
    while(t--){
        solve();
    }

    return 0;
}

Submission Info

Submission Time
Task B - Append
User Peti25
Language C++ 20 (gcc 12.2)
Score 200
Code Size 566 Byte
Status AC
Exec Time 1 ms
Memory 3608 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 1
AC × 14
Set Name Test Cases
Sample sample_01.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, sample_01.txt
Case Name Status Exec Time Memory
random_01.txt AC 1 ms 3516 KiB
random_02.txt AC 1 ms 3552 KiB
random_03.txt AC 1 ms 3396 KiB
random_04.txt AC 1 ms 3508 KiB
random_05.txt AC 1 ms 3396 KiB
random_06.txt AC 1 ms 3388 KiB
random_07.txt AC 1 ms 3384 KiB
random_08.txt AC 1 ms 3448 KiB
random_09.txt AC 1 ms 3452 KiB
random_10.txt AC 1 ms 3392 KiB
random_11.txt AC 1 ms 3440 KiB
random_12.txt AC 1 ms 3608 KiB
random_13.txt AC 1 ms 3548 KiB
sample_01.txt AC 1 ms 3384 KiB