結果
| 問題 |
No.178 美しいWhitespace (1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-27 18:15:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 338 bytes |
| コンパイル時間 | 1,623 ms |
| コンパイル使用メモリ | 168,532 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 18:37:56 |
| 合計ジャッジ時間 | 2,503 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 5 WA * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int main(){
int n; cin>>n;
int a,b; int mx=0;
vector<int> v;
rep(i,n){
cin>>a>>b;
mx=max(mx,(a+b*4));
v.push_back(a+b*4);
}
int ans=0;
for(int i=0; i<n; i++){
ans+=mx-v[i];
}
if(ans%2==0) cout<<ans/2<<endl;
else cout<<"-1"<<endl;
}