結果

問題 No.254 文字列の構成
コンテスト
ユーザー Tatamo
提出日時 2016-11-14 11:25:41
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 423 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 129 ms
コンパイル使用メモリ 77,344 KB
最終ジャッジ日時 2025-12-03 22:43:39
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11 WA * 10 RE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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