結果
| 問題 |
No.5009 Draw A Convex Polygon
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-11 20:57:34 |
| 言語 | cLay (20241019-1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 955 bytes |
| コンパイル時間 | 1,937 ms |
| 実行使用メモリ | 82,132 KB |
| スコア | 0 |
| 平均クエリ数 | 938771.00 |
| 最終ジャッジ日時 | 2022-12-11 20:57:43 |
| 合計ジャッジ時間 | 7,669 ms |
|
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
ソースコード
void check(const deque<pair<ll,ll>>& dq) {
ll vy1 = dq[0].first-dq[1].first;
ll vx1 = dq[0].second-dq[1].second;
ll vy2 = dq[1].first-dq[2].first;
ll vx2 = dq[1].second-dq[2].second;
if (vy1*vx2 < vy2*vx1) {
cout << vx1 << " " << vy1 << " " << vx2 << " " << vy2 << endl;
abort();
}
}
{
set<pair<int, int>> li;
REP(i, 1500) {
const int vy = i + 1;
REP(j, 1500) {
const int vx = j + 1;
int g = gcd(vy, vx);
li.emplace(vy/g, vx/g);
}
}
int n = 1000000;
wt(n);
n -= 2;
ll y = 0, x = 0;
// ll oy = 0, ox = 0;
ll oy = 500000000, ox = 500000000;
wt(0-oy, 0-ox);
auto it = li.begin();
deque<pair<ll,ll>> q;
q.emplace_back(0, 0);
REP(_, n) {
assert(it != li.end());
y += it->first;
x += it->second;
wt(y-oy, x-ox);
++it;
q.emplace_back(y, x);
if (q.size() == 3) check(q);
if (q.size() > 4) q.pop_front();
}
wt(0-oy, x-ox);
cout.flush();
}