結果
問題 | No.600 かい文回 |
ユーザー |
|
提出日時 | 2021-09-26 10:09:30 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 762 bytes |
コンパイル時間 | 146 ms |
コンパイル使用メモリ | 82,252 KB |
実行使用メモリ | 67,556 KB |
最終ジャッジ日時 | 2024-07-05 15:35:06 |
合計ジャッジ時間 | 4,760 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 21 |
ソースコード
import sysinput = 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 = nll = []while n>2:ll.append(n%2)if n%2:n -= 1else:n = (n-2)//2c = 0ans = [c]l = []for item in ll[::-1]:c += 1c %= 26if 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))assert n0==sub(ans)return ansans = main(n)print(ans)