結果

問題 No.501 穴と文字列
ユーザー minrminr
提出日時 2020-03-28 17:13:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,752 KB
実行使用メモリ 8,360 KB
最終ジャッジ日時 2023-08-30 18:01:31
合計ジャッジ時間 1,628 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
7,816 KB
testcase_02 AC 14 ms
7,864 KB
testcase_03 AC 14 ms
7,788 KB
testcase_04 AC 14 ms
7,736 KB
testcase_05 AC 14 ms
7,868 KB
testcase_06 AC 15 ms
7,824 KB
testcase_07 AC 15 ms
7,820 KB
testcase_08 AC 15 ms
7,868 KB
testcase_09 AC 15 ms
7,772 KB
testcase_10 WA -
testcase_11 AC 15 ms
7,724 KB
testcase_12 AC 15 ms
7,700 KB
testcase_13 AC 15 ms
7,724 KB
testcase_14 WA -
testcase_15 AC 15 ms
7,872 KB
testcase_16 AC 15 ms
7,744 KB
testcase_17 AC 15 ms
7,700 KB
testcase_18 AC 15 ms
8,180 KB
testcase_19 AC 15 ms
8,192 KB
testcase_20 WA -
testcase_21 AC 15 ms
8,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D = map(int,input().split())
S = ""
cnt_a = 0
cnt_b = 0
cnt_c = 0
if D == 0:
    S = 'C' * N
elif D == 1:
    S = 'A' + 'C' * (N-1)
elif D >= 2:
    cnt_a = N - (D - N)
    cnt_b = (D - cnt_a) // 2
    cnt_c = N - cnt_a - cnt_b
    S = 'A'*cnt_a + 'B' * cnt_b + 'C'*cnt_c
print(S)
0