結果
問題 |
No.178 美しいWhitespace (1)
|
ユーザー |
|
提出日時 | 2020-06-27 18:17:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 359 bytes |
コンパイル時間 | 1,493 ms |
コンパイル使用メモリ | 169,528 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-05 18:40:58 |
合計ジャッジ時間 | 2,453 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 WA * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) typedef long long ll; 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); } ll 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; }