結果
| 問題 | No.501 穴と文字列 |
| コンテスト | |
| ユーザー |
startcpp
|
| 提出日時 | 2016-07-10 18:45:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 412 bytes |
| コンパイル時間 | 547 ms |
| コンパイル使用メモリ | 54,108 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-14 16:16:21 |
| 合計ジャッジ時間 | 1,382 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
//d = nのときAAA…A, d < nのとき[d個のA]C…C, d > nのときA…A[d-n個のB], が答えになる
#include <iostream>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
int n, d;
cin >> n >> d;
if (d < n) { rep(i, d) cout << "A"; rep(i, n - d) cout << "C"; cout << endl; }
else { rep(i, 2 * n - d) cout << "A"; rep(i, d - n) cout << "B"; cout << endl; }
return 0;
}
startcpp