結果

問題 No.471 直列回転機
ユーザー parukiparuki
提出日時 2016-12-21 00:33:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 329 ms / 3,141 ms
コード長 1,199 bytes
コンパイル時間 1,644 ms
コンパイル使用メモリ 167,940 KB
実行使用メモリ 24,312 KB
平均クエリ数 19589.39
最終ジャッジ日時 2023-09-02 03:39:55
合計ジャッジ時間 13,750 ms
ジャッジサーバーID
(参考情報)
judge11 / judge16
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,412 KB
testcase_01 AC 23 ms
23,376 KB
testcase_02 AC 24 ms
23,388 KB
testcase_03 AC 24 ms
23,664 KB
testcase_04 AC 24 ms
24,024 KB
testcase_05 AC 25 ms
23,988 KB
testcase_06 AC 25 ms
24,012 KB
testcase_07 AC 26 ms
23,976 KB
testcase_08 AC 44 ms
23,652 KB
testcase_09 AC 51 ms
23,340 KB
testcase_10 AC 34 ms
23,820 KB
testcase_11 AC 147 ms
23,496 KB
testcase_12 AC 272 ms
23,652 KB
testcase_13 AC 275 ms
23,412 KB
testcase_14 AC 303 ms
23,568 KB
testcase_15 AC 329 ms
24,264 KB
testcase_16 AC 27 ms
23,832 KB
testcase_17 AC 26 ms
23,628 KB
testcase_18 AC 25 ms
23,832 KB
testcase_19 AC 23 ms
23,796 KB
testcase_20 AC 292 ms
23,544 KB
testcase_21 AC 87 ms
24,216 KB
testcase_22 AC 282 ms
23,532 KB
testcase_23 AC 251 ms
24,000 KB
testcase_24 AC 171 ms
23,376 KB
testcase_25 AC 73 ms
24,264 KB
testcase_26 AC 303 ms
23,424 KB
testcase_27 AC 155 ms
24,288 KB
testcase_28 AC 183 ms
23,616 KB
testcase_29 AC 217 ms
24,312 KB
testcase_30 AC 95 ms
23,520 KB
testcase_31 AC 290 ms
23,628 KB
testcase_32 AC 265 ms
24,228 KB
testcase_33 AC 203 ms
23,808 KB
testcase_34 AC 291 ms
23,352 KB
testcase_35 AC 91 ms
24,036 KB
testcase_36 AC 141 ms
24,288 KB
testcase_37 AC 49 ms
23,376 KB
testcase_38 AC 80 ms
24,000 KB
testcase_39 AC 125 ms
24,204 KB
testcase_40 AC 222 ms
23,832 KB
testcase_41 AC 297 ms
23,844 KB
testcase_42 AC 206 ms
23,604 KB
testcase_43 AC 281 ms
24,024 KB
testcase_44 AC 57 ms
23,616 KB
testcase_45 AC 193 ms
23,640 KB
testcase_46 AC 232 ms
23,388 KB
testcase_47 AC 286 ms
24,300 KB
testcase_48 AC 243 ms
23,616 KB
testcase_49 AC 242 ms
23,340 KB
testcase_50 AC 279 ms
24,300 KB
testcase_51 AC 125 ms
23,532 KB
testcase_52 AC 28 ms
23,616 KB
testcase_53 AC 27 ms
23,628 KB
testcase_54 AC 25 ms
23,628 KB
testcase_55 AC 98 ms
23,208 KB
testcase_56 AC 81 ms
23,508 KB
testcase_57 AC 68 ms
24,036 KB
testcase_58 AC 38 ms
24,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define mt make_tuple
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;

void o() {
    fflush(stdout);
}

pair<ll, ll> q(int x, int y) {
    printf("? %d %d\n", x, y);
    o();
    ll xx, yy;
    scanf("%lld%lld", &xx, &yy);
    return mp(xx, yy);
}

int main(){
    int M;
    scanf("%d", &M);
    vi X(M), Y(M);
    rep(i, M) {
        scanf("%d%d", &X[i], &Y[i]);
    }

    // |a b e|
    // |c d f|
    // |0 0 1|
    
    ll a, b, c, d, e, f, g, h;
    tie(e, f) = q(0, 0);
    tie(a, c) = q(1, 0);
    tie(b, d) = q(0, 1);
    a -= e; b -= e; c -= f; d -= f;

    printf("!\n");
    rep(i, M) {
        ll x = X[i], y = Y[i];
        ll xx = a*x + b*y + e, yy = c*x + d*y + f;
        printf("%lld %lld\n", xx, yy);
    }
    o();
}
0