結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー mattu34mattu34
提出日時 2023-09-08 00:41:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 548 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 120,612 KB
最終ジャッジ日時 2023-09-08 00:41:27
合計ジャッジ時間 6,540 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,716 KB
testcase_01 AC 88 ms
71,792 KB
testcase_02 AC 90 ms
71,800 KB
testcase_03 AC 144 ms
91,036 KB
testcase_04 AC 114 ms
93,904 KB
testcase_05 AC 97 ms
80,640 KB
testcase_06 AC 110 ms
90,716 KB
testcase_07 AC 127 ms
106,884 KB
testcase_08 AC 109 ms
86,368 KB
testcase_09 AC 96 ms
77,284 KB
testcase_10 AC 103 ms
84,096 KB
testcase_11 AC 155 ms
120,612 KB
testcase_12 AC 130 ms
110,796 KB
testcase_13 AC 97 ms
79,812 KB
testcase_14 AC 91 ms
73,956 KB
testcase_15 AC 93 ms
74,004 KB
testcase_16 AC 94 ms
77,756 KB
testcase_17 AC 96 ms
78,872 KB
testcase_18 AC 90 ms
74,568 KB
testcase_19 AC 90 ms
74,064 KB
testcase_20 AC 95 ms
77,396 KB
testcase_21 AC 92 ms
72,632 KB
testcase_22 AC 94 ms
78,940 KB
testcase_23 AC 93 ms
79,632 KB
testcase_24 AC 93 ms
77,980 KB
testcase_25 AC 94 ms
78,212 KB
testcase_26 AC 92 ms
76,880 KB
testcase_27 AC 88 ms
72,964 KB
testcase_28 AC 89 ms
74,576 KB
testcase_29 AC 90 ms
73,516 KB
testcase_30 AC 89 ms
72,796 KB
testcase_31 AC 95 ms
79,800 KB
testcase_32 AC 107 ms
72,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
import heapq
import bisect
import itertools


INF = float("inf")
MOD = 998244353
mod = 998244353

N = int(input())
now = 0
dirty = [0] * (N + 1)
M = int(input())
A = list(map(int, input().split()))
for a in A:
    now += a
    dirty[now] = 1

now = N
M = int(input())
A = list(map(int, input().split()))
for a in A:
    now -= a
    dirty[now] = 1

print(dirty[1:].count(0))
0