結果
| 問題 |
No.904 サメトロ
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2019-10-11 21:37:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 340 bytes |
| コンパイル時間 | 473 ms |
| コンパイル使用メモリ | 69,060 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-25 06:58:13 |
| 合計ジャッジ時間 | 1,328 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 14 |
ソースコード
#include <iostream>
#include <cmath>
using namespace std;
typedef pair<int,int> Paint;
int main(){
int n;cin>>n;
Paint a[n];
int sa = 0;
int sma = 0;
int smb = 0;
for(int i = 0; n-1 > i; i++){
int te,mp;cin>>te>>mp;
sa += te-mp;
sma += te;
smb+=mp;
a[i] = {te,mp};
}
cout << min(sma,smb)+1 << endl;
}