結果
| 問題 |
No.501 穴と文字列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-21 21:17:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 402 bytes |
| コンパイル時間 | 417 ms |
| コンパイル使用メモリ | 58,104 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-14 16:35:28 |
| 合計ジャッジ時間 | 1,202 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int N, D;
cin >> N >> D;
int b = max(D - N, 0);
int c = max(N - D, 0);
int a = N - b - c;
string s = "";
for (int i = 0; i < a; i++) {
s += 'A';
}
for (int i = 0; i < b; i++) {
s += 'B';
}
for (int i = 0; i < c; i++) {
s += 'C';
}
cout << s << endl;
return 0;
}