結果

問題 No.254 文字列の構成
ユーザー TatamoTatamo
提出日時 2016-11-14 11:28:37
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 6,784 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-11-25 22:16:02
合計ジャッジ時間 4,311 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11 WA * 10 RE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = input()
string_length_limit = 100000
alpha = 0
result = ""
while True:
    if n < string_length_limit:
        break
    rt = int(math.sqrt(n))
    add = ((chr(97+alpha)+chr(97+alpha+1))*2*rt)[:-1]
    alpha += 2
    string_length_limit -= len(add)
    result += add
    n -= rt*rt

add = chr(97+alpha)+chr(97+alpha+1)+chr(97+alpha+2)
alpha += 3
result += add*(n/3) + add[:n%3]

print result

0