結果
| 問題 |
No.254 文字列の構成
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-07-18 08:52:33 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 357 bytes |
| コンパイル時間 | 167 ms |
| コンパイル使用メモリ | 82,076 KB |
| 実行使用メモリ | 69,504 KB |
| 最終ジャッジ日時 | 2024-09-18 08:21:55 |
| 合計ジャッジ時間 | 7,203 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 1 WA * 29 |
ソースコード
N = int(input())
ans = []
def f(x):
yes = 0
no = 10 ** 5
while no - yes != 1:
mid = (yes + no)//2
if mid * (mid + 1)//2 <= x:
yes = mid
else:
no = mid
return yes
now = 0
while N:
M = f(N)
N -= M * (M + 1)//2
ans.extend([chr(now + ord("a"))] * M)
now += 1
print(*ans, sep="")
rlangevin