結果

問題 No.501 穴と文字列
ユーザー brthyyjpbrthyyjp
提出日時 2021-09-05 13:53:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 186 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 10,548 KB
実行使用メモリ 814,356 KB
最終ジャッジ日時 2023-08-23 14:12:31
合計ジャッジ時間 4,643 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 MLE -
testcase_02 AC 16 ms
7,760 KB
testcase_03 AC 16 ms
7,808 KB
testcase_04 AC 16 ms
7,808 KB
testcase_05 AC 15 ms
7,800 KB
testcase_06 AC 16 ms
7,836 KB
testcase_07 AC 15 ms
7,772 KB
testcase_08 AC 15 ms
7,868 KB
testcase_09 AC 15 ms
7,728 KB
testcase_10 AC 16 ms
7,908 KB
testcase_11 AC 15 ms
7,796 KB
testcase_12 AC 15 ms
7,724 KB
testcase_13 AC 15 ms
7,808 KB
testcase_14 AC 16 ms
7,776 KB
testcase_15 AC 15 ms
7,796 KB
testcase_16 AC 15 ms
7,792 KB
testcase_17 AC 15 ms
7,800 KB
testcase_18 AC 32 ms
8,112 KB
testcase_19 AC 32 ms
8,128 KB
testcase_20 AC 211 ms
227,412 KB
testcase_21 AC 365 ms
396,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d = map(int, input().split())
S = []
for z in range(n+1):
    x = n-d+z
    y = d-2*z
    if x >= 0 and y >= 0:
        s = 'A'*y+'B'*z+'C'*x
        S.append(s)
S.sort()
print(S[0])
0