結果

問題 No.501 穴と文字列
ユーザー yuppe19 😺yuppe19 😺
提出日時 2017-04-07 22:38:21
言語 Python2
(2.7.18)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 6,740 KB
実行使用メモリ 6,748 KB
最終ジャッジ日時 2023-08-21 07:00:41
合計ジャッジ時間 1,465 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
6,524 KB
testcase_01 AC 24 ms
6,588 KB
testcase_02 AC 11 ms
5,984 KB
testcase_03 AC 11 ms
5,884 KB
testcase_04 AC 10 ms
5,928 KB
testcase_05 AC 10 ms
6,016 KB
testcase_06 AC 11 ms
6,016 KB
testcase_07 AC 11 ms
5,952 KB
testcase_08 AC 10 ms
5,928 KB
testcase_09 AC 11 ms
5,852 KB
testcase_10 AC 11 ms
5,860 KB
testcase_11 AC 11 ms
5,880 KB
testcase_12 AC 11 ms
5,960 KB
testcase_13 AC 10 ms
6,056 KB
testcase_14 AC 10 ms
5,860 KB
testcase_15 AC 11 ms
5,860 KB
testcase_16 AC 11 ms
5,884 KB
testcase_17 AC 11 ms
5,988 KB
testcase_18 AC 20 ms
6,540 KB
testcase_19 AC 32 ms
6,708 KB
testcase_20 AC 21 ms
6,748 KB
testcase_21 AC 30 ms
6,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/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
0