結果

問題 No.904 サメトロ
ユーザー 12354865271235486527
提出日時 2019-12-19 09:12:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 419 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 12,620 KB
最終ジャッジ日時 2023-09-21 06:27:53
合計ジャッジ時間 6,864 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
12,256 KB
testcase_01 AC 21 ms
7,920 KB
testcase_02 AC 260 ms
7,828 KB
testcase_03 AC 31 ms
7,820 KB
testcase_04 AC 224 ms
7,928 KB
testcase_05 AC 15 ms
7,776 KB
testcase_06 AC 397 ms
7,868 KB
testcase_07 AC 27 ms
7,812 KB
testcase_08 AC 644 ms
7,736 KB
testcase_09 AC 16 ms
7,780 KB
testcase_10 AC 66 ms
7,736 KB
testcase_11 AC 41 ms
7,776 KB
testcase_12 AC 15 ms
7,912 KB
testcase_13 AC 23 ms
7,876 KB
testcase_14 AC 21 ms
7,732 KB
testcase_15 AC 16 ms
7,936 KB
testcase_16 AC 55 ms
7,832 KB
testcase_17 AC 15 ms
7,736 KB
testcase_18 AC 16 ms
7,852 KB
testcase_19 AC 25 ms
7,808 KB
testcase_20 AC 16 ms
7,812 KB
testcase_21 AC 29 ms
7,832 KB
testcase_22 AC 504 ms
7,964 KB
testcase_23 AC 45 ms
7,820 KB
testcase_24 AC 159 ms
7,868 KB
testcase_25 AC 16 ms
7,884 KB
testcase_26 AC 46 ms
7,812 KB
testcase_27 TLE -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ent = [0] * (N - 1)
ext = [0] * (N - 1)
sum_ent = 0
sum_ext = 0
for i in range(N-1):
    ent[i], ext[i] = map(int, input().split())
    sum_ent += ent[i]
    sum_ext += ext[i]
ans = 0
for A in range(sum_ext + 1):
    sum_A = A + sum_ent
    if sum_A - sum_ext >= 0:
        for i in range(N-1):
            if ent[i] > sum_A - ext[i]:
                break
        else:
            ans += 1
print(ans)
0