結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー 沙耶花沙耶花
提出日時 2021-10-29 21:31:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 4,648 ms
コンパイル使用メモリ 255,980 KB
最終ジャッジ日時 2025-01-25 08:31:46
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 10000000000000000

int main(){
	
	int N,K;
	cin>>N>>K;
	
	vector<pair<long long,int>> v(N);
	vector<long long> a(N),b(N);
	rep(i,N)cin>>a[i];
	rep(i,N)cin>>b[i];
	rep(i,N){
		v[i] = make_pair(a[i]-b[i],i);
	}
	sort(v.rbegin(),v.rend());
	
	string ans(N,'B');
	rep(i,K){
		ans[v[i].second] = 'A';
	}
	cout<<ans<<endl;
	
	
	return 0;
}
0