結果
| 問題 |
No.2493 K-th in L2 with L1
|
| ユーザー |
|
| 提出日時 | 2023-10-06 21:36:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 739 bytes |
| コンパイル時間 | 150 ms |
| コンパイル使用メモリ | 82,400 KB |
| 実行使用メモリ | 74,292 KB |
| 最終ジャッジ日時 | 2024-07-26 15:51:26 |
| 合計ジャッジ時間 | 1,540 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 4 |
ソースコード
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))])
for i in range(len(points)):
xi, yi = points[i]
dist_i = xi ** 2 + yi ** 2
cnt = [0, 0]
for j in range(len(points)):
xj, yj = points[j]
dist_j = xj ** 2 + yj ** 2
# if i == j : continue
if dist_j < dist_i:
cnt[0] += 1
if dist_j <= dist_i:
cnt[1] += 1
if cnt[0] < K and cnt[1] >= K:
print("Yes")
print(xi, xj)
break
else:
print("No")