結果

問題 No.904 サメトロ
ユーザー recososo
提出日時 2020-02-09 16:21:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 1,412 ms
コンパイル使用メモリ 167,308 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-01 06:01:04
合計ジャッジ時間 2,604 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int n;cin >> n;
    vector<int> a(n),b(n);
    int sa=0,sb=0;
    for(int i=1;i<n;i++){
        cin >> a[i] >> b[i];
        sa+=a[i],sb+=b[i];
    }
    if(sa<sb){
        cout << sa+1 << endl;
    }
    else if(sa>sb){
        cout << sb+1 << endl;
    }
    else{
        cout << sb+1 << endl;
    }
}
0