結果
| 問題 | No.501 穴と文字列 |
| コンテスト | |
| ユーザー |
ldsyb
|
| 提出日時 | 2017-04-07 23:24:36 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 289 bytes |
| 記録 | |
| コンパイル時間 | 519 ms |
| コンパイル使用メモリ | 75,000 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-25 09:49:53 |
| 合計ジャッジ時間 | 1,768 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream>
using namespace std;
int main(){
int n, d;
cin >> n >> d;
if(n > d){
cout << string(d, 'A') << string(n - d, 'C') << endl;
return 0;
}
string s = string(max(0, n - (d - n)), 'A') + string(max(0, d - n), 'B');
cout << s << string(n - s.size(), 'C') << endl;
}
ldsyb