結果
問題 |
No.254 文字列の構成
|
ユーザー |
|
提出日時 | 2020-09-10 09:38:23 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 108 ms / 5,000 ms |
コード長 | 380 bytes |
コンパイル時間 | 216 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-21 16:04:43 |
合計ジャッジ時間 | 3,315 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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_cd = itertools.cycle('cd') for _ in range(sqN * 2 - 1): ans += next(it_cd) N -= sqN ** 2 it_xyz = itertools.cycle('xyz') for _ in range(N): ans += next(it_xyz) print(ans)