結果

問題 No.904 サメトロ
ユーザー ttrttr
提出日時 2020-02-03 21:51:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 348 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 11,976 KB
実行使用メモリ 14,504 KB
最終ジャッジ日時 2023-10-19 10:48:35
合計ジャッジ時間 6,470 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
10,156 KB
testcase_01 AC 34 ms
10,156 KB
testcase_02 AC 264 ms
10,156 KB
testcase_03 AC 46 ms
10,156 KB
testcase_04 AC 244 ms
10,156 KB
testcase_05 AC 30 ms
10,156 KB
testcase_06 AC 420 ms
10,156 KB
testcase_07 AC 40 ms
10,156 KB
testcase_08 AC 693 ms
10,156 KB
testcase_09 AC 29 ms
10,156 KB
testcase_10 AC 75 ms
10,156 KB
testcase_11 AC 53 ms
10,156 KB
testcase_12 AC 29 ms
10,156 KB
testcase_13 AC 36 ms
10,156 KB
testcase_14 AC 35 ms
10,156 KB
testcase_15 AC 30 ms
10,156 KB
testcase_16 AC 70 ms
10,156 KB
testcase_17 AC 29 ms
10,156 KB
testcase_18 AC 29 ms
10,156 KB
testcase_19 AC 38 ms
10,156 KB
testcase_20 AC 30 ms
10,156 KB
testcase_21 AC 45 ms
10,156 KB
testcase_22 AC 546 ms
10,156 KB
testcase_23 AC 61 ms
10,156 KB
testcase_24 AC 174 ms
10,156 KB
testcase_25 AC 29 ms
10,156 KB
testcase_26 AC 60 ms
10,156 KB
testcase_27 TLE -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = [[int(l) for l in input().split()] for _ in range(N-1)]

A = 0
B = 0
for t in L:
    A += t[0]
    B += t[1]

ans = 0
for i in range(B+1):
    j = A+i-B
    if j < 0:
        continue
    flag = True
    for t in L:
        if t[0] > B+j-t[1]:
            flag = False
            break
    if flag:
        ans += 1
print(ans)
0