結果

問題 No.904 サメトロ
ユーザー kawacchu
提出日時 2019-10-11 21:36:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 210 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-25 06:56:34
合計ジャッジ時間 1,911 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
AB = [list(map(int,input().split())) for i in range(N-1)]

s = 0
t = 0
for i in range(N-1) :
    s += AB[i][1]
    t += AB[i][0]

u = t-s

if u < 0 :
    print(s + u + 1)
else :
    print(s+1)
0