結果
| 問題 | No.254 文字列の構成 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-16 14:20:38 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 298 bytes |
| 記録 | |
| コンパイル時間 | 475 ms |
| コンパイル使用メモリ | 77,220 KB |
| 最終ジャッジ日時 | 2025-12-03 23:16:02 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 22 |
ソースコード
from string import ascii_lowercase
N = input()
S = ''
p = 0
alp = ascii_lowercase[2:]
while N > 0:
N -= 1
S += 'a'
i = 3
while i <= N:
S += 'ba'
N -= i
i += 2
if N > 0:
S += alp[p]
p = (p + 1) % 254
N -= 1
print S