結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー FromBooska
提出日時 2023-08-05 10:44:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 117,132 KB
最終ジャッジ日時 2024-10-15 07:55:44
合計ジャッジ時間 3,005 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
M1 = int(input())
A = list(map(int, input().split()))
M2 = int(input())
B = list(map(int, input().split()))
stairs = [1]*(N+1)
stairs[0] = 0
stairs[N] = 0
current = 0
for i in range(M1):
    current += A[i]
    stairs[current] = 0
current = N
for i in range(M2):
    current -= B[i]
    stairs[current] = 0
    
#print(stairs)

ans = sum(stairs)
print(ans)
0