結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー irohasu19_irohasu19_
提出日時 2023-08-04 22:26:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 39,012 KB
最終ジャッジ日時 2024-04-22 20:42:51
合計ジャッジ時間 3,526 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,752 KB
testcase_01 AC 25 ms
10,624 KB
testcase_02 AC 24 ms
10,624 KB
testcase_03 AC 83 ms
24,740 KB
testcase_04 AC 100 ms
25,996 KB
testcase_05 AC 45 ms
16,240 KB
testcase_06 AC 83 ms
32,932 KB
testcase_07 AC 137 ms
29,780 KB
testcase_08 AC 73 ms
23,384 KB
testcase_09 AC 31 ms
12,160 KB
testcase_10 AC 61 ms
17,588 KB
testcase_11 AC 161 ms
34,276 KB
testcase_12 AC 131 ms
39,012 KB
testcase_13 AC 48 ms
28,040 KB
testcase_14 AC 43 ms
28,056 KB
testcase_15 AC 41 ms
19,564 KB
testcase_16 AC 34 ms
14,532 KB
testcase_17 AC 39 ms
19,424 KB
testcase_18 AC 45 ms
27,872 KB
testcase_19 AC 40 ms
19,448 KB
testcase_20 AC 31 ms
13,696 KB
testcase_21 AC 32 ms
14,640 KB
testcase_22 AC 38 ms
19,300 KB
testcase_23 AC 48 ms
27,940 KB
testcase_24 AC 34 ms
14,796 KB
testcase_25 AC 36 ms
19,136 KB
testcase_26 AC 28 ms
11,904 KB
testcase_27 AC 37 ms
19,316 KB
testcase_28 AC 47 ms
27,912 KB
testcase_29 AC 37 ms
19,120 KB
testcase_30 AC 32 ms
15,024 KB
testcase_31 AC 48 ms
27,964 KB
testcase_32 AC 31 ms
14,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n = int(input())
m_1 = int(input())
A = list(map(int, input().split()))
m_2 = int(input())
B = list(map(int, input().split()))

A_ = list(itertools.accumulate(A))
B_ = []

tmp = n
for x in B:
  tmp -= x
  B_.append(tmp)

# print(A_)
# print(B_)

  

  

num_set = set(range(n + 1))
for xx in A_:
  num_set.discard(xx)

for yy in B_:
  num_set.discard(yy)

print(len(num_set))

0