結果

問題 No.2401 Dirty Shoes and Stairs
コンテスト
ユーザー bug maker / ばぐめいかー@Python学習者
提出日時 2023-08-04 22:43:44
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 432 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 606 ms
コンパイル使用メモリ 20,824 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2026-05-02 05:54:14
合計ジャッジ時間 4,699 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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