結果
| 問題 | No.178 美しいWhitespace (1) |
| コンテスト | |
| ユーザー |
kongarishisyamo
|
| 提出日時 | 2016-02-28 04:36:25 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 867µs | |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 269 ms |
| コンパイル使用メモリ | 71,648 KB |
| 実行使用メモリ | 9,744 KB |
| 最終ジャッジ日時 | 2026-09-03 05:56:42 |
| 合計ジャッジ時間 | 2,077 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
#include<iostream>
using namespace std;
#define NMAX 1000
int main(){
long long N;
long long a[NMAX],b[NMAX];
long long spacemax=-1;
long long ans=0;
cin>>N;
for(long long i=0;i<N;i++){
cin>>a[i]>>b[i];
if(a[i]+b[i]*4>spacemax) spacemax=a[i]+b[i]*4;
}
for(long long i=0;i<N;i++){
if((spacemax-(a[i]+b[i]*4))%2==1){
cout<<"-1"<<endl;
return 0;
}
else ans+=(spacemax-(a[i]+b[i]*4))/2;
}
cout<<ans<<endl;
}
kongarishisyamo