結果

問題 No.178 美しいWhitespace (1)
ユーザー focusfocus
提出日時 2018-02-21 02:24:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 474 bytes
コンパイル時間 528 ms
コンパイル使用メモリ 68,268 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 20:31:29
合計ジャッジ時間 1,614 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,356 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 3 ms
4,352 KB
testcase_07 WA -
testcase_08 AC 3 ms
4,348 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 2 ms
4,356 KB
testcase_15 AC 2 ms
4,356 KB
testcase_16 AC 2 ms
4,356 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 WA -
testcase_19 AC 2 ms
4,348 KB
testcase_20 WA -
testcase_21 AC 2 ms
4,356 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 3 ms
4,352 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstdio>
using namespace std;
int main(){
    long long N,a,b,i,sum[1000],m=0,ans=0;
    bool flag = false;
    cin >> N;
    for(i=0;i<N;i++){
        cin >> a >> b;
        sum[i] = a + b*4;
        m = max(m,sum[i]);
    }
    for(i=0;i<N;i++){
        ans += (m-sum[i]);
        if((m-sum[i])%2==0) flag = true;
    }
    if(flag)    cout << ans/2;
    else    cout << ans;
    return 0;
}
0