結果
| 問題 |
No.178 美しいWhitespace (1)
|
| コンテスト | |
| ユーザー |
hamray
|
| 提出日時 | 2017-12-01 16:38:05 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 628 bytes |
| コンパイル時間 | 653 ms |
| コンパイル使用メモリ | 76,288 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-27 21:29:18 |
| 合計ジャッジ時間 | 1,514 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 15 WA * 6 |
ソースコード
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<set>
#include<iomanip>
#include<algorithm>
using namespace std;
int main() {
long long N; cin >> N;
long long a, b;
vector<long long> v;
long long maxV = 0;
for(int i=0; i<N; i++){
cin >> a >> b;
v.push_back(a + b * 4);
maxV = max(maxV, v[i]);
}
long long ans = 0;
bool f = true;
if(maxV < 2){
f = false;
}else{
for(int i=0; i<N; i++){
ans += (maxV - v[i]) / 2;
}
}
if(f) cout << ans << endl;
else cout << -1 << endl;
return 0;
}
hamray