結果

問題 No.904 サメトロ
ユーザー htensai
提出日時 2019-11-11 09:32:12
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 349 bytes
コンパイル時間 1,971 ms
コンパイル使用メモリ 73,856 KB
実行使用メモリ 41,460 KB
最終ジャッジ日時 2024-09-15 05:10:08
合計ジャッジ時間 7,958 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int sumA = 0;
		int sumB = 0;
		for (int i = 0; i < n - 1; i++) {
		    sumA += sc.nextInt();
		    sumB += sc.nextInt();
		}
		int count = Math.min(sumA, sumB) + 1;
		System.out.println(count);
	}
}
0