結果
| 問題 | No.501 穴と文字列 |
| コンテスト | |
| ユーザー |
task4233
|
| 提出日時 | 2018-04-01 19:41:36 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,328 bytes |
| コンパイル時間 | 2,155 ms |
| コンパイル使用メモリ | 159,808 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 05:44:38 |
| 合計ジャッジ時間 | 2,638 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
// ------------------------------------
// Date:2018/ 4/ 1
// Problem:No.501 穴と文字列 / 0501.cpp
//
// ------------------------------------
#include <bits/stdc++.h>
using namespace std;
#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
string ans;
CIN(N, D);
/*
if (D == 0) {
ans = string(N, 'C');
} else
*/
{
int bNum = max(0, D - N);
int aNum = max(0, D - bNum * 2);
ans = string(aNum, 'A');
ans += string(bNum, 'B');
// debug(aNum);
// debug(bNum);
ans += string(N - bNum - aNum, 'C');
}
cout << ans << endl;
return 0;
}
task4233