結果

問題 No.600 かい文回
ユーザー shotoyooshotoyoo
提出日時 2021-09-26 10:09:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 738 bytes
コンパイル時間 424 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 71,288 KB
最終ジャッジ日時 2023-09-19 02:49:42
合計ジャッジ時間 3,253 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
70,936 KB
testcase_01 AC 73 ms
71,160 KB
testcase_02 AC 74 ms
71,248 KB
testcase_03 AC 76 ms
71,108 KB
testcase_04 AC 73 ms
71,064 KB
testcase_05 AC 71 ms
71,036 KB
testcase_06 AC 73 ms
71,248 KB
testcase_07 AC 73 ms
71,212 KB
testcase_08 AC 71 ms
71,288 KB
testcase_09 AC 74 ms
71,176 KB
testcase_10 AC 72 ms
71,064 KB
testcase_11 AC 73 ms
71,104 KB
testcase_12 AC 74 ms
71,188 KB
testcase_13 AC 74 ms
71,244 KB
testcase_14 AC 74 ms
71,064 KB
testcase_15 AC 74 ms
71,224 KB
testcase_16 AC 73 ms
71,204 KB
testcase_17 AC 74 ms
70,988 KB
testcase_18 AC 73 ms
71,248 KB
testcase_19 AC 74 ms
71,076 KB
testcase_20 AC 74 ms
71,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
writef = lambda x: print("{:.12f}".format(x))


n = int(input())
def main(n):
    n0 = n
    ll = []
    while n>2:
        ll.append(n%2)
        if n%2:
            n -= 1
        else:
            n = (n-2)//2
    c = 0
    ans = [c]
    l = []
    for item in ll[::-1]:
        c += 1
        c %= 26
        if not item:
            l.extend([c,c])
        else:
            l.extend([c])
    l = l[::-1]
    if n==1:
        ans = [0]
    else:
        ans = [0,0]
    ans = l + ans + l[::-1]
    ans = "".join(map(lambda c: chr(c+ord("a")), ans))
    return ans
ans = main(n)
print(ans)
0