結果
| 問題 | No.5009 Draw A Convex Polygon |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-17 22:50:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 650 bytes |
| コンパイル時間 | 142 ms |
| コンパイル使用メモリ | 82,444 KB |
| 実行使用メモリ | 6,940 KB |
| スコア | 0 |
| 最終ジャッジ日時 | 2024-07-17 22:50:31 |
| 合計ジャッジ時間 | 8,321 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 |
ソースコード
import math
import random
N = 10**6
st = set()
ok = False
for i in range(1, 1300):
for j in range(1, 1300):
g = math.gcd(i, j)
st.add((math.atan2(j//g, i//g), i//g, j//g))
if len(st) == N:
ok = True
break
if ok == True:
break
L = list(st)
L.sort()
ans = []
nowx = -10**9 + 1
nowy = -10**9 + 1
for i in range(N):
x, y = L[i][1], L[i][2]
nowx += x
nowy += y
ans.append((nowx, nowy))
print(N)
for i in range(N):
print(ans[i][0], ans[i][1])
# N = 10**6
# L = [0]
# x = random.randint(1, 10**9)
# y = random.randint(1, 10**9)
# L.append((math.atan2(x,y), x, y))