結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー hamihami
提出日時 2021-12-02 20:08:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 828 bytes
コンパイル時間 1,876 ms
コンパイル使用メモリ 172,112 KB
実行使用メモリ 6,688 KB
最終ジャッジ日時 2023-09-18 10:29:12
合計ジャッジ時間 16,736 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 91 ms
4,900 KB
testcase_17 AC 167 ms
6,132 KB
testcase_18 AC 127 ms
5,576 KB
testcase_19 AC 52 ms
4,376 KB
testcase_20 AC 58 ms
4,380 KB
testcase_21 AC 176 ms
6,472 KB
testcase_22 AC 176 ms
6,528 KB
testcase_23 AC 175 ms
6,544 KB
testcase_24 AC 175 ms
6,488 KB
testcase_25 AC 175 ms
6,664 KB
testcase_26 AC 176 ms
6,488 KB
testcase_27 AC 176 ms
6,688 KB
testcase_28 AC 175 ms
6,480 KB
testcase_29 AC 177 ms
6,512 KB
testcase_30 AC 175 ms
6,476 KB
testcase_31 AC 176 ms
6,608 KB
testcase_32 AC 176 ms
6,528 KB
testcase_33 AC 179 ms
6,488 KB
testcase_34 AC 180 ms
6,488 KB
testcase_35 AC 180 ms
6,660 KB
testcase_36 AC 2 ms
4,376 KB
testcase_37 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
using LL = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
const int INF = 1 << 29;
const long long LINF = 1LL << 60;
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int i = 0; i < (n); ++i)
template<class T>void chmin(T&a, T b){if(a > b) a = b;}
template<class T>void chmax(T&a, T b){if(a < b) a = b;}


int main(){
	int N, K; cin >> N >> K;
	vector<int> A(N), B(N);
	for(int i = 0; i < N; ++i) cin >> A[i];
	for(int i = 0; i < N; ++i) cin >> B[i];

	string ans = "";
	for(int i = 0; i < N; ++i) ans += "A";
	vector<pair<int, int>> A_B(N);
	for(int i = 0; i < N; ++i){
		A_B[i] = make_pair(A[i]-B[i], i);
	}
	sort(A_B.begin(), A_B.end());
	for(int i = 0; i < N-K; ++i){
	   ans[A_B[i].second] = 'B';
	}
	cout << ans << endl;

}

0