提出 #63555954


ソースコード 拡げる

//People who believe in miracles are as amazing as miracles themselves.
#include<bits/stdc++.h>
#define ll long long
using namespace std;
inline ll read(){
    ll x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-f;ch=getchar();}
    while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
    return x*f;
}

vector<int> vc(100,0);

inline void solve(){
    for(int op,x,n=read();n;--n){
        op=read();
        if(op==1) vc.emplace_back(read());
        else printf("%d\n",vc.back()),vc.pop_back();
    }
}

signed main(){
#ifndef ONLINE_JUDGE
    freopen("../1.in","r",stdin);
    freopen("../1.out","w",stdout);
#endif
    return solve(),0;
}

提出情報

提出日時
問題 B - Card Pile
ユーザ include_BM
言語 C++ 20 (gcc 12.2)
得点 200
コード長 698 Byte
結果 AC
実行時間 1 ms
メモリ 3832 KiB

コンパイルエラー

Main.cpp: In function ‘void solve()’:
Main.cpp:15:16: warning: unused variable ‘x’ [-Wunused-variable]
   15 |     for(int op,x,n=read();n;--n){
      |                ^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 23
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3652 KiB
00_sample_01.txt AC 1 ms 3776 KiB
01_handmade_00.txt AC 1 ms 3708 KiB
01_handmade_01.txt AC 1 ms 3656 KiB
01_handmade_02.txt AC 1 ms 3828 KiB
01_handmade_03.txt AC 1 ms 3832 KiB
01_handmade_04.txt AC 1 ms 3608 KiB
01_handmade_05.txt AC 1 ms 3612 KiB
02_random_00.txt AC 1 ms 3612 KiB
02_random_01.txt AC 1 ms 3596 KiB
02_random_02.txt AC 1 ms 3748 KiB
02_random_03.txt AC 1 ms 3612 KiB
02_random_04.txt AC 1 ms 3744 KiB
02_random_05.txt AC 1 ms 3684 KiB
02_random_06.txt AC 1 ms 3788 KiB
02_random_07.txt AC 1 ms 3676 KiB
02_random_08.txt AC 1 ms 3660 KiB
02_random_09.txt AC 1 ms 3616 KiB
02_random_10.txt AC 1 ms 3676 KiB
02_random_11.txt AC 1 ms 3732 KiB
02_random_12.txt AC 1 ms 3652 KiB
02_random_13.txt AC 1 ms 3592 KiB
02_random_14.txt AC 1 ms 3676 KiB