結果
問題 | No.501 穴と文字列 |
ユーザー |
![]() |
提出日時 | 2017-04-07 23:05:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 525 bytes |
コンパイル時間 | 1,380 ms |
コンパイル使用メモリ | 159,084 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 16:25:10 |
合計ジャッジ時間 | 1,934 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define FOR(i, n) for(int i = 0; i < (n); i++) #define MEM(a, x) memset(a, x, sizeof(a)) #define ALL(a) a.begin(), a.end() #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) typedef long long ll; int n, d; int main(int argc, char const *argv[]) { cin >> n >> d; string s; if (d == 2*n) { FOR(i, n) s += 'B'; } else if (d > n) { FOR(i, n-d%n) s += 'A'; FOR(i, d%n) s += 'B'; } else { FOR(i, d) s += 'A'; FOR(i, n-d) s += 'C'; } cout << s << endl; return 0; }