結果

問題 No.501 穴と文字列
ユーザー tancahn2380tancahn2380
提出日時 2017-04-27 05:55:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 564 ms
コンパイル使用メモリ 72,008 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 15:27:57
合計ジャッジ時間 1,565 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,352 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 1 ms
4,352 KB
testcase_18 WA -
testcase_19 AC 3 ms
4,348 KB
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<string>


int main() {
	int n, d;
	std::cin >> n >> d;
	std::string s;
	int a = 0, b = 0, c = 0;
	b = d / 2;
	if (d % 2 == 1) {
		a = 1;
	}
	c = n - a - b;
	while (c>1) {
		b--;
		c--;
		a += 2;
	}
	for (int i = 0; i < a; i++) {
		std::cout << "A";
	}
	for (int i = 0; i < b; i++) {
		std::cout << "B";
	}
	for (int i = 0; i < c; i++) {
		std::cout << "C";
	}
	std::cout << std::endl;
}
0