結果
問題 | No.501 穴と文字列 |
ユーザー |
|
提出日時 | 2017-04-11 19:34:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 603 bytes |
コンパイル時間 | 1,643 ms |
コンパイル使用メモリ | 167,252 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 16:31:54 |
合計ジャッジ時間 | 2,460 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second int main() { int n,d; cin >>n >>d; string ans=""; if(n<=d) { int b=d-n; rep(i,n-b) ans+="A"; rep(i,b) ans+="B"; } else { int c=n-d; rep(i,n-c) ans+="A"; rep(i,c) ans+="C"; } cout << ans << endl; return 0; }