結果
| 問題 |
No.5009 Draw A Convex Polygon
|
| コンテスト | |
| ユーザー |
harurun
|
| 提出日時 | 2022-11-02 01:38:08 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 572 ms / 2,600 ms |
| コード長 | 1,326 bytes |
| コンパイル時間 | 769 ms |
| 実行使用メモリ | 23,440 KB |
| スコア | 357,748 |
| 平均クエリ数 | 357749.00 |
| 最終ジャッジ日時 | 2022-12-01 23:30:11 |
| 合計ジャッジ時間 | 2,628 ms |
|
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
#include <iostream>
#include <complex>
#include <vector>
using namespace std;
using ll=long long;
using Point_i=complex<ll>;
const ll n=44719;
const ll m=999961558;
int main(){
Point_i p=Point_i(0,-m);
ll dx=n;
ll dy=1;
vector<Point_i> ans;
ans.reserve(1000000);
//ans.push_back(p);
// 第4象限
while(dx>0){
p=Point_i(p.real()+dx,p.imag()+dy);
ans.push_back(p);
dx--;
}
dx=1;
dy=2;
while(dy<=n){
p=Point_i(p.real()+dx,p.imag()+dy);
ans.push_back(p);
dy++;
}
// 第1象限
dx=1;
dy=n;
while(dy>0){
p=Point_i(p.real()-dx,p.imag()+dy);
ans.push_back(p);
dy--;
}
dx=2;
dy=1;
while(dx<=n){
p=Point_i(p.real()-dx,p.imag()+dy);
ans.push_back(p);
dx++;
}
// 第2象限
dx=n;
dy=1;
while(dx>0){
p=Point_i(p.real()-dx,p.imag()-dy);
ans.push_back(p);
dx--;
}
dx=1;
dy=2;
while(dy<=n){
p=Point_i(p.real()-dx,p.imag()-dy);
ans.push_back(p);
dy++;
}
// 第3象限
dx=1;
dy=n;
while(dy>0){
p=Point_i(p.real()+dx,p.imag()-dy);
ans.push_back(p);
dy--;
}
dx=2;
dy=1;
while(dx<=n){
p=Point_i(p.real()+dx,p.imag()-dy);
ans.push_back(p);
dx++;
}
ll N;
N=ans.size();
cout<<N<<endl;
for(ll i=0;i<N;i++){
cout<<ans[i].real()<<" "<<ans[i].imag()<<endl;
}
}
harurun