結果

問題 No.2493 K-th in L2 with L1
ユーザー 👑 timitimi
提出日時 2023-10-06 22:04:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 104,260 KB
最終ジャッジ日時 2023-10-06 22:04:13
合計ジャッジ時間 3,082 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 221 ms
92,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Q=int(input())

D={};A=[]
for i in range(-200,201):
  for j in range(-200,201):
    d=abs(i)+abs(j)
    if d not in D:
      D[d]=[]
    D[d].append((i**2+j**2,i,j))
    A.append(d)
for d in D:
  D[d]=sorted(D[d])

import bisect
for _ in range(Q):
  d,k=map(int, input().split())
  if len(D[d])<k:
    print('No')
  else:
    print('Yes')
    print(D[d][-1][-2],D[d][-1][-1])
0