結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-08-05 17:12:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 498 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 104,448 KB
最終ジャッジ日時 2024-04-23 14:08:36
合計ジャッジ時間 3,101 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
55,552 KB
testcase_01 AC 48 ms
55,808 KB
testcase_02 AC 46 ms
55,168 KB
testcase_03 AC 73 ms
83,968 KB
testcase_04 AC 77 ms
88,320 KB
testcase_05 AC 58 ms
70,124 KB
testcase_06 AC 73 ms
82,688 KB
testcase_07 AC 95 ms
104,192 KB
testcase_08 AC 67 ms
79,616 KB
testcase_09 AC 55 ms
65,280 KB
testcase_10 AC 64 ms
76,032 KB
testcase_11 AC 103 ms
103,680 KB
testcase_12 AC 92 ms
104,448 KB
testcase_13 AC 54 ms
63,616 KB
testcase_14 AC 51 ms
62,208 KB
testcase_15 AC 51 ms
62,080 KB
testcase_16 AC 52 ms
62,080 KB
testcase_17 AC 50 ms
62,592 KB
testcase_18 AC 51 ms
62,464 KB
testcase_19 AC 49 ms
61,568 KB
testcase_20 AC 50 ms
61,696 KB
testcase_21 AC 49 ms
61,440 KB
testcase_22 AC 53 ms
63,232 KB
testcase_23 AC 54 ms
62,976 KB
testcase_24 AC 50 ms
62,720 KB
testcase_25 AC 50 ms
62,208 KB
testcase_26 AC 50 ms
62,080 KB
testcase_27 AC 50 ms
61,312 KB
testcase_28 AC 50 ms
61,824 KB
testcase_29 AC 49 ms
61,824 KB
testcase_30 AC 48 ms
61,184 KB
testcase_31 AC 53 ms
63,104 KB
testcase_32 AC 49 ms
61,184 KB
権限があれば一括ダウンロードができます

ソースコード

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