結果
| 問題 | No.178 美しいWhitespace (1) |
| コンテスト | |
| ユーザー |
goodbaton
|
| 提出日時 | 2015-04-08 22:04:07 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 616 bytes |
| 記録 | |
| コンパイル時間 | 485 ms |
| コンパイル使用メモリ | 93,336 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-25 21:18:43 |
| 合計ジャッジ時間 | 1,258 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 7 WA * 14 |
ソースコード
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
using namespace std;
int main(){
int n,S[1000],a,b,maxS=0,ans=0;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d%d",&a,&b);
S[i]=a+4*b;
maxS=max(maxS,S[i]);
}
for(int i=0;i<n;i++){
if((maxS-S[i])%2){
puts("-1");
return 0;
}
ans+=(maxS-S[i])/2;
}
printf("%d\n",ans);
return 0;
}
goodbaton