結果

問題 No.501 穴と文字列
ユーザー kurenai3110kurenai3110
提出日時 2017-04-07 22:29:04
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 673 ms
コンパイル使用メモリ 59,256 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-14 16:18:51
合計ジャッジ時間 1,278 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
	long long n;
	cin >> n;

	int d; cin >> d;

	for (int i = 0; i < n;i++) {
		if (d >= 2 * (n-i)) {
			cout << 'B';
			d -= 2;
		}
		else if (d) {
			cout << 'A';
			d--;
		}
		else cout << 'C';
	}
	cout << endl;

    return 0;
}

0