結果

問題 No.471 直列回転機
ユーザー antaanta
提出日時 2016-12-21 00:25:03
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 339 ms / 3,141 ms
コード長 1,325 bytes
コンパイル時間 1,684 ms
コンパイル使用メモリ 166,796 KB
実行使用メモリ 24,432 KB
平均クエリ数 19589.39
最終ジャッジ日時 2023-09-02 03:39:07
合計ジャッジ時間 13,806 ms
ジャッジサーバーID
(参考情報)
judge16 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
23,700 KB
testcase_01 AC 27 ms
23,868 KB
testcase_02 AC 26 ms
23,856 KB
testcase_03 AC 25 ms
24,384 KB
testcase_04 AC 25 ms
23,976 KB
testcase_05 AC 27 ms
24,288 KB
testcase_06 AC 26 ms
23,880 KB
testcase_07 AC 26 ms
23,664 KB
testcase_08 AC 48 ms
24,168 KB
testcase_09 AC 48 ms
23,520 KB
testcase_10 AC 34 ms
23,808 KB
testcase_11 AC 145 ms
23,700 KB
testcase_12 AC 272 ms
24,384 KB
testcase_13 AC 275 ms
23,892 KB
testcase_14 AC 301 ms
23,520 KB
testcase_15 AC 339 ms
23,436 KB
testcase_16 AC 27 ms
23,424 KB
testcase_17 AC 26 ms
23,796 KB
testcase_18 AC 24 ms
24,012 KB
testcase_19 AC 25 ms
23,808 KB
testcase_20 AC 309 ms
23,628 KB
testcase_21 AC 90 ms
23,520 KB
testcase_22 AC 279 ms
23,700 KB
testcase_23 AC 252 ms
24,000 KB
testcase_24 AC 163 ms
24,432 KB
testcase_25 AC 72 ms
24,288 KB
testcase_26 AC 313 ms
23,352 KB
testcase_27 AC 158 ms
23,616 KB
testcase_28 AC 190 ms
24,300 KB
testcase_29 AC 211 ms
23,364 KB
testcase_30 AC 101 ms
23,520 KB
testcase_31 AC 306 ms
24,288 KB
testcase_32 AC 261 ms
23,496 KB
testcase_33 AC 203 ms
23,388 KB
testcase_34 AC 287 ms
23,712 KB
testcase_35 AC 90 ms
23,568 KB
testcase_36 AC 140 ms
24,252 KB
testcase_37 AC 44 ms
24,072 KB
testcase_38 AC 80 ms
23,988 KB
testcase_39 AC 117 ms
23,868 KB
testcase_40 AC 217 ms
24,300 KB
testcase_41 AC 300 ms
23,616 KB
testcase_42 AC 217 ms
23,508 KB
testcase_43 AC 280 ms
23,508 KB
testcase_44 AC 57 ms
24,276 KB
testcase_45 AC 199 ms
23,400 KB
testcase_46 AC 230 ms
23,496 KB
testcase_47 AC 276 ms
23,364 KB
testcase_48 AC 242 ms
23,388 KB
testcase_49 AC 241 ms
24,264 KB
testcase_50 AC 281 ms
23,988 KB
testcase_51 AC 123 ms
24,084 KB
testcase_52 AC 27 ms
23,508 KB
testcase_53 AC 29 ms
23,352 KB
testcase_54 AC 28 ms
23,496 KB
testcase_55 AC 99 ms
23,460 KB
testcase_56 AC 95 ms
23,664 KB
testcase_57 AC 83 ms
23,424 KB
testcase_58 AC 37 ms
23,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if (x < y) x = y; }

int main() {
	int M;
	while (~scanf("%d", &M)) {
		vector<int> xs(M);
		vector<int> ys(M);
		for (int i = 0; i < M; ++i)
			scanf("%d%d", &xs[i], &ys[i]);
		auto query = [](int x, int y) {
			printf("? %d %d\n", x, y);
			fflush(stdout);
			int a; int b;
			scanf("%d%d", &a, &b);
			return make_pair(a, b);
		};
		auto zero = query(0, 0);
		auto x1 = query(1, 0);
		auto y1 = query(0, 1);
		int addx = zero.first, addy = zero.second;
		int xtox = x1.first - addx, xtoy = x1.second - addy;
		int ytox = y1.first - addx, ytoy = y1.second - addy;
		puts("!");
		rep(i, M) {
			int x = xs[i] * xtox + ys[i] * ytox + addx;
			int y = xs[i] * xtoy + ys[i] * ytoy + addy;
			printf("%d %d\n", x, y);
		}
		fflush(stdout);
		break;
	}
	return 0;
}
0