結果

問題 No.5009 Draw A Convex Polygon
ユーザー daiotadaiota
提出日時 2022-12-02 16:33:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 281 ms / 2,600 ms
コード長 735 bytes
コンパイル時間 1,630 ms
実行使用メモリ 21,928 KB
スコア 178,882
平均クエリ数 178883.00
最終ジャッジ日時 2022-12-02 16:33:30
合計ジャッジ時間 2,906 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
純コード判定しない問題か言語
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
typedef long long ll;
typedef pair<int,int> P;


int main(void){
	ll i;

	cin.tie(0);  ios_base::sync_with_stdio(false);

	vector<ll> x,y,xx,yy;
	ll c=0,n=1000000000;
	for(i=0;;i++){
		if(n-i<=0) break;
		n-=i;
		x.push_back(n);
		y.push_back(i);
		c++;
	}

	cout << 4*c-2<< endl;

	for(i=c-1;i>=0;i--){
		xx.push_back(-x[i]);
		yy.push_back(y[i]);
	}


	for(i=0;i<c;i++){
		cout << x[i] << ' ' << y[i] << endl;
	}

	for(i=0;i<c;i++){
		cout << xx[i] << ' ' << yy[i] << endl;
	}

	for(i=c-2;i>=0;i--){
		cout << xx[i] << ' ' << -yy[i] << endl;
	}

	for(i=c-1;i>=1;i--){
		cout << x[i] << ' ' << -y[i] << endl;
	}

	cout.flush();


	return 0;
}
0