結果

問題 No.904 サメトロ
ユーザー misora192misora192
提出日時 2020-05-05 21:45:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 1,555 ms
コンパイル使用メモリ 166,400 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-27 05:02:25
合計ジャッジ時間 2,767 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;

	ll asum = 0, bsum = 0;
	rep(i, n - 1){
		ll a, b;
		cin >> a >> b;
		asum += a;
		bsum += b;
	}

	cout << min(asum, bsum) + 1 << endl;
}
0