結果

問題 No.471 直列回転機
ユーザー 👑 kmjpkmjp
提出日時 2016-12-21 00:07:08
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 432 ms / 3,141 ms
コード長 1,230 bytes
コンパイル時間 3,137 ms
コンパイル使用メモリ 146,828 KB
実行使用メモリ 24,384 KB
平均クエリ数 19588.39
最終ジャッジ日時 2023-09-02 03:36:07
合計ジャッジ時間 16,354 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,424 KB
testcase_01 AC 24 ms
23,364 KB
testcase_02 AC 24 ms
23,628 KB
testcase_03 AC 24 ms
23,640 KB
testcase_04 AC 23 ms
24,216 KB
testcase_05 AC 26 ms
24,216 KB
testcase_06 AC 25 ms
23,652 KB
testcase_07 AC 25 ms
23,640 KB
testcase_08 AC 52 ms
23,640 KB
testcase_09 AC 55 ms
23,640 KB
testcase_10 AC 38 ms
24,312 KB
testcase_11 AC 178 ms
24,012 KB
testcase_12 AC 367 ms
24,348 KB
testcase_13 AC 377 ms
23,768 KB
testcase_14 AC 410 ms
23,628 KB
testcase_15 AC 369 ms
23,788 KB
testcase_16 AC 25 ms
23,640 KB
testcase_17 AC 23 ms
23,364 KB
testcase_18 AC 24 ms
23,532 KB
testcase_19 AC 26 ms
24,264 KB
testcase_20 AC 406 ms
24,276 KB
testcase_21 AC 102 ms
24,240 KB
testcase_22 AC 354 ms
23,444 KB
testcase_23 AC 336 ms
23,432 KB
testcase_24 AC 215 ms
23,412 KB
testcase_25 AC 82 ms
24,348 KB
testcase_26 AC 432 ms
24,300 KB
testcase_27 AC 200 ms
23,412 KB
testcase_28 AC 230 ms
24,240 KB
testcase_29 AC 261 ms
24,336 KB
testcase_30 AC 122 ms
23,532 KB
testcase_31 AC 403 ms
23,604 KB
testcase_32 AC 345 ms
23,640 KB
testcase_33 AC 268 ms
23,544 KB
testcase_34 AC 397 ms
23,832 KB
testcase_35 AC 102 ms
23,616 KB
testcase_36 AC 179 ms
23,532 KB
testcase_37 AC 57 ms
23,988 KB
testcase_38 AC 83 ms
24,000 KB
testcase_39 AC 141 ms
24,324 KB
testcase_40 AC 283 ms
23,412 KB
testcase_41 AC 414 ms
23,416 KB
testcase_42 AC 266 ms
23,504 KB
testcase_43 AC 385 ms
23,776 KB
testcase_44 AC 58 ms
24,276 KB
testcase_45 AC 259 ms
23,428 KB
testcase_46 AC 295 ms
23,700 KB
testcase_47 AC 383 ms
23,676 KB
testcase_48 AC 345 ms
24,012 KB
testcase_49 AC 316 ms
23,616 KB
testcase_50 AC 350 ms
23,808 KB
testcase_51 AC 157 ms
23,544 KB
testcase_52 AC 25 ms
23,640 KB
testcase_53 AC 27 ms
24,384 KB
testcase_54 AC 26 ms
24,000 KB
testcase_55 AC 108 ms
23,520 KB
testcase_56 AC 89 ms
24,348 KB
testcase_57 AC 65 ms
23,988 KB
testcase_58 AC 40 ms
23,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int M;
ll X[505050],Y[505050];
ll NX[2],NY[2];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>M;
	FOR(i,M) cin>>X[i]>>Y[i];
	cout<<"? 0 0"<<endl;
	cin>>NX[0]>>NY[0];
	cout<<"? 1 0"<<endl;
	cin>>NX[1]>>NY[1];
	
	cout<<"!"<<endl;
	if(NX[1]-NX[0]==1) {
		FOR(i,M) cout<<X[i]+NX[0]<<" "<<Y[i]+NY[0]<<endl;
	}
	else if(NX[1]-NX[0]==-1) {
		FOR(i,M) cout<<-X[i]+NX[0]<<" "<<-Y[i]+NY[0]<<endl;
	}
	else if(NY[1]-NY[0]==1) {
		FOR(i,M) cout<<-Y[i]+NX[0]<<" "<<X[i]+NY[0]<<endl;
	}
	else if(NY[1]-NY[0]==-1) {
		FOR(i,M) cout<<Y[i]+NX[0]<<" "<<-X[i]+NY[0]<<endl;
	}
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}
0