結果

問題 No.3453 Crape Shop
コンテスト
ユーザー U10
提出日時 2026-02-28 13:40:31
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 496 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,470 ms
コンパイル使用メモリ 165,716 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-02-28 13:40:45
合計ジャッジ時間 2,578 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 6 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;


int main(){
    int n,A,B,p,count = 0;
    cin >> n;
    cin >> A >> B;

    while(A > 0 && B > 0) {
        cin >> p;
        if(p == 1){
            A--;
        } else if(p == 2) {
            B--;
        } else {
            A--;
            B--;
        }
        count++;
    }
    if(n == count) {
    cout <<  -1 << endl;
    } else {
    cout << count + 1 << endl;
    }
    return 0;
}
0