結果
| 問題 |
No.2401 Dirty Shoes and Stairs
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-06 17:17:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 118 ms / 2,000 ms |
| コード長 | 379 bytes |
| コンパイル時間 | 269 ms |
| コンパイル使用メモリ | 82,216 KB |
| 実行使用メモリ | 135,772 KB |
| 最終ジャッジ日時 | 2024-07-26 15:31:10 |
| 合計ジャッジ時間 | 3,485 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
N = int(input())
M1 = int(input())
Am = list(map(int, input().split()))
M2 = int(input())
Bm = list(map(int, input().split()))
ts = set([i for i in range(N+1)])
last = 0
for m in range(M1):
t = last + Am[m]
last = t
if t in ts:
ts.remove(t)
last = N
for m in range(M2):
t = last - Bm[m]
last = t
if t in ts:
ts.remove(t)
print(len(ts))