結果
| 問題 |
No.2401 Dirty Shoes and Stairs
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-04 21:32:34 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 128 ms / 2,000 ms |
| コード長 | 399 bytes |
| コンパイル時間 | 92 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 14,748 KB |
| 最終ジャッジ日時 | 2024-10-14 19:30:48 |
| 合計ジャッジ時間 | 2,692 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
from collections import defaultdict, deque
from sys import stdin
readline = stdin.readline
def li():
return list(map(int, readline().split()))
N = int(input())
M1 = int(input())
A = li()
M2 = int(input())
B = li()
ans = [1] * (N + 1)
ans[0] = 0
ans[N] = 0
# のぼり
pos = 0
for a in A:
pos += a
ans[pos] = 0
# くだり
for b in B:
pos -= b
ans[pos] = 0
print(sum(ans))