結果
問題 |
No.501 穴と文字列
|
ユーザー |
![]() |
提出日時 | 2020-07-23 09:08:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 435 bytes |
コンパイル時間 | 1,640 ms |
コンパイル使用メモリ | 167,096 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 17:19:13 |
合計ジャッジ時間 | 2,613 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; typedef unsigned long long ull; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n, d; cin >> n >> d; string ans; if(d <= n){ rep(i, d) ans.push_back('A'); rep(i, n - d) ans.push_back('C'); }else{ rep(i, 2 * n - d) ans.push_back('A'); rep(i, d - n) ans.push_back('B'); } cout << ans << endl; }