結果

問題 No.501 穴と文字列
コンテスト
ユーザー bal4u
提出日時 2019-04-18 08:58:19
言語 C
(gcc 15.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 533 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 256 ms
コンパイル使用メモリ 38,752 KB
最終ジャッジ日時 2026-02-22 03:03:12
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

// yukicoder: No.501 穴と文字列
// 2019.4.18 bal4u

#include <stdio.h>
#include <string.h>

#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
int in()
{
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void outs(int w, int c) { while (w--) pc(c); }

int main()
{
	int N, D;
	N = in(), D = in();
	if (D > N) outs(2*N - D, 'A'), outs(D-N, 'B');
	else outs(D, 'A'), outs(N-D, 'C');
	pc('\n');
	return 0;
}
0