結果

問題 No.471 直列回転機
ユーザー けー
提出日時 2017-04-13 22:18:50
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 468 ms / 3,141 ms
コード長 710 bytes
コンパイル時間 1,556 ms
コンパイル使用メモリ 166,668 KB
実行使用メモリ 25,592 KB
平均クエリ数 19588.39
最終ジャッジ日時 2024-06-11 10:38:25
合計ジャッジ時間 16,841 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 58
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
const int inf=8938103643641919514ll;
const int mod=1000000007;
const int dd[]={0,-1,0,1,0};
using namespace std;
int a,b,c,d;
int p[100000],q[100000];
signed main(){
	int i,j;
	cin>>a;
	for(i=0;i<a;i++)
		cin>>p[i]>>q[i];
	cout<<"? 0 0"<<endl;
	int x,y;
	cin>>x>>y;
	cout<<"? 1 0"<<endl;
	int z,w;
	cin>>z>>w;
	z-=x;
	w-=y;
	if(z==0){
		if(w==1)
			for(i=0;i<a;i++){
				int x=p[i];
				p[i]=-q[i];
				q[i]=x;
			}
		else
			for(i=0;i<a;i++){
				int x=p[i];
				p[i]=q[i];
				q[i]=-x;
			}
	}else if(z==-1){
		for(i=0;i<a;i++)
			p[i]=-p[i],q[i]=-q[i];
	}
	for(i=0;i<a;i++)
		p[i]+=x,q[i]+=y;
	cout<<"!"<<endl;
	for(i=0;i<a;i++)
		cout<<p[i]<<" "<<q[i]<<endl;
}
0