結果

問題 No.471 直列回転機
ユーザー pekempeypekempey
提出日時 2016-12-22 16:58:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 483 ms / 3,141 ms
コード長 831 bytes
コンパイル時間 3,090 ms
コンパイル使用メモリ 170,384 KB
実行使用メモリ 24,372 KB
平均クエリ数 19589.39
最終ジャッジ日時 2023-09-02 03:51:37
合計ジャッジ時間 19,803 ms
ジャッジサーバーID
(参考情報)
judge14 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
24,252 KB
testcase_01 AC 25 ms
23,364 KB
testcase_02 AC 25 ms
23,808 KB
testcase_03 AC 26 ms
24,336 KB
testcase_04 AC 26 ms
24,024 KB
testcase_05 AC 28 ms
23,628 KB
testcase_06 AC 26 ms
23,496 KB
testcase_07 AC 27 ms
23,820 KB
testcase_08 AC 59 ms
23,832 KB
testcase_09 AC 64 ms
24,324 KB
testcase_10 AC 47 ms
23,976 KB
testcase_11 AC 196 ms
23,376 KB
testcase_12 AC 406 ms
23,820 KB
testcase_13 AC 404 ms
24,348 KB
testcase_14 AC 447 ms
23,544 KB
testcase_15 AC 416 ms
24,312 KB
testcase_16 AC 29 ms
23,520 KB
testcase_17 AC 25 ms
24,336 KB
testcase_18 AC 26 ms
24,036 KB
testcase_19 AC 27 ms
24,240 KB
testcase_20 AC 456 ms
23,820 KB
testcase_21 AC 108 ms
23,616 KB
testcase_22 AC 396 ms
23,808 KB
testcase_23 AC 400 ms
23,376 KB
testcase_24 AC 228 ms
24,336 KB
testcase_25 AC 86 ms
23,388 KB
testcase_26 AC 458 ms
23,508 KB
testcase_27 AC 225 ms
23,808 KB
testcase_28 AC 264 ms
24,372 KB
testcase_29 AC 305 ms
23,628 KB
testcase_30 AC 129 ms
24,012 KB
testcase_31 AC 450 ms
24,348 KB
testcase_32 AC 376 ms
24,024 KB
testcase_33 AC 300 ms
23,364 KB
testcase_34 AC 449 ms
23,532 KB
testcase_35 AC 111 ms
24,024 KB
testcase_36 AC 199 ms
23,412 KB
testcase_37 AC 59 ms
23,508 KB
testcase_38 AC 99 ms
23,400 KB
testcase_39 AC 150 ms
23,376 KB
testcase_40 AC 307 ms
24,000 KB
testcase_41 AC 483 ms
24,024 KB
testcase_42 AC 317 ms
23,796 KB
testcase_43 AC 431 ms
23,652 KB
testcase_44 AC 62 ms
23,640 KB
testcase_45 AC 295 ms
23,832 KB
testcase_46 AC 342 ms
23,388 KB
testcase_47 AC 430 ms
23,376 KB
testcase_48 AC 371 ms
24,348 KB
testcase_49 AC 351 ms
23,796 KB
testcase_50 AC 433 ms
24,024 KB
testcase_51 AC 172 ms
23,796 KB
testcase_52 AC 27 ms
23,616 KB
testcase_53 AC 30 ms
23,640 KB
testcase_54 AC 29 ms
23,532 KB
testcase_55 AC 125 ms
23,640 KB
testcase_56 AC 96 ms
24,348 KB
testcase_57 AC 74 ms
23,400 KB
testcase_58 AC 45 ms
23,376 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() {
	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