結果
| 問題 |
No.5009 Draw A Convex Polygon
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-17 22:56:26 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,001 bytes |
| コンパイル時間 | 2,388 ms |
| コンパイル使用メモリ | 217,684 KB |
| 実行使用メモリ | 151,668 KB |
| スコア | 0 |
| 最終ジャッジ日時 | 2024-07-17 22:56:37 |
| 合計ジャッジ時間 | 10,561 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef long long ll;
typedef pair<double, pair<ll, ll>> point;
int main() {
const ll N = 1e6;
set<point> st;
bool ok = false;
for (ll i = 1; i <= 1299; ++i) {
for (ll j = 1; j <= 1299; ++j) {
ll g = gcd(i, j);
st.insert({atan2(j / g, i / g), {i / g, j / g}});
if (st.size() == N) {
ok = true;
break;
}
if (ok) {
break;
}
}
}
vector<point> L(st.begin(), st.end());
sort(L.begin(), L.end());
vector<pair<ll, ll>> ans;
ll nowx = -1e9 + 1, nowy = -1e9 + 1;
for (const auto& [_, p] : L) {
ll x = p.first, y = p.second;
nowx += x;
nowy += y;
ans.push_back({nowx, nowy});
}
cout << N << endl;
for (const auto& [x, y] : ans) {
cout << x << " " << y << endl;
}
return 0;
}