結果
問題 | No.501 穴と文字列 |
ユーザー |
![]() |
提出日時 | 2020-03-22 13:05:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 415 bytes |
コンパイル時間 | 1,856 ms |
コンパイル使用メモリ | 166,404 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 17:22:33 |
合計ジャッジ時間 | 2,341 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }