結果

問題 No.471 直列回転機
ユーザー fumofumofunifumofumofuni
提出日時 2022-09-06 23:46:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 506 ms / 3,141 ms
コード長 1,463 bytes
コンパイル時間 2,470 ms
コンパイル使用メモリ 200,620 KB
実行使用メモリ 24,420 KB
平均クエリ数 19588.39
最終ジャッジ日時 2023-08-14 05:23:59
合計ジャッジ時間 22,142 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
23,544 KB
testcase_01 AC 25 ms
23,820 KB
testcase_02 AC 26 ms
23,664 KB
testcase_03 AC 25 ms
24,048 KB
testcase_04 AC 25 ms
23,376 KB
testcase_05 AC 28 ms
23,400 KB
testcase_06 AC 26 ms
23,424 KB
testcase_07 AC 27 ms
23,820 KB
testcase_08 AC 68 ms
24,036 KB
testcase_09 AC 71 ms
24,048 KB
testcase_10 AC 43 ms
24,384 KB
testcase_11 AC 207 ms
23,376 KB
testcase_12 AC 399 ms
23,652 KB
testcase_13 AC 411 ms
24,060 KB
testcase_14 AC 458 ms
23,652 KB
testcase_15 AC 506 ms
23,568 KB
testcase_16 AC 28 ms
24,048 KB
testcase_17 AC 25 ms
23,688 KB
testcase_18 AC 25 ms
23,388 KB
testcase_19 AC 26 ms
23,688 KB
testcase_20 AC 467 ms
23,856 KB
testcase_21 AC 100 ms
23,664 KB
testcase_22 AC 403 ms
23,820 KB
testcase_23 AC 403 ms
24,384 KB
testcase_24 AC 228 ms
24,060 KB
testcase_25 AC 88 ms
23,544 KB
testcase_26 AC 468 ms
24,048 KB
testcase_27 AC 214 ms
24,048 KB
testcase_28 AC 274 ms
23,544 KB
testcase_29 AC 309 ms
24,036 KB
testcase_30 AC 131 ms
24,372 KB
testcase_31 AC 448 ms
23,376 KB
testcase_32 AC 386 ms
24,048 KB
testcase_33 AC 306 ms
24,036 KB
testcase_34 AC 454 ms
23,664 KB
testcase_35 AC 113 ms
24,372 KB
testcase_36 AC 182 ms
23,424 KB
testcase_37 AC 57 ms
23,700 KB
testcase_38 AC 96 ms
23,652 KB
testcase_39 AC 164 ms
24,324 KB
testcase_40 AC 321 ms
24,396 KB
testcase_41 AC 463 ms
23,676 KB
testcase_42 AC 294 ms
24,396 KB
testcase_43 AC 429 ms
23,544 KB
testcase_44 AC 62 ms
23,400 KB
testcase_45 AC 283 ms
24,048 KB
testcase_46 AC 338 ms
23,424 KB
testcase_47 AC 445 ms
23,388 KB
testcase_48 AC 378 ms
24,372 KB
testcase_49 AC 362 ms
24,384 KB
testcase_50 AC 432 ms
23,376 KB
testcase_51 AC 173 ms
24,360 KB
testcase_52 AC 29 ms
23,628 KB
testcase_53 AC 29 ms
23,640 KB
testcase_54 AC 29 ms
23,820 KB
testcase_55 AC 118 ms
24,420 KB
testcase_56 AC 98 ms
23,652 KB
testcase_57 AC 75 ms
23,568 KB
testcase_58 AC 47 ms
23,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")


#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=(n)-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[9]={1,0,-1,0,1,1,-1,-1,0};
const ll dx[9]={0,1,0,-1,1,-1,1,-1,0};
template <typename T> inline bool chmax(T &a, T b) {
  return ((a < b) ? (a = b, true) : (false));
}
template <typename T> inline bool chmin(T &a, T b) {
  return ((a > b) ? (a = b, true) : (false));
}

int main(){
  ll n;cin >> n;
  vl x(n),y(n);
  rep(i,n)cin >> x[i] >> y[i];
  cout << "? 0 0" << endl;
  ll a,b;cin >>a >> b;
  cout << "? 1 0" << endl;
  ll c,d;cin >> c >> d;
  c-=a;d-=b;
  cout << "!" << endl;
  if(c==1){
    rep(i,n)cout << x[i]+a <<" " << y[i]+b << endl;
  }
  else if(c==-1){
    rep(i,n)cout << a-x[i] <<" " << b-y[i] << endl;
  }
  else if(d==1){
    rep(i,n)cout << a-y[i] <<" " << b+x[i] << endl;
  }
  else{
    rep(i,n)cout << a+y[i] <<" " << b-x[i] << endl;
  }
}
0