結果

問題 No.3625 Find Superfibonacci Number
コンテスト
ユーザー kidodesu
提出日時 2026-08-14 21:43:18
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 74 ms / 2,000 ms
+ 842µs
コード長 466 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 223 ms
コンパイル使用メモリ 96,372 KB
実行使用メモリ 90,356 KB
最終ジャッジ日時 2026-08-14 21:43:23
合計ジャッジ時間 2,356 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def main():
    k = int(input())
    def f(m):
        if m % 2:
            ans = str((m+1)//2) + "0" + str((m-1)//2)
        else:
            ans = str((m+2)//2) + "0" + str((m-2)//2)
        return ans
    if k <= 17:
        return f(k)
    A = []
    while k > 26:
        A.append("9")
        k -= 9
    t0 = (k-17)*1000 + 908
    t1 = int(f(k-9))*10+9
    t = min(t0, t1)
    return str(t) + "".join(A[::-1])

for _ in range(int(input())):
    print(main())
0