結果

問題 No.501 穴と文字列
ユーザー TatsunoTatsuno
提出日時 2017-04-07 23:44:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 504 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 76,264 KB
最終ジャッジ日時 2023-08-21 07:12:47
合計ジャッジ時間 2,969 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
76,264 KB
testcase_01 AC 73 ms
75,880 KB
testcase_02 AC 72 ms
71,324 KB
testcase_03 AC 69 ms
71,312 KB
testcase_04 AC 71 ms
71,308 KB
testcase_05 AC 69 ms
71,384 KB
testcase_06 AC 69 ms
71,356 KB
testcase_07 AC 68 ms
71,032 KB
testcase_08 AC 68 ms
71,304 KB
testcase_09 AC 68 ms
71,280 KB
testcase_10 AC 68 ms
71,484 KB
testcase_11 AC 68 ms
71,512 KB
testcase_12 AC 68 ms
71,312 KB
testcase_13 AC 68 ms
71,148 KB
testcase_14 AC 68 ms
71,044 KB
testcase_15 AC 68 ms
71,452 KB
testcase_16 AC 68 ms
71,456 KB
testcase_17 AC 67 ms
71,108 KB
testcase_18 AC 73 ms
76,232 KB
testcase_19 AC 69 ms
71,840 KB
testcase_20 AC 74 ms
76,212 KB
testcase_21 AC 72 ms
76,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,d=map(int,input().split())
t = n*2
ans = ['B']*n
for i in range(n):
    if t == d: break
    ans[i] = 'A'
    t -= 1
for i in range(n-1, -1, -1):
    if t == d: break
    ans[i] = 'C'
    t -=1
print(''.join(ans))
0