結果

問題 No.904 サメトロ
ユーザー mtrh
提出日時 2022-02-12 22:07:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 352 bytes
コンパイル時間 1,632 ms
コンパイル使用メモリ 165,124 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-29 01:16:58
合計ジャッジ時間 2,771 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

using ll=long long;

int main(){
    int N;
    cin>>N;
    int sumA=0,sumB=0;
    for(int i=0;i<N-1;i++){
        int A,B;
        cin>>A>>B;
        sumA+=A,sumB+=B;
    }
    if(sumA>=sumB){
        cout<<sumA-(sumA-sumB)+1<<endl;
    }else{
        cout<<sumB-(sumB-sumA)+1<<endl;
    }
    return 0;
}
0