結果
| 問題 | 
                            No.178 美しいWhitespace (1)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             ytft
                         | 
                    
| 提出日時 | 2021-03-18 14:56:56 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 420 bytes | 
| コンパイル時間 | 1,789 ms | 
| コンパイル使用メモリ | 165,580 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-16 16:51:51 | 
| 合計ジャッジ時間 | 2,716 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 7 WA * 14 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    long initial;
    long a,b;
    long m=INT_MAX;
    long s=0;
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>a>>b;
        if(i==0){
            initial=(a+b*4);
        }
        m=min(m,a+b*4);
        s+=a+b*4;
        if((a+b*4)%2!=initial%2){
            cout<<-1<<endl;
            return 0;
        }
    }
    cout<<(s-m*N)/2<<endl;
}
            
            
            
        
            
ytft