結果

問題 No.2198 Concon Substrings (COuNt-CONstruct Version)
コンテスト
ユーザー strangerxxx
提出日時 2023-01-20 23:15:44
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 841 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 439 ms
コンパイル使用メモリ 85,656 KB
実行使用メモリ 86,352 KB
最終ジャッジ日時 2026-03-08 05:32:54
合計ジャッジ時間 13,973 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 47 WA * 57
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def resolve():
    import sys

    input = sys.stdin.readline
    MOD = 998244353
    INF = float("inf")
    m = int(input())
    if m == 0:
        print("a")
        return
    print("co", end="")
    x = m
    dp = [1, 1, 0]
    y = 1
    while x:
        b = 1 << int(y**0.5).bit_length()
        if y > 2:
            while dp[0] < b:
                print("c", end="")
                dp[0] += 1
            while dp[1] < y:
                print("o", end="")
                dp[1] += dp[0]
        if x & 1:
            print("n", end="")
            dp[2] += dp[1]

        if y == 1:
            print("o", end="")
            dp[1] += 1
        elif y == 2:
            print("co", end="")
            dp[0] += 1
            dp[1] += dp[0]
        x >>= 1
        y <<= 1
    # print(dp)


if __name__ == "__main__":
    resolve()
0