結果
| 問題 |
No.254 文字列の構成
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-16 14:21:51 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 339 bytes |
| コンパイル時間 | 47 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-04 02:38:08 |
| 合計ジャッジ時間 | 3,774 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 WA * 18 |
ソースコード
from string import ascii_lowercase
N = input()
S = ''
p = 0
alp = ascii_lowercase[2:]
while N > 0:
if N > 3:
N -= 1
S += 'a'
i = 3
while i <= N:
S += 'ba'
N -= i
i += 2
if N > 0:
S += alp[p]
p = (p + 1) % 24
N -= 1
print S