結果

問題 No.178 美しいWhitespace (1)
ユーザー d_seid_sei
提出日時 2020-04-11 19:14:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,382 bytes
コンパイル時間 1,558 ms
コンパイル使用メモリ 101,880 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 10:44:44
合計ジャッジ時間 1,886 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,348 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 3 ms
4,348 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 3 ms
4,348 KB
testcase_12 AC 3 ms
4,348 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
4,348 KB
testcase_19 WA -
testcase_20 AC 2 ms
4,348 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 3 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)


int main() {
	lint N;
	cin >> N;
	vector<lint>A(N);
	vector<lint>B(N);
	rep(i, N) {
		cin >> A[i] >> B[i];
	}
	vector<lint>S(N);
	rep(i, N) {
		S[i] = A[i] + B[i] * 4;
	}
	lint odd = 0, even = 0;
	rep(i, N) {
		if (S[i] % 2) {
			odd++;
		}
		else {
			even++;
		}
	}
	if (odd == 0 || even == 0) {
		sort(S);
		rep(i, N) {
			cout << S[i] << ' ';
		}
		cout << endl;
		cout << (S[N - 1] - S[0]) / 2 << endl;
	}
	else {
		cout << -1 << endl;
	}
}
0