結果

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

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

int main() {
	int N;
	cin >> N;
	int lmax = 0;
	int lmin = 99999999;
	for (int i = 0; i < N; i++)
	{
		int a, b;
		cin >> a >> b;
		int len = a + b * 4;
		if (i != 0){
			if (lmax % 2 != len % 2){
				cout << -1 << endl;
				return 0;
			}
		}
		lmax = max(len, lmax);
		lmin = min(len, lmin);
	}
	cout << (lmax - lmin) / 2 << endl;
}
0