結果

問題 No.254 文字列の構成
ユーザー TatamoTatamo
提出日時 2016-11-14 11:25:41
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 423 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-11-25 22:15:58
合計ジャッジ時間 4,930 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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]
    print add
    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