結果
| 問題 |
No.178 美しいWhitespace (1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-06 22:46:05 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 828 bytes |
| コンパイル時間 | 626 ms |
| コンパイル使用メモリ | 91,340 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-04 03:28:21 |
| 合計ジャッジ時間 | 1,473 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 7 WA * 14 |
ソースコード
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> len(n);
for(int i=0; i<n; ++i){
int a, b;
cin >> a >> b;
len[i] = a + 4 * b;
}
int maxLen = *max_element(len.begin(), len.end());
int ans = 0;
for(int i=0; i<n; ++i){
if((maxLen - len[i]) % 2 != 0){
ans = -1;
break;
}
ans += (maxLen - len[i]) / 2;
}
cout << ans << endl;
return 0;
}