結果

問題 No.904 サメトロ
ユーザー toyuzukotoyuzuko
提出日時 2020-04-08 21:45:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 1,000 ms
コード長 316 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 76,768 KB
最終ジャッジ日時 2023-09-26 11:04:00
合計ジャッジ時間 4,730 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
76,352 KB
testcase_01 AC 78 ms
76,512 KB
testcase_02 AC 89 ms
76,176 KB
testcase_03 AC 81 ms
76,212 KB
testcase_04 AC 79 ms
76,332 KB
testcase_05 AC 72 ms
71,424 KB
testcase_06 AC 85 ms
76,408 KB
testcase_07 AC 80 ms
76,444 KB
testcase_08 AC 91 ms
76,328 KB
testcase_09 AC 69 ms
71,420 KB
testcase_10 AC 78 ms
76,476 KB
testcase_11 AC 78 ms
76,628 KB
testcase_12 AC 73 ms
75,860 KB
testcase_13 AC 78 ms
76,244 KB
testcase_14 AC 77 ms
76,416 KB
testcase_15 AC 73 ms
75,692 KB
testcase_16 AC 81 ms
76,508 KB
testcase_17 AC 70 ms
71,584 KB
testcase_18 AC 72 ms
71,340 KB
testcase_19 AC 78 ms
76,260 KB
testcase_20 AC 70 ms
71,368 KB
testcase_21 AC 78 ms
76,420 KB
testcase_22 AC 89 ms
76,084 KB
testcase_23 AC 79 ms
76,200 KB
testcase_24 AC 84 ms
76,056 KB
testcase_25 AC 72 ms
71,616 KB
testcase_26 AC 78 ms
76,208 KB
testcase_27 AC 131 ms
76,768 KB
testcase_28 AC 72 ms
71,344 KB
testcase_29 AC 71 ms
71,416 KB
testcase_30 AC 69 ms
71,336 KB
testcase_31 AC 69 ms
71,336 KB
testcase_32 AC 70 ms
71,488 KB
testcase_33 AC 71 ms
71,652 KB
testcase_34 AC 73 ms
71,356 KB
testcase_35 AC 78 ms
76,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = []
B = []
for _ in range(N - 1):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
S = sum(A)
T = sum(B)
res = 0
for i in range(min(S, T) + 1):
    p = max(S, T) + i
    for j in range(N - 1):
        if A[j] + B[j] > p:
            break
    else:
        res += 1
print(res)
0