結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー bug maker / ばぐめいかー@Python学習者bug maker / ばぐめいかー@Python学習者
提出日時 2023-08-04 22:43:44
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-14 20:46:50
合計ジャッジ時間 2,299 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def main():
    N = int(input())
    M1 = int(input())
    A = list(map(int, input().split()))
    M2 = int(input())
    B = list(map(int, input().split()))
    
    At = [0] * (M1 + 1)
    for i in range(M1):
        At[i+1] = At[i] + A[i]
        
    Bt = [N] * (M2 + 1)
    for i in range(M2):
        Bt[i+1] = Bt[i] - B[i]
    
    ans = (N + 1) - len(set(At) | set(Bt))

    print(ans)
0