結果

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

テストケース

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

ソースコード

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>0) {
		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