結果

問題 No.501 穴と文字列
ユーザー Naoyk1212
提出日時 2017-04-07 23:50:33
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 1,586 ms
コンパイル使用メモリ 158,176 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-14 16:27:53
合計ジャッジ時間 2,129 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
	int n, d;
	cin >> n >> d;
	int tmp = d - n;
	if(tmp == 0){
		for(int i = 0; i < n; i++){
			cout << "A";
		}
	}else if(tmp > 0){
		for(int i = 0; i < n - tmp; i++){
			cout << "A";
		}
		for(int i = 0; i < tmp; i++){
			cout << "B";
		}
	}else{
		for(int i = 0; i < n - abs(tmp); i++){
			cout << "A";
		}
		for(int i = 0; i < abs(tmp); i++){
			cout << "C";
		}
	}
	cout << endl;
}
0