結果

問題 No.254 文字列の構成
ユーザー TatamoTatamo
提出日時 2016-11-14 11:28:37
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 551 ms
コンパイル使用メモリ 6,692 KB
実行使用メモリ 6,348 KB
最終ジャッジ日時 2023-08-17 04:36:56
合計ジャッジ時間 5,897 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,088 KB
testcase_01 AC 12 ms
6,180 KB
testcase_02 AC 12 ms
6,100 KB
testcase_03 AC 12 ms
6,164 KB
testcase_04 AC 12 ms
6,104 KB
testcase_05 AC 12 ms
6,152 KB
testcase_06 AC 12 ms
6,104 KB
testcase_07 AC 12 ms
6,092 KB
testcase_08 AC 12 ms
6,176 KB
testcase_09 AC 12 ms
6,128 KB
testcase_10 AC 12 ms
6,208 KB
testcase_11 AC 12 ms
6,128 KB
testcase_12 AC 12 ms
6,008 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 WA -
testcase_29 RE -
testcase_30 RE -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

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