結果

問題 No.3625 Find Superfibonacci Number
コンテスト
ユーザー 👑 cologne
提出日時 2026-10-02 13:45:15
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 68 ms / 2,000 ms
+ 228µs
コード長 1,109 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 67 ms
コンパイル使用メモリ 82,852 KB
実行使用メモリ 88,012 KB
最終ジャッジ日時 2026-10-02 13:45:23
合計ジャッジ時間 2,680 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
from fractions import Fraction

from typing import List, Tuple

int1 = lambda x: int(x) - 1
input = lambda: sys.stdin.readline().rstrip('\n')
ii = lambda: int(input())
vi = lambda: list(map(int, input().split()))
vi1 = lambda: list(map(int1, input().split()))


def dbg(*args, **kwargs):
    print(*(repr(arg) for arg in args), *(f'{k}: {repr(v)}' for k, v in kwargs.items()),
          sep='; ', file=sys.stderr, flush=True)


def main():
    t = ii()
    for _ in range(t):
        n = ii()
        if n <= 17:
            for i in range(100, 999):
                a, b, c = str(i)
                if int(a) > int(b) + int(c) and int(a) + int(b) + int(c) == n:
                    print(i)
                    break
            continue

        rem = (n - 17) % 9
        if rem == 0:
            print('908' + '9' * ((n - 17) // 9))
        else:
            print(str(rem) + '908' + '9' * ((n - 17 - rem) // 9))


def _start():
    if (ret := main()) is not None:
        print(*ret) if isinstance(ret, List) or isinstance(ret, Tuple) else print(ret)


if __name__ == '__main__':
    _start()
0