結果
| 問題 |
No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2021-10-29 21:29:16 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 85 ms / 2,000 ms |
| コード長 | 557 bytes |
| コンパイル時間 | 2,106 ms |
| コンパイル使用メモリ | 204,664 KB |
| 最終ジャッジ日時 | 2025-01-25 08:27:55 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n,k;
cin>>n>>k;
vector<ll> A(n),B(n);
rep(i,n) cin>>A[i];
rep(i,n) cin>>B[i];
vector<pair<ll,ll>> P(n);
rep(i,n) P[i]={A[i]-B[i],i};
sort(ALL(P));
reverse(ALL(P));
vector<int> D(n);
rep(i,k) D[P[i].second]=1;
rep(i,n){
if(D[i]) cout<<'A';
else cout<<'B';
}
cout<<endl;
return 0;
}
umezo