結果

問題 No.471 直列回転機
ユーザー pekempeypekempey
提出日時 2016-12-22 16:59:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 481 ms / 3,141 ms
コード長 874 bytes
コンパイル時間 2,050 ms
コンパイル使用メモリ 170,544 KB
実行使用メモリ 24,336 KB
平均クエリ数 19589.39
最終ジャッジ日時 2023-09-02 03:52:16
合計ジャッジ時間 17,869 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
23,508 KB
testcase_01 AC 26 ms
23,412 KB
testcase_02 AC 26 ms
23,544 KB
testcase_03 AC 25 ms
23,664 KB
testcase_04 AC 27 ms
23,544 KB
testcase_05 AC 28 ms
23,412 KB
testcase_06 AC 26 ms
23,844 KB
testcase_07 AC 27 ms
24,240 KB
testcase_08 AC 67 ms
24,324 KB
testcase_09 AC 66 ms
23,988 KB
testcase_10 AC 45 ms
23,364 KB
testcase_11 AC 203 ms
23,376 KB
testcase_12 AC 390 ms
24,312 KB
testcase_13 AC 395 ms
24,312 KB
testcase_14 AC 426 ms
23,376 KB
testcase_15 AC 481 ms
24,036 KB
testcase_16 AC 28 ms
24,324 KB
testcase_17 AC 26 ms
23,364 KB
testcase_18 AC 27 ms
23,532 KB
testcase_19 AC 26 ms
23,640 KB
testcase_20 AC 462 ms
23,400 KB
testcase_21 AC 104 ms
23,376 KB
testcase_22 AC 404 ms
24,312 KB
testcase_23 AC 385 ms
23,376 KB
testcase_24 AC 238 ms
23,508 KB
testcase_25 AC 94 ms
23,616 KB
testcase_26 AC 451 ms
23,388 KB
testcase_27 AC 211 ms
23,628 KB
testcase_28 AC 269 ms
23,628 KB
testcase_29 AC 298 ms
24,216 KB
testcase_30 AC 128 ms
23,652 KB
testcase_31 AC 444 ms
24,036 KB
testcase_32 AC 378 ms
23,532 KB
testcase_33 AC 289 ms
23,988 KB
testcase_34 AC 444 ms
24,000 KB
testcase_35 AC 111 ms
24,000 KB
testcase_36 AC 179 ms
24,336 KB
testcase_37 AC 60 ms
23,364 KB
testcase_38 AC 95 ms
23,520 KB
testcase_39 AC 158 ms
24,312 KB
testcase_40 AC 321 ms
23,400 KB
testcase_41 AC 459 ms
23,628 KB
testcase_42 AC 294 ms
23,532 KB
testcase_43 AC 415 ms
24,000 KB
testcase_44 AC 64 ms
24,312 KB
testcase_45 AC 273 ms
23,640 KB
testcase_46 AC 320 ms
23,664 KB
testcase_47 AC 434 ms
23,364 KB
testcase_48 AC 353 ms
24,024 KB
testcase_49 AC 352 ms
23,520 KB
testcase_50 AC 419 ms
23,640 KB
testcase_51 AC 176 ms
23,616 KB
testcase_52 AC 28 ms
24,048 KB
testcase_53 AC 30 ms
23,400 KB
testcase_54 AC 28 ms
23,388 KB
testcase_55 AC 119 ms
24,012 KB
testcase_56 AC 94 ms
24,264 KB
testcase_57 AC 76 ms
23,412 KB
testcase_58 AC 46 ms
23,364 KB
権限があれば一括ダウンロードができます

ソースコード

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