結果
| 問題 |
No.5009 Draw A Convex Polygon
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-02 17:29:26 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,095 bytes |
| コンパイル時間 | 2,018 ms |
| 実行使用メモリ | 23,296 KB |
| スコア | 0 |
| 平均クエリ数 | 1000001.00 |
| 最終ジャッジ日時 | 2022-12-02 17:29:34 |
| 合計ジャッジ時間 | 7,468 ms |
|
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}
template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n=1e6;
vector<pair<int,int>>vp;
for(int i=1;i<=800;i++)for(int j=1;j<=800;j++){
if(gcd(i,j)==1)vp.push_back(make_pair(i,j));
}
sort(all(vp));
cout<<n<<"\n";
int x=0,y=-1e9;
rep(i,n/4){
cout<<x<<" "<<y<<endl;
x+=vp[i].first;
y+=vp[i].second;
}
rrep(i,n/4){
cout<<x<<" "<<y<<endl;
x-=vp[i].first;
y+=vp[i].second;
}
rep(i,n/4){
cout<<x<<" "<<y<<endl;
x-=vp[i].first;
y-=vp[i].second;
}
rrep(i,n/4){
cout<<x<<" "<<y<<endl;
x+=vp[i].first;
y-=vp[i].second;
}
}