結果
| 問題 |
No.254 文字列の構成
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-07-18 12:10:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 5,000 ms |
| コード長 | 414 bytes |
| コンパイル時間 | 280 ms |
| コンパイル使用メモリ | 82,460 KB |
| 実行使用メモリ | 76,720 KB |
| 最終ジャッジ日時 | 2024-09-18 11:32:35 |
| 合計ジャッジ時間 | 3,527 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
N = int(input())
ans = []
def f(x):
yes = 0
no = 10 ** 5
while no - yes != 1:
mid = (yes + no)//2
if mid * mid <= x:
yes = mid
else:
no = mid
return yes
now = 0
while N:
M = f(N)
N -= M * M
L = [chr(now + ord("a")), chr(now + ord("a") + 1)] * (M - 1)
L.append(chr(now + ord("a")))
ans.extend(L)
now += 2
print(*ans, sep="")
rlangevin