結果

問題 No.471 直列回転機
ユーザー pekempey
提出日時 2016-12-22 16:59:23
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 474 ms / 3,141 ms
コード長 874 bytes
コンパイル時間 2,060 ms
コンパイル使用メモリ 171,684 KB
実行使用メモリ 25,592 KB
平均クエリ数 19589.39
最終ジャッジ日時 2024-06-11 10:34:17
合計ジャッジ時間 17,658 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 58
権限があれば一括ダウンロードができます

ソースコード

diff #

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

typedef complex<double> C;

uint64_t xorshift() {
	static uint64_t x = time(NULL);
	x ^= x << 13;
	x ^= x >> 7;
	x ^= x << 17;
	return x;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;

	vector<C> ps(n);
	for (int i = 0; i < n; i++) {
		int x, y;
		cin >> x >> y;
		ps[i] = C(x, y);
	}

	vector<C> a;
	vector<C> b;

	for (int i = 0; i < 3; i++) {
		int x = xorshift() % 20001 - 10000;
		int y = xorshift() % 20001 - 10000;
		cout << "? ";
		cout << x << " ";
		cout << y << endl;
		a.emplace_back(x, y);

		int xx, yy;
		cin >> xx >> yy;
		b.emplace_back(xx, yy);
	}

	C A = (b[1] - b[0]) / (a[1] - a[0]);
	C B = b[0] - a[0] * A;

	cout << "!" << endl;
	for (int i = 0; i < n; i++) {
		C ans = ps[i] * A + B;
		cout << (int)round(ans.real()) << " ";
		cout << (int)round(ans.imag()) << endl;
	}
}
0