結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー sugim48sugim48
提出日時 2014-11-03 00:46:00
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,239 bytes
コンパイル時間 682 ms
コンパイル使用メモリ 82,452 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-26 22:03:52
合計ジャッジ時間 1,534 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cstring>
#include <climits>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; double w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
ll MOD2 = 1LL << 32;
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};

void rotate(vector<ll>& a) {
	ll tmp = a[0];
	a[0] = a[1];
	a[1] = a[2];
	a[2] = tmp;
}

int main() {
	vector<ll> X(3), Y(3);
	for (int i = 0; i < 3; i++) cin >> X[i] >> Y[i];
	for (int k = 0; k < 3; k++) {
		rotate(X); rotate(Y);
		ll x1 = X[1] - X[0], y1 = Y[1] - Y[0];
		ll x2 = X[2] - X[0], y2 = Y[2] - Y[0];
		if (x1 * x1 + y1 * y1 != x2 * x2 + y2 * y2) continue;
		if (x1 * x2 + y1 * y2 != 0) continue;
		cout << X[0] + x1 + x2 << ' ' << Y[0] + y1 + y2 << endl;
		return 0;
	}
	cout << -1 << endl;
}
0