結果

問題 No.2493 K-th in L2 with L1
ユーザー KudeKude
提出日時 2023-10-06 21:33:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 75,664 KB
最終ジャッジ日時 2023-10-06 21:33:59
合計ジャッジ時間 1,324 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,372 KB
testcase_01 AC 75 ms
75,564 KB
testcase_02 AC 76 ms
75,664 KB
testcase_03 AC 77 ms
75,596 KB
testcase_04 AC 70 ms
71,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    d, k = map(int, input().split())
    j = d // 2
    i = d - j
    c = 0
    found = False
    while i <= d:
        if i == j == 0:
            c += 1
        elif i == j or i == d:
            c += 4
        else:
            c += 8
        if c >= k:
            print('Yes')
            print(i, j)
            found = True
            break
        i += 1
        j -= 1
    if not found:
        print('No')
0