結果
問題 | No.2493 K-th in L2 with L1 |
ユーザー | yupooh |
提出日時 | 2023-10-06 21:26:46 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 93 ms / 2,000 ms |
コード長 | 336 bytes |
コンパイル時間 | 297 ms |
コンパイル使用メモリ | 87,292 KB |
実行使用メモリ | 76,484 KB |
最終ジャッジ日時 | 2023-10-06 21:26:47 |
合計ジャッジ時間 | 1,353 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 71 ms
71,580 KB |
testcase_01 | AC | 88 ms
76,484 KB |
testcase_02 | AC | 89 ms
76,332 KB |
testcase_03 | AC | 93 ms
76,388 KB |
testcase_04 | AC | 70 ms
71,192 KB |
ソースコード
import sys input = sys.stdin.readline q=int(input()) for _ in range(q): d,k=map(int,input().split()) l=[] for x in range(-d,d+1): y=d-abs(x) v=x**2+y**2 l.append((v,x,y)) if y>0: l.append((v,x,-y)) if len(l)<k: print("No") continue l.sort() x=l[k-1][1] y=l[k-1][2] print("Yes") print(x,y)