結果
| 問題 | 
                            No.5009 Draw A Convex Polygon
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-12-02 01:18:35 | 
| 言語 | C++17(gcc12)  (gcc 12.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 987 bytes | 
| コンパイル時間 | 2,361 ms | 
| 実行使用メモリ | 22,864 KB | 
| スコア | 0 | 
| 平均クエリ数 | 980055.00 | 
| 最終ジャッジ日時 | 2022-12-02 01:18:47 | 
| 合計ジャッジ時間 | 7,594 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge13 / judge12 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 1 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
	vector<pair<int, int>> D;
	int dx = 1;
	int dy = 2;
	while(D.size() * 4 < 1000000){
		if(gcd(dx, dy) == 1){
			D.push_back({dx, dy});
			D.push_back({dy, dx});
		}
		dx++;
		if(dx == dy){
			dx = 1;
			dy++;
		}
	}
	sort(D.begin(), D.end(), [](pair<int, int> &l, pair<int, int> &r){
		return l.first * r.second < r.first * l.second;
	});
	int x = -1000000000;
	int y = 0;
	cout << 1000000 << '\n';
	for(auto tmp:D){
		x += tmp.first;
		y += tmp.second;
		cout << x << " " << y << '\n';
	}
	for(auto tmp:D){
		x += tmp.second;
		y -= tmp.first;
		cout << x << " " << y << '\n';
	}
	for(auto tmp:D){
		x -= tmp.first;
		y -= tmp.second;
		cout << x << " " << y << '\n';
	}
	for(auto tmp:D){
		x -= tmp.second;
		y += tmp.first;
		cout << x << " " << y << '\n';
	}
	cout << flush;
}
int main(){
	cin.tie(0)->sync_with_stdio(0);
	cout << fixed << setprecision(12);
	int t;
	t = 1;
	while(t--) solve();
}