結果
| 問題 | 
                            No.5009 Draw A Convex Polygon
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-03-22 15:42:08 | 
| 言語 | C++17(gcc12)  (gcc 12.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 161 ms / 2,600 ms | 
| コード長 | 1,048 bytes | 
| コンパイル時間 | 574 ms | 
| 実行使用メモリ | 22,608 KB | 
| スコア | 218,876 | 
| 平均クエリ数 | 218877.00 | 
| 最終ジャッジ日時 | 2023-03-22 15:42:10 | 
| 合計ジャッジ時間 | 1,983 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge15 / judge12 | 
| 純コード判定しない問題か言語 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 | 
ソースコード
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <map>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <algorithm>
#include <array>
#include <unordered_set>
#include <unordered_map>
#include <string>
using namespace std;
bool rcmp(int a, int b) { return a>b; }
typedef long long LL;
class mypcmp {
public:
    bool operator()(const int& a, const int& b) {
        return a<b;
    }
};
#define HH 10000
int xs[1000004];
int ys[1000004];
int main() {
    int n, i, x, y, k, d, h;
    h=HH;
    x=-1000000000; y=0;  k=0; d=1;
    while(1) {
        if (k>250000) break;
        if (x>=0||y>1000000000) break;
        xs[k]=x; ys[k]=y; k++;
        x+=d; y+=h;
        if (h>d) h--;
        else d++;
    }
    printf("%d\n", (k-1)*4);
    for (i=1; i<k; i++) printf("%d %d\n", -xs[i], ys[i]);
    for (i=k-1; i>0; i--) printf("%d %d\n", xs[i], ys[i]);
    for (i=1; i<k; i++) printf("%d %d\n", xs[i], -ys[i]);
    for (i=k-1; i>0; i--) printf("%d %d\n", -xs[i], -ys[i]);
    return 0;
}