結果

問題 No.471 直列回転機
ユーザー koyoprokoyopro
提出日時 2020-02-04 03:05:34
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,580 bytes
コンパイル時間 3,511 ms
コンパイル使用メモリ 143,808 KB
実行使用メモリ 59,296 KB
最終ジャッジ日時 2023-09-23 19:35:35
合計ジャッジ時間 13,536 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--)
#define REP(i, n) for(int i=0; i<(n); i++)
#define RREP(i, n) for(int i=(n-1); i>=0; i--)
#define ALL(a) (a).begin(),(a).end()
#define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end());
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
#define array2(type, x, y) array<array<type, y>, x>
#define vector2(type) vector<vector<type> >
#define out(...) printf(__VA_ARGS__)

int dxy[] = {0, 1, 0, -1, 0};

void solve();
signed main()
{
//#if DEBUG
//    std::ifstream in("input.txt");
//    std::cin.rdbuf(in.rdbuf());
//#endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

/*================================*/
#if DEBUG
#define SIZE 100
#else
#define SIZE 123450
#endif

int N,M,Q;
int P[123450][2];

void query(int x, int y, int *x0, int *y0) {
    out("? %lld %lld\n", x, y);
    cout << flush;
    cin >> *x0 >> *y0;
}

void solve() {
    cin>>M;
    REP(i,M) {
        cin>>P[i][0]>>P[i][1];
    }
    
    int x0,y0,x1,y1,x2,y2;
    query(0, 0, &x0, &y0);
    query(1, 0, &x1, &y1);
    query(0, 1, &x2, &y2);
    
    /*
     |xn| |a b c||x|
     |yn|=|d e f||y|
     | 1| |0 0 1||1|
     */
    int a,b,c,d,e,f;
    c = x0;
    a = x1 - x0;
    b = x2 - x0;
    f = y0;
    d = y1 - y0;
    e = y2 - y0;
    cout << "!" << endl;
    REP(i,M) {
        int x = a*P[i][0] + b*P[i][1]+c;
        int y = d*P[i][0] + e*P[i][1]+f;
        out("%lld %lld\n",x,y);
    }
}
0