結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー CleyLCleyL
提出日時 2022-07-26 11:30:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 1,766 bytes
コンパイル時間 1,181 ms
コンパイル使用メモリ 116,996 KB
実行使用メモリ 6,716 KB
最終ジャッジ日時 2023-09-23 04:18:26
合計ジャッジ時間 11,699 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,384 KB
testcase_16 AC 40 ms
4,984 KB
testcase_17 AC 71 ms
6,196 KB
testcase_18 AC 55 ms
5,532 KB
testcase_19 AC 23 ms
4,376 KB
testcase_20 AC 25 ms
4,376 KB
testcase_21 AC 76 ms
6,492 KB
testcase_22 AC 76 ms
6,388 KB
testcase_23 AC 75 ms
6,460 KB
testcase_24 AC 76 ms
6,444 KB
testcase_25 AC 75 ms
6,460 KB
testcase_26 AC 76 ms
6,460 KB
testcase_27 AC 75 ms
6,444 KB
testcase_28 AC 76 ms
6,560 KB
testcase_29 AC 75 ms
6,516 KB
testcase_30 AC 75 ms
6,712 KB
testcase_31 AC 75 ms
6,388 KB
testcase_32 AC 77 ms
6,456 KB
testcase_33 AC 75 ms
6,544 KB
testcase_34 AC 78 ms
6,508 KB
testcase_35 AC 79 ms
6,716 KB
testcase_36 AC 1 ms
4,376 KB
testcase_37 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//yukicoder@cpp17

#include <iostream>

#include <cmath>
#include <algorithm>

#include <iomanip>

#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>

#include <bitset>

#include <complex>

#include <cctype>
#include <utility>
#include <climits>

#include <numeric>

using namespace std;
using ll = long long;
using P = pair<ll,ll>;

const ll MOD = 998244353;
const ll MODx = 1000000007;
const int INF = (1<<30)-1;
const ll LINF = (1LL<<62LL)-1;
const double EPS = (1e-10);

P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};




template <typename T> vector<T> make_vector(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_vector(size_t a, Ts... ts) { return vector<decltype(make_vector(ts...))>(a, make_vector(ts...)); }
 
 /*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる

計算量は変わらないが楽できるシリーズ
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる
*/

/*
function corner below
*/


/*
Function corner above
*/

__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}

int main(){
    int n,k;cin>>n>>k;
    vector<int> A(n),B(n);
    for(int i = 0; n > i; i++)cin>>A[i];
    for(int i = 0; n > i; i++)cin>>B[i];
    vector<pair<int,int>> C(n);
    for(int i = 0; n > i; i++)C[i] = {B[i]-A[i],i};
    sort(C.begin(),C.end());
    vector<char> ret(n,'B');
    for(int i = 0; k > i; i++)ret[C[i].second] = 'A';
    for(int i = 0; n > i; i++)cout << ret[i];
    cout << endl;
}

0