結果
| 問題 | No.3453 Crape Shop |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-02-28 13:46:01 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| コード長 | 492 bytes |
| 記録 | |
| コンパイル時間 | 3,415 ms |
| コンパイル使用メモリ | 339,932 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-02-28 13:46:19 |
| 合計ジャッジ時間 | 4,566 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#include<atcoder/math>
using namespace atcoder;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll N,A,B;
cin>>N>>A>>B;
vector<ll> P(N);
for(int i=0;i<N;i++){
cin>>P[i];
if(P[i]==1)A--;
else if(P[i]==2)B--;
else{
A--;B--;
}
if(min(A,B)<0){
cout<<i+1<<"\n";
return 0;
}
}
cout<<-1<<"\n";
}