結果
| 問題 |
No.5009 Draw A Convex Polygon
|
| コンテスト | |
| ユーザー |
houren
|
| 提出日時 | 2022-12-02 06:45:13 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,632 bytes |
| コンパイル時間 | 1,575 ms |
| 実行使用メモリ | 21,992 KB |
| スコア | 0 |
| 平均クエリ数 | 357753.00 |
| 最終ジャッジ日時 | 2022-12-02 06:45:15 |
| 合計ジャッジ時間 | 2,615 ms |
|
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define fix(x) fixed << setprecision(x)
#define asc(x) x, vector<x>, greater<x>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool chmax(T&a, const T&b){if(a<b){a=b;return 1;}return 0;}
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll ok = 0, ng = 1e6;
while(ng-ok>1){
ll md = (ok + ng) / 2;
if(md*(md+3)/2<=1e9) ok = md;
else ng = md;
}
cout << ok * 8 << '\n';
int x = -1e9, y = 1;
cout << x << " " << y << '\n';
y -= 2;
rep(i,ok-1){
cout << x << " " << y << '\n';
x--;
y -= ok-i;
}
rep(i,ok){
cout << x << " " << y << '\n';
x -= i+1;
y--;
}
cout << x << " " << y << '\n';
x -= 2;
rep(i,ok-1){
cout << x << " " << y << '\n';
x -= ok-i;
y++;
}
rep(i,ok){
cout << x << " " << y << '\n';
x--;
y += i+1;
}
cout << x << " " << y << '\n';
y += 2;
rep(i,ok-1){
cout << x << " " << y << '\n';
x++;
y += ok-i;
}
rep(i,ok){
cout << x << " " << y << '\n';
x += i+1;
y++;
}
cout << x << " " << y << '\n';
x += 2;
rep(i,ok-1){
cout << x << " " << y << '\n';
x += ok-i;
y--;
}
rep(i,ok){
cout << x << " " << y << '\n';
x++;
y -= i+1;
}
cout << flush;
return 0;
}
houren