結果
| 問題 | No.3453 Crape Shop |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2026-03-01 01:27:24 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
AC
|
| 実行時間 | 123 ms / 2,000 ms |
| コード長 | 514 bytes |
| 記録 | |
| コンパイル時間 | 568 ms |
| コンパイル使用メモリ | 20,952 KB |
| 実行使用メモリ | 16,476 KB |
| 最終ジャッジ日時 | 2026-03-01 01:27:29 |
| 合計ジャッジ時間 | 4,729 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
import sys
input = sys.stdin.readline
N=int(input())
A,B=list(map(int,input().split()))
P=list(map(int,input().split()))
ANS=-1
for i in range(N):
p=P[i]
if p==1:
if A>=1:
A-=1
else:
ANS=i+1
break
elif p==2:
if B>=1:
B-=1
else:
ANS=i+1
break
else:
if A>=1 and B>=1:
B-=1
A-=1
else:
ANS=i+1
break
print(ANS)
titia