結果
| 問題 |
No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
|
| コンテスト | |
| ユーザー |
cureskol
|
| 提出日時 | 2021-10-29 21:31:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 80 ms / 2,000 ms |
| コード長 | 544 bytes |
| コンパイル時間 | 2,286 ms |
| コンパイル使用メモリ | 187,552 KB |
| 実行使用メモリ | 8,236 KB |
| 最終ジャッジ日時 | 2024-10-07 10:08:58 |
| 合計ジャッジ時間 | 9,516 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n-1);i>=0;i--)
#define ALL(v) v.begin(),v.end()
using ll=long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n,k;cin>>n>>k;
vector<tuple<ll,ll>> v(n);
vector<int> a(n),b(n);
REP(i,n)cin>>a[i];
REP(i,n)cin>>b[i];
REP(i,n)v[i]={a[i]-b[i],i};
sort(ALL(v));
vector<char> ans(n,'A');
REP(i,n-k)ans[get<1>(v[i])]='B';
REP(i,n)cout<<ans[i];
cout<<endl;
}
cureskol