結果
問題 | No.254 文字列の構成 |
ユーザー |
|
提出日時 | 2016-11-14 11:31:27 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 12 ms / 5,000 ms |
コード長 | 408 bytes |
コンパイル時間 | 225 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,656 KB |
最終ジャッジ日時 | 2024-11-25 22:16:20 |
合計ジャッジ時間 | 1,613 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
import mathn = input()string_length_limit = 100000alpha = 0result = ""while True:if n < string_length_limit:breakrt = int(math.sqrt(n))add = ((chr(97+alpha)+chr(97+alpha+1))*rt)[:-1]alpha += 2string_length_limit -= len(add)result += addn -= rt*rtadd = chr(97+alpha)+chr(97+alpha+1)+chr(97+alpha+2)alpha += 3result += add*(n/3) + add[:n%3]print result