結果

問題 No.5009 Draw A Convex Polygon
ユーザー lddlinanlddlinan
提出日時 2023-03-22 15:33:06
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,027 bytes
コンパイル時間 625 ms
実行使用メモリ 23,076 KB
スコア 0
平均クエリ数 952886.00
最終ジャッジ日時 2023-03-22 15:33:09
合計ジャッジ時間 2,338 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 1000
int xs[1000004];
int ys[1000004];
int main() {
    int n, i, x, y, k, d;
    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+=HH; d++;
    }
    // printf("k is %d\n", k);
    printf("1000000\n");
    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;
}
0