結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー Navier_Boltzmann
提出日時 2023-08-05 17:12:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 498 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 104,320 KB
最終ジャッジ日時 2024-10-15 14:15:59
合計ジャッジ時間 3,666 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

# import pypyjit
# pypyjit.set_param('max_unroll_recursion=-1')
from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
# input = sys.stdin.readline

N = int(input())
M1 = int(input())
A = list(map(int,input().split()))
M2 = int(input())
B = list(map(int,input().split()))

dp = [False]*(N+1)
dp[0]=True
dp[N] = True
now = 0
for a in A:
    now += a
    dp[now] = True
    
now = N
for b in B:
    now -= b
    dp[now] = True
print(N+1-sum(dp))
0