結果

問題 No.904 サメトロ
ユーザー kuhaku
提出日時 2019-10-11 21:25:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 393 bytes
コンパイル時間 1,352 ms
コンパイル使用メモリ 165,836 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-25 06:37:24
合計ジャッジ時間 2,195 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

typedef long long ll;

int main(void){
	int n;
	cin >> n;

	int sum[2] = {};
	REP(i, n-1){
		int a, b;
		cin >> a >> b;
		sum[0] += a;
		sum[1] += b;
	}

	cout << MIN(sum[0], sum[1])+1 << endl;

	return 0;
}
0