結果
| 問題 |
No.2493 K-th in L2 with L1
|
| ユーザー |
|
| 提出日時 | 2023-10-06 21:40:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 503 bytes |
| コンパイル時間 | 169 ms |
| コンパイル使用メモリ | 82,688 KB |
| 実行使用メモリ | 78,336 KB |
| 最終ジャッジ日時 | 2024-07-26 15:52:52 |
| 合計ジャッジ時間 | 1,505 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 1 WA * 3 |
ソースコード
from functools import cmp_to_key
Q = int(input())
for _ in range(Q):
D, K = map(int,input().split())
points = []
for i in range(-D, D + 1):
points.append([i, D - abs(i)])
if abs(i) != D : points.append([i, -(D - abs(i))])
if len(points) < K :
print("No")
else:
print("Yes")
def cmp(a, b):
return (a[0] ** 2 + a[1] ** 2) < (b[0] ** 2 + b[1] ** 2)
points.sort(key=cmp_to_key(cmp))
print(*points[K - 1])