結果
| 問題 |
No.501 穴と文字列
|
| コンテスト | |
| ユーザー |
brthyyjp
|
| 提出日時 | 2021-09-05 13:56:47 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 46 ms / 2,000 ms |
| コード長 | 282 bytes |
| コンパイル時間 | 319 ms |
| コンパイル使用メモリ | 82,460 KB |
| 実行使用メモリ | 67,556 KB |
| 最終ジャッジ日時 | 2024-12-21 18:05:00 |
| 合計ジャッジ時間 | 2,743 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
n, d = map(int, input().split())
YZX = []
for z in reversed(range(n+1)):
x = n-d+z
y = d-2*z
if x >= 0 and y >= 0:
#s = 'A'*y+'B'*z+'C'*x
YZX.append((y, z, x))
YZX.sort(key=lambda x: (-x[0], -x[1], -x[2]))
y, z, x = YZX[0]
s = 'A'*y+'B'*z+'C'*x
print(s)
brthyyjp