結果
問題 | No.501 穴と文字列 |
ユーザー |
![]() |
提出日時 | 2017-04-08 22:21:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 398 bytes |
コンパイル時間 | 760 ms |
コンパイル使用メモリ | 71,292 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-14 16:30:47 |
合計ジャッジ時間 | 1,551 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <iostream> #include <cstdlib> #include <algorithm> #include <iomanip> using namespace std; typedef long long ll; int main() { int n,d; cin>>n>>d; int p=n-d; string res; if(p>=0){ res+=string(n-p,'A'); res+=string(p,'C'); } else{ p=-p; res+=string(n-p,'A'); res+=string(p,'B'); } cout<<res<<endl; return 0; }