結果

問題 No.904 サメトロ
ユーザー leaf_1415
提出日時 2019-10-11 21:37:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 55,892 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-25 06:57:56
合計ジャッジ時間 1,485 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#define llint long long

using namespace std;

int n;
int a, b;

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	int x, y;
	for(int i = 2; i <= n; i++){
		cin >> x >> y;
		a += x, b += y;
	}
	cout << b - max(b-a, 0) + 1 << endl;
	
	return 0;
}
0