結果
問題 | No.501 穴と文字列 |
ユーザー |
|
提出日時 | 2017-04-07 23:11:30 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 487 bytes |
コンパイル時間 | 627 ms |
コンパイル使用メモリ | 67,620 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 16:25:14 |
合計ジャッジ時間 | 1,306 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <iostream>#include <math.h>#include <queue>using namespace std;int n, d, b = 0;queue<char> Q;int main(){cin >> n >> d;if (d <= n){for (int i = 0; i < d; i++){Q.push('A');}for (int i = 0; i < n - d; i++){Q.push('C');}}else{b = d - n;for (int i = 0; i < n - b; i++){Q.push('A');}for (int i = 0; i < b; i++){Q.push('B');}}for (int i = 0; i < n; i++){cout << Q.front();Q.pop();}cout << endl;return 0;}