結果
| 問題 |
No.904 サメトロ
|
| コンテスト | |
| ユーザー |
leaf_1415
|
| 提出日時 | 2019-10-11 22:12:36 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 407 bytes |
| コンパイル時間 | 619 ms |
| コンパイル使用メモリ | 55,940 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-25 07:44:39 |
| 合計ジャッジ時間 | 2,064 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 WA * 13 |
ソースコード
#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;
}
if(n == 2){
cout << 1 << endl;
return 0;
}
if(a <= b) cout << b - max(b-a, 0) + 1 << endl;
else cout << a - max(a-b, 0) + 1 << endl;
return 0;
}
leaf_1415