結果
| 問題 |
No.254 文字列の構成
|
| コンテスト | |
| ユーザー |
eitaho
|
| 提出日時 | 2015-08-20 23:43:48 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 96 ms / 5,000 ms |
| コード長 | 258 bytes |
| コンパイル時間 | 71 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-07-18 11:01:16 |
| 合計ジャッジ時間 | 2,972 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
import math
N = int(input())
ans = ""
chs = [chr(ord('a') + i) for i in range(26)]
ci = 0
while N > 0:
sqrt = int(math.sqrt(N))
len = sqrt * 2 - 1
for i in range(len):
ans += chs[ci + i % 2]
ci += 2
N -= sqrt * sqrt
print(ans)
eitaho