結果
| 問題 | No.254 文字列の構成 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-10 09:37:10 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 77 ms / 5,000 ms |
| + 730µs | |
| コード長 | 409 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2026-10-05 16:27:59 |
| 合計ジャッジ時間 | 3,620 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
import itertools
from math import isqrt
N = int(input())
ans = ''
sqN = isqrt(N)
it_ab = itertools.cycle('ab')
for _ in range(sqN * 2 - 1):
ans += next(it_ab)
N -= sqN ** 2
sqN = isqrt(N)
it_ab = itertools.cycle('cd')
for _ in range(sqN * 2 - 1):
ans += next(it_ab)
N -= sqN ** 2
it_xyz = itertools.cycle('xyz')
for _ in range(N):
ans += next(it_xyz)
# assert len(ans) <= 10 ** 5
print(ans)