結果
問題 | No.501 穴と文字列 |
ユーザー |
![]() |
提出日時 | 2020-02-09 10:35:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 415 bytes |
コンパイル時間 | 1,588 ms |
コンパイル使用メモリ | 168,576 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-01 05:47:26 |
合計ジャッジ時間 | 2,548 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int N, D; scanf("%d %d", &N, &D); string ans = ""; if (D > N) { int n = D - N; for (int i = 0; i < N; ++i) { if (i < N - n) ans += 'A'; else ans += 'B'; } } else { for (int i = 0; i < N; ++i) { if (i < D) ans += 'A'; else ans += 'C'; } } cout << ans << endl; return 0; }