結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー flygonflygon
提出日時 2023-08-04 21:23:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 500 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 118,816 KB
最終ジャッジ日時 2024-04-22 19:41:28
合計ジャッジ時間 2,959 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
54,144 KB
testcase_01 AC 43 ms
54,656 KB
testcase_02 AC 48 ms
54,272 KB
testcase_03 AC 77 ms
95,616 KB
testcase_04 AC 84 ms
102,916 KB
testcase_05 AC 59 ms
73,808 KB
testcase_06 AC 76 ms
94,208 KB
testcase_07 AC 93 ms
103,012 KB
testcase_08 AC 70 ms
88,372 KB
testcase_09 AC 51 ms
65,152 KB
testcase_10 AC 63 ms
82,688 KB
testcase_11 AC 109 ms
118,816 KB
testcase_12 AC 98 ms
105,752 KB
testcase_13 AC 47 ms
61,240 KB
testcase_14 AC 44 ms
54,528 KB
testcase_15 AC 44 ms
54,656 KB
testcase_16 AC 46 ms
60,800 KB
testcase_17 AC 47 ms
60,368 KB
testcase_18 AC 45 ms
54,912 KB
testcase_19 AC 43 ms
55,168 KB
testcase_20 AC 48 ms
60,928 KB
testcase_21 AC 43 ms
55,168 KB
testcase_22 AC 52 ms
60,928 KB
testcase_23 AC 47 ms
60,672 KB
testcase_24 AC 46 ms
60,800 KB
testcase_25 AC 47 ms
60,416 KB
testcase_26 AC 47 ms
60,800 KB
testcase_27 AC 42 ms
54,656 KB
testcase_28 AC 44 ms
54,144 KB
testcase_29 AC 43 ms
54,904 KB
testcase_30 AC 44 ms
54,564 KB
testcase_31 AC 47 ms
60,800 KB
testcase_32 AC 43 ms
54,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n = int(input())
m1 = int(input())
a = list(map(int,input().split()))
m2= int(input())
b = list(map(int,input().split()))
now = 0
dirty = set()
for i in range(m1):
    now += a[i]
    dirty.add(now)

for i in range(m2):
    now -= b[i]
    dirty.add(now)
print(n+1-len(dirty))
0