結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー Nzt3
提出日時 2022-09-28 13:17:49
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 550 bytes
コンパイル時間 2,201 ms
コンパイル使用メモリ 204,316 KB
最終ジャッジ日時 2025-02-07 17:50:35
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N,K;
  cin>>N>>K;
  vector<array<long long,2>>A(N);
  for(auto &i:A)cin>>i[0];
  for(auto &i:A)cin>>i[1];
  long long s=0;
  for(int i=0;i<N;i++)s+=A[i][1];
  vector<pair<long long,int>>D(N);
  for(int i=0;i<N;i++){
    D[i]={A[i][0]-A[i][1],i};
  }
  sort(D.begin(),D.end());
  reverse(D.begin(),D.end());
  vector<bool>B(N,true);
  for(int i=0;i<K;i++){
    B[D[i].second]=false;
  }
  for(auto i:B)cout<<(i?'B':'A');
  cout<<'\n';
}
0