結果
問題 | No.2493 K-th in L2 with L1 |
ユーザー |
![]() |
提出日時 | 2023-10-06 21:33:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 94 ms / 2,000 ms |
コード長 | 808 bytes |
コンパイル時間 | 288 ms |
コンパイル使用メモリ | 82,444 KB |
実行使用メモリ | 74,520 KB |
最終ジャッジ日時 | 2024-07-26 15:48:52 |
合計ジャッジ時間 | 1,069 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 |
ソースコード
#############################################################import syssys.setrecursionlimit(10**7)from heapq import heappop,heappushfrom collections import deque,defaultdict,Counterfrom bisect import bisect_left, bisect_rightfrom itertools import product,combinations,permutationsipt = sys.stdin.readlinedef iin():return int(ipt())def lmin():return list(map(int,ipt().split()))MOD = 998244353#############################################################M = 110for _ in range(iin()):D,K = lmin()ans = []for i in range(-M,M):for j in range(-M,M):if abs(i)+abs(j) == D:ans.append((i**2+j**2,i,j))if len(ans) < K:print("No")else:ans.sort()print("Yes")print(*ans[K-1][1:])