結果
| 問題 |
No.5009 Draw A Convex Polygon
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-12-02 06:26:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 870 bytes |
| コンパイル時間 | 254 ms |
| 実行使用メモリ | 192,664 KB |
| スコア | 0 |
| 平均クエリ数 | 1000001.00 |
| 最終ジャッジ日時 | 2022-12-02 06:26:36 |
| 合計ジャッジ時間 | 3,508 ms |
|
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
ソースコード
from math import sqrt
M=10**9
ANS=[(101000,999999995),(202000, 999999980)]
def outer_product(x,y,z,w):
return x*w-y*z
N=1000000
while len(ANS)<N//4:
s,t=ANS[-1]
u,v=ANS[-2]
OK=10**9
NG=ANS[-1][0]
while OK>NG+1:
mid=(OK+NG)//2
x,y=mid,round(sqrt(M*M-mid*mid))
if outer_product(u-s,v-t,x-u,y-v)<0:
NG=mid
else:
OK=mid
ANS.append((OK,round(sqrt(M*M-OK*OK))))
Q=ANS
ANS=[]
for i in range(len(Q)):
x,y=Q[i]
ANS.append(str(x)+" "+str(y))
for i in range(len(Q)):
z,w=Q[-1-i]
ANS.append(str(z)+" "+str(-w))
for i in range(len(Q)):
x,y=Q[i]
ANS.append(str(-x)+" "+str(-y))
for i in range(len(Q)):
z,w=Q[-1-i]
ANS.append(str(-z)+" "+str(w))
n=10**6
ANS=ANS[:n]
ANS.reverse()
print(len(ANS),flush=True)
print("\n".join(ANS),flush=True)
titia