結果
| 問題 |
No.5009 Draw A Convex Polygon
|
| コンテスト | |
| ユーザー |
houren
|
| 提出日時 | 2022-12-02 04:22:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,432 bytes |
| コンパイル時間 | 2,733 ms |
| 実行使用メモリ | 22,576 KB |
| スコア | 0 |
| 平均クエリ数 | 357753.00 |
| 最終ジャッジ日時 | 2022-12-02 04:22:50 |
| 合計ジャッジ時間 | 4,013 ms |
|
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 = 0;
rep(i,ok){
cout << x << " " << y << '\n';
x++;
y += i+1;
}
rep(i,ok){
cout << x << " " << y << '\n';
y++;
x += i+1;
}
rep(i,ok){
cout << x << " " << y << '\n';
x++;
y -= i+1;
}
rep(i,ok){
cout << x << " " << y << '\n';
y--;
x += i+1;
}
rep(i,ok){
cout << x << " " << y << '\n';
x--;
y -= i+1;
}
rep(i,ok){
cout << x << " " << y << '\n';
y--;
x -= i+1;
}
rep(i,ok){
cout << x << " " << y << '\n';
x--;
y += i+1;
}
rep(i,ok){
cout << x << " " << y << '\n';
y++;
x -= i+1;
}
cout << flush;
return 0;
}
houren