結果

問題 No.178 美しいWhitespace (1)
ユーザー wing3196
提出日時 2015-04-05 23:27:44
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 528 ms
コンパイル使用メモリ 78,408 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-04 02:10:12
合計ジャッジ時間 1,275 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
using namespace std;
typedef long long ll;

int main(){
	int N;
	cin>>N;
	int size[1000], ma = 0;
	for(int i=0;i<N;i++){
		int A,B;
		cin>>A>>B;
		ma = max(ma,size[i] = A+B*4);
	}
	int ans = 0;
	for(int i=0;i<N;i++){
		if((ma-size[i])&1!=0){
			ans = -1; break;
		}
		ans += (ma-size[i])/2;
	}
	printf("%d\n",ans);
	return 0;
}
0