結果
| 問題 | No.254 文字列の構成 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-14 11:28:37 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 410 bytes |
| 記録 | |
| コンパイル時間 | 203 ms |
| コンパイル使用メモリ | 77,396 KB |
| 最終ジャッジ日時 | 2025-12-03 22:43:45 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 WA * 10 RE * 9 |
ソースコード
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