結果
| 問題 |
No.471 直列回転機
|
| コンテスト | |
| ユーザー |
koyopro
|
| 提出日時 | 2020-02-04 03:03:33 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,561 bytes |
| コンパイル時間 | 1,225 ms |
| コンパイル使用メモリ | 158,056 KB |
| 実行使用メモリ | 40,400 KB |
| 最終ジャッジ日時 | 2024-07-16 19:24:42 |
| 合計ジャッジ時間 | 10,548 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 |
| other | -- * 58 |
ソースコード
#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);
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);
}
}
koyopro