結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー monnumonnu
提出日時 2021-12-02 21:01:21
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 182 ms / 2,000 ms
コード長 653 bytes
コンパイル時間 3,685 ms
コンパイル使用メモリ 231,560 KB
実行使用メモリ 6,576 KB
最終ジャッジ日時 2023-09-18 10:37:56
合計ジャッジ時間 14,854 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 92 ms
4,608 KB
testcase_17 AC 168 ms
6,180 KB
testcase_18 AC 128 ms
5,388 KB
testcase_19 AC 52 ms
4,376 KB
testcase_20 AC 59 ms
4,380 KB
testcase_21 AC 182 ms
6,412 KB
testcase_22 AC 178 ms
6,448 KB
testcase_23 AC 180 ms
6,392 KB
testcase_24 AC 178 ms
6,452 KB
testcase_25 AC 178 ms
6,412 KB
testcase_26 AC 178 ms
6,500 KB
testcase_27 AC 178 ms
6,568 KB
testcase_28 AC 179 ms
6,408 KB
testcase_29 AC 178 ms
6,440 KB
testcase_30 AC 178 ms
6,568 KB
testcase_31 AC 178 ms
6,460 KB
testcase_32 AC 178 ms
6,396 KB
testcase_33 AC 176 ms
6,576 KB
testcase_34 AC 179 ms
6,504 KB
testcase_35 AC 180 ms
6,396 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<int>>;
#define INF 1000000000
#define MOD 998244353
#define MAX 1000000

int main(){
  int N,K;
  cin>>N>>K;
  vector<int> A(N),B(N);
  vector<pair<int,int>> diff(N);
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  for(int i=0;i<N;i++){
    cin>>B[i];
  }
  for(int i=0;i<N;i++){
    diff[i].first=B[i]-A[i];
    diff[i].second=i;
  }
  sort(diff.begin(),diff.end());

  vector<char> ans(N,'B');
  for(int i=0;i<K;i++){
    ans[diff[i].second]='A';
  }
  for(int i=0;i<N;i++){
    cout<<ans[i];
  }
  cout<<'\n';

}
0