結果

問題 No.904 サメトロ
ユーザー 双六双六
提出日時 2020-08-28 09:08:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 406 bytes
コンパイル時間 434 ms
コンパイル使用メモリ 86,704 KB
実行使用メモリ 71,848 KB
最終ジャッジ日時 2023-08-08 18:02:07
合計ジャッジ時間 5,573 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,560 KB
testcase_01 WA -
testcase_02 AC 88 ms
71,684 KB
testcase_03 WA -
testcase_04 AC 87 ms
71,628 KB
testcase_05 AC 86 ms
71,472 KB
testcase_06 AC 86 ms
71,472 KB
testcase_07 WA -
testcase_08 AC 94 ms
71,680 KB
testcase_09 AC 91 ms
71,728 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 86 ms
71,544 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 88 ms
71,480 KB
testcase_16 WA -
testcase_17 AC 87 ms
71,672 KB
testcase_18 AC 89 ms
71,576 KB
testcase_19 WA -
testcase_20 AC 92 ms
71,624 KB
testcase_21 WA -
testcase_22 AC 89 ms
71,556 KB
testcase_23 WA -
testcase_24 AC 89 ms
71,560 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 89 ms
71,592 KB
testcase_28 AC 88 ms
71,672 KB
testcase_29 AC 85 ms
71,600 KB
testcase_30 WA -
testcase_31 AC 87 ms
71,512 KB
testcase_32 AC 89 ms
71,540 KB
testcase_33 AC 88 ms
71,544 KB
testcase_34 AC 89 ms
71,548 KB
testcase_35 AC 90 ms
71,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	A, B = 0, 0
	for i in range(N - 1):
		a, b = getlist()
		A += a; B += b

	ans = max(A, B) - abs(A - B) + 1
	print(ans)


if __name__ == '__main__':
	main()
0