結果
問題 |
No.2831 Cos Bomb Crasher
|
ユーザー |
👑 |
提出日時 | 2024-07-14 14:14:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 250 ms / 2,000 ms |
コード長 | 687 bytes |
コンパイル時間 | 104 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 27,728 KB |
平均クエリ数 | 182.67 |
最終ジャッジ日時 | 2024-07-15 08:13:47 |
合計ジャッジ時間 | 16,247 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 58 |
ソースコード
I,R,O=input,range,print N=int(I()) def b(n,s): n%=s*8 return[[s,n],[s*2-n,s],[-s,s*4-n],[-s*6+n,-s]][(n+s)//(s*2)%4] P="+" def q(): global P;O(1,x,y,flush=1);P,*u=I().split() a=0 while P<"-": a+=2;x,y=b(a,1);q() l,r=0,N*2 while l+1<r: m=(l+r)>>1;x,y=b(a*m,m);q() if P=="-":l=m else:r=m d,e=b(a+2,1) t,u=0,0 def j(): global x,y;x,y=b(a*c,c);x+=d*s*m;y+=e*s*m;q() return"-"==P for c in R(-1+max(4,r-1)>>1,(r+3)>>1): f,g=0,0 for s in R(-1,3,2): l,r=0,N*2 while l+1<r: m=(l+r)>>1 if j():l=m else:r=m x,y=b(a*c,c);f+=x+d*s*r;g+=y+e*s*r for x in R(f-1,f+2): for y in R(g-1,g+2): q() if P>"-"and t*t+u*u<x*x+y*y:t,u=x,y O(2,t/2,u/2,'{:f}'.format((t*t+u*u)/4))