結果

問題 No.471 直列回転機
ユーザー 🐬hec🐬hec
提出日時 2016-12-21 00:32:21
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 453 ms / 3,141 ms
コード長 1,741 bytes
コンパイル時間 1,864 ms
コンパイル使用メモリ 163,620 KB
実行使用メモリ 24,336 KB
平均クエリ数 19589.39
最終ジャッジ日時 2023-09-02 03:39:40
合計ジャッジ時間 16,082 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,628 KB
testcase_01 AC 24 ms
23,532 KB
testcase_02 AC 23 ms
23,388 KB
testcase_03 AC 23 ms
23,520 KB
testcase_04 AC 24 ms
24,228 KB
testcase_05 AC 25 ms
23,820 KB
testcase_06 AC 24 ms
23,376 KB
testcase_07 AC 25 ms
24,228 KB
testcase_08 AC 62 ms
23,616 KB
testcase_09 AC 63 ms
24,252 KB
testcase_10 AC 43 ms
23,364 KB
testcase_11 AC 188 ms
23,520 KB
testcase_12 AC 362 ms
23,424 KB
testcase_13 AC 379 ms
24,336 KB
testcase_14 AC 418 ms
24,024 KB
testcase_15 AC 402 ms
23,532 KB
testcase_16 AC 25 ms
23,400 KB
testcase_17 AC 24 ms
24,240 KB
testcase_18 AC 24 ms
23,532 KB
testcase_19 AC 23 ms
23,604 KB
testcase_20 AC 447 ms
24,324 KB
testcase_21 AC 93 ms
23,616 KB
testcase_22 AC 392 ms
24,312 KB
testcase_23 AC 374 ms
24,000 KB
testcase_24 AC 220 ms
23,532 KB
testcase_25 AC 78 ms
23,400 KB
testcase_26 AC 453 ms
24,024 KB
testcase_27 AC 210 ms
24,000 KB
testcase_28 AC 258 ms
23,352 KB
testcase_29 AC 282 ms
24,012 KB
testcase_30 AC 118 ms
23,616 KB
testcase_31 AC 424 ms
23,412 KB
testcase_32 AC 352 ms
23,640 KB
testcase_33 AC 280 ms
23,532 KB
testcase_34 AC 424 ms
24,012 KB
testcase_35 AC 100 ms
23,376 KB
testcase_36 AC 173 ms
23,628 KB
testcase_37 AC 58 ms
23,400 KB
testcase_38 AC 92 ms
23,412 KB
testcase_39 AC 144 ms
23,532 KB
testcase_40 AC 300 ms
24,024 KB
testcase_41 AC 441 ms
24,228 KB
testcase_42 AC 282 ms
24,324 KB
testcase_43 AC 393 ms
24,012 KB
testcase_44 AC 56 ms
23,520 KB
testcase_45 AC 262 ms
23,628 KB
testcase_46 AC 317 ms
23,808 KB
testcase_47 AC 399 ms
23,988 KB
testcase_48 AC 345 ms
24,024 KB
testcase_49 AC 345 ms
24,012 KB
testcase_50 AC 396 ms
23,520 KB
testcase_51 AC 169 ms
23,544 KB
testcase_52 AC 27 ms
23,604 KB
testcase_53 AC 26 ms
23,400 KB
testcase_54 AC 28 ms
23,532 KB
testcase_55 AC 116 ms
23,604 KB
testcase_56 AC 92 ms
23,988 KB
testcase_57 AC 71 ms
24,312 KB
testcase_58 AC 45 ms
23,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};

// Problem Specific Parameter:
using ll=long long;

ll a[3][3];
ll x[50010],y[50010];

int main(void){
	int m;
	cin >> m;
	rep(i,m) cin >> x[i] >> y[i];

	cout << "? 0 0" << endl << flush;
	cin >> a[0][2] >> a[1][2];

	cout << "? 0 1" << endl << flush;
	cin >> a[0][1] >> a[1][1];
	
	a[0][1]-=a[0][2];
	a[1][1]-=a[1][2];

	cout << "? 1 1" << endl << flush;
	cin >> a[0][0] >> a[1][0];

	a[0][0]-=a[0][1]+a[0][2];
	a[1][0]-=a[1][1]+a[1][2];

	cout << "!" << endl;
	rep(i,m){
		ll ax=a[0][0]*x[i]+a[0][1]*y[i]+a[0][2];
		ll ay=a[1][0]*x[i]+a[1][1]*y[i]+a[1][2];
		cout << ax << " " << ay << endl;
	}	

	return 0;
}
0