結果
| 問題 | No.501 穴と文字列 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-07 22:38:21 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 2,000 ms |
| コード長 | 318 bytes |
| コンパイル時間 | 172 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 7,296 KB |
| 最終ジャッジ日時 | 2024-12-14 16:20:33 |
| 合計ジャッジ時間 | 1,228 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#!/usr/bin/python2
# -*- coding: utf-8 -*-
# †
n, d = map(int, raw_input().split())
v = [0] * n
for loop in xrange(2):
for i in xrange(n):
if d > 0:
v[i] += 1
d -= 1
cand1 = ''.join('CAB'[x] for x in v)
cand2 = cand1[::-1]
res = cand1
if cand1 > cand2:
res = cand2
print res