結果
問題 | No.501 穴と文字列 |
ユーザー |
![]() |
提出日時 | 2018-01-05 22:20:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 575 bytes |
コンパイル時間 | 899 ms |
コンパイル使用メモリ | 74,120 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 06:45:40 |
合計ジャッジ時間 | 1,928 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <string> #include <sstream> #include <cmath> #include <stack> #include <cctype> using namespace std; int main() { int n = 0, d = 0; cin >> n >> d; int A = 0, B = 0, C = 0; if (d - n > 0) { A = n - (d - n); B = d - n; } else if (d - n == 0) { A = n; } else if (d - n < 0) { A = d; C = n - d; } for (int i = 0; i < A; i++) { cout << "A"; } for (int i = 0; i < B; i++) { cout << "B"; } for (int i = 0; i < C; i++) { cout << "C"; } cout<<endl; return 0; }