結果
問題 | No.2493 K-th in L2 with L1 |
ユーザー |
|
提出日時 | 2024-04-09 19:39:45 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 414 bytes |
コンパイル時間 | 81 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-01 19:51:15 |
合計ジャッジ時間 | 1,121 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 WA * 2 |
ソースコード
import mathQ=int(input())for _ in range(Q):D,K=map(int,input().split())P=[]if D==0:P.append((0,0))else:for x in range(1,D+1):P.append((x,D-x))E=[]for x,y in P:E.append((math.sqrt(x**2+y**2),(x,y)))E.sort()if (len(E)==1 and K==1) or (len(E)>1 and K//4<len(E)):print("Yes")print(*E[(K-1)//4][1])else:print("No")