結果

問題 No.501 穴と文字列
ユーザー 777yuuki12323
提出日時 2017-04-08 00:03:05
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 637 bytes
コンパイル時間 496 ms
コンパイル使用メモリ 60,180 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 16:29:31
合計ジャッジ時間 1,292 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <map>


typedef long long ll;
#define fi first
#define se second

using namespace std;

int N;
int D;

#define mod  1000000000000
            //123456789012
int main(){
  
  cin>>N>>D;
  
  int s;
  int i;
  
  s = N - D;
  
  if( s > 0 ){
    for( i = 0; i < D; i++ ){
      printf("A");
    }
    for( i = 0; i < s; i++ ){
      printf("C");
    }
    puts("");
  }
  else{
    s *= -1;
    D = N - s;
    for( i = 0; i < D; i++ ){
      printf("A");
    }
    for( i = 0; i < s; i++ ){
      printf("B");
    }
    puts("");
  }
  
  
  return 0;
}
0