結果

問題 No.471 直列回転機
ユーザー anta
提出日時 2016-12-21 00:25:03
言語 C++14
(gcc 8.2.0)
結果
AC  
実行時間 204 ms
コード長 1,325 Byte
コンパイル時間 1,438 ms
使用メモリ 12,120 KB
平均クエリ数 19636.40
最終ジャッジ日時 2019-05-07 01:02:46

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
0_sample_0.txt AC 15 ms
12,120 KB
1_small_0.txt AC 15 ms
12,108 KB
1_small_1.txt AC 16 ms
12,108 KB
1_small_2.txt AC 15 ms
12,096 KB
1_small_3.txt AC 16 ms
12,096 KB
2_med_0.txt AC 16 ms
12,108 KB
2_med_1.txt AC 16 ms
12,096 KB
2_med_2.txt AC 15 ms
12,108 KB
3_large_0.txt AC 33 ms
12,108 KB
3_large_1.txt AC 34 ms
12,108 KB
3_large_2.txt AC 25 ms
12,096 KB
4_max_0.txt AC 81 ms
12,108 KB
4_x_upload_dekinai1.txt AC 156 ms
12,108 KB
4_x_upload_dekinai2.txt AC 154 ms
12,120 KB
4_x_upload_dekinai3.txt AC 171 ms
12,108 KB
5_1.txt AC 204 ms
12,120 KB
6_6_kaomojimitai1.txt AC 19 ms
12,108 KB
7_add_0.txt AC 16 ms
12,120 KB
7_add_1.txt AC 14 ms
12,096 KB
7_add_2.txt AC 15 ms
12,108 KB
99_system_test1.txt AC 172 ms
12,120 KB
99_system_test2.txt AC 56 ms
12,096 KB
99_system_test3.txt AC 159 ms
12,120 KB
99_system_test4.txt AC 135 ms
12,120 KB
99_system_test5.txt AC 97 ms
12,108 KB
99_system_test6.txt AC 49 ms
12,108 KB
99_system_test7.txt AC 163 ms
12,108 KB
99_system_test8.txt AC 92 ms
12,120 KB
99_system_test9.txt AC 101 ms
12,108 KB
99_system_test10.txt AC 119 ms
12,096 KB
99_system_test11.txt AC 64 ms
12,120 KB
99_system_test12.txt AC 173 ms
12,108 KB
99_system_test13.txt AC 151 ms
12,108 KB
99_system_test14.txt AC 113 ms
12,108 KB
99_system_test15.txt AC 166 ms
12,108 KB
99_system_test16.txt AC 58 ms
12,108 KB
99_system_test17.txt AC 81 ms
12,096 KB
99_system_test18.txt AC 32 ms
12,108 KB
99_system_test19.txt AC 47 ms
12,108 KB
99_system_test20.txt AC 77 ms
12,108 KB
99_system_test21.txt AC 132 ms
12,096 KB
99_system_test22.txt AC 172 ms
12,108 KB
99_system_test23.txt AC 115 ms
12,096 KB
99_system_test24.txt AC 153 ms
12,108 KB
99_system_test25.txt AC 41 ms
12,108 KB
99_system_test26.txt AC 109 ms
12,108 KB
99_system_test27.txt AC 131 ms
12,120 KB
99_system_test28.txt AC 154 ms
12,120 KB
99_system_test29.txt AC 138 ms
12,108 KB
99_system_test30.txt AC 127 ms
12,120 KB
99_system_test31.txt AC 150 ms
12,096 KB
system_test1.txt AC 18 ms
12,096 KB
system_test2.txt AC 19 ms
12,120 KB
system_test3.txt AC 18 ms
12,108 KB
system_test4.txt AC 60 ms
12,108 KB
system_test5.txt AC 57 ms
12,120 KB
system_test6.txt AC 46 ms
12,108 KB
system_test7.txt AC 29 ms
12,120 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