結果

問題 No.2493 K-th in L2 with L1
コンテスト
ユーザー Kude
提出日時 2023-10-06 21:33:58
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 446 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 180 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 58,752 KB
最終ジャッジ日時 2026-04-03 17:30:43
合計ジャッジ時間 1,072 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge5_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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