結果

問題 No.904 サメトロ
ユーザー roarisroaris
提出日時 2020-12-10 12:26:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 354 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 81,860 KB
実行使用メモリ 74,944 KB
最終ジャッジ日時 2023-10-20 00:16:33
合計ジャッジ時間 3,323 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
59,668 KB
testcase_01 AC 51 ms
59,696 KB
testcase_02 AC 58 ms
61,720 KB
testcase_03 AC 46 ms
61,876 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 47 ms
61,948 KB
testcase_08 WA -
testcase_09 AC 38 ms
53,352 KB
testcase_10 AC 47 ms
61,876 KB
testcase_11 AC 49 ms
61,948 KB
testcase_12 WA -
testcase_13 AC 48 ms
61,948 KB
testcase_14 AC 46 ms
59,692 KB
testcase_15 WA -
testcase_16 AC 49 ms
61,948 KB
testcase_17 WA -
testcase_18 AC 38 ms
53,352 KB
testcase_19 AC 48 ms
61,948 KB
testcase_20 AC 37 ms
53,352 KB
testcase_21 AC 46 ms
61,944 KB
testcase_22 AC 52 ms
63,768 KB
testcase_23 AC 46 ms
61,876 KB
testcase_24 AC 52 ms
61,720 KB
testcase_25 AC 38 ms
53,352 KB
testcase_26 AC 47 ms
61,876 KB
testcase_27 AC 87 ms
74,944 KB
testcase_28 AC 38 ms
53,352 KB
testcase_29 AC 38 ms
53,352 KB
testcase_30 AC 37 ms
53,352 KB
testcase_31 WA -
testcase_32 AC 37 ms
53,352 KB
testcase_33 AC 38 ms
53,352 KB
testcase_34 AC 37 ms
53,352 KB
testcase_35 AC 44 ms
59,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N = int(input())
A, B = [], []

for _ in range(N-1):
    Ai, Bi = map(int, input().split())
    A.append(Ai)
    B.append(Bi)

ans = 0
SA, SB = sum(A), sum(B)

for A1 in range(SB+1):
    B1 = SA+A1-SB
    
    for i in range(N-1):
        if A[i]>B1+SB-B[i]:
            break
    else:
        ans += 1

print(ans)
0