結果
| 問題 | No.254 文字列の構成 |
| コンテスト | |
| ユーザー |
eitaho
|
| 提出日時 | 2015-08-20 23:43:48 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 151 ms / 5,000 ms |
| コード長 | 258 bytes |
| 記録 | |
| コンパイル時間 | 332 ms |
| コンパイル使用メモリ | 20,692 KB |
| 実行使用メモリ | 35,924 KB |
| 最終ジャッジ日時 | 2026-04-02 03:24:08 |
| 合計ジャッジ時間 | 5,365 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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