結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,508 KB
testcase_01 AC 25 ms
24,168 KB
testcase_02 AC 24 ms
24,012 KB
testcase_03 AC 22 ms
23,244 KB
testcase_04 AC 25 ms
23,520 KB
testcase_05 AC 26 ms
23,904 KB
testcase_06 AC 25 ms
23,256 KB
testcase_07 AC 26 ms
23,628 KB
testcase_08 AC 49 ms
24,120 KB
testcase_09 AC 50 ms
24,000 KB
testcase_10 AC 33 ms
24,000 KB
testcase_11 AC 152 ms
23,628 KB
testcase_12 AC 289 ms
23,604 KB
testcase_13 AC 295 ms
24,180 KB
testcase_14 AC 309 ms
24,192 KB
testcase_15 AC 372 ms
23,916 KB
testcase_16 AC 26 ms
23,628 KB
testcase_17 AC 22 ms
23,412 KB
testcase_18 AC 23 ms
24,168 KB
testcase_19 AC 23 ms
23,700 KB
testcase_20 AC 327 ms
23,256 KB
testcase_21 AC 88 ms
23,244 KB
testcase_22 AC 300 ms
23,256 KB
testcase_23 AC 280 ms
24,180 KB
testcase_24 AC 169 ms
23,388 KB
testcase_25 AC 74 ms
24,012 KB
testcase_26 AC 305 ms
23,832 KB
testcase_27 AC 170 ms
23,820 KB
testcase_28 AC 197 ms
24,000 KB
testcase_29 AC 222 ms
24,000 KB
testcase_30 AC 110 ms
23,532 KB
testcase_31 AC 332 ms
23,244 KB
testcase_32 AC 272 ms
23,880 KB
testcase_33 AC 214 ms
23,604 KB
testcase_34 AC 313 ms
23,256 KB
testcase_35 AC 92 ms
23,808 KB
testcase_36 AC 145 ms
23,352 KB
testcase_37 AC 51 ms
23,820 KB
testcase_38 AC 82 ms
23,604 KB
testcase_39 AC 120 ms
24,012 KB
testcase_40 AC 235 ms
24,216 KB
testcase_41 AC 339 ms
23,364 KB
testcase_42 AC 213 ms
23,280 KB
testcase_43 AC 307 ms
23,244 KB
testcase_44 AC 59 ms
23,400 KB
testcase_45 AC 202 ms
23,232 KB
testcase_46 AC 244 ms
24,012 KB
testcase_47 AC 306 ms
24,000 KB
testcase_48 AC 258 ms
23,700 KB
testcase_49 AC 256 ms
24,000 KB
testcase_50 AC 299 ms
23,364 KB
testcase_51 AC 139 ms
24,156 KB
testcase_52 AC 26 ms
23,904 KB
testcase_53 AC 26 ms
23,412 KB
testcase_54 AC 26 ms
24,156 KB
testcase_55 AC 100 ms
23,484 KB
testcase_56 AC 84 ms
24,000 KB
testcase_57 AC 72 ms
23,268 KB
testcase_58 AC 36 ms
23,700 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()) << '\n';
	}
}
0