結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー rtyurtyu
提出日時 2021-11-01 13:40:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 772 ms
コンパイル使用メモリ 71,668 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-18 08:49:58
合計ジャッジ時間 9,312 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 39 ms
5,376 KB
testcase_17 AC 73 ms
6,940 KB
testcase_18 AC 55 ms
6,940 KB
testcase_19 AC 23 ms
6,940 KB
testcase_20 AC 26 ms
5,376 KB
testcase_21 AC 76 ms
6,940 KB
testcase_22 AC 77 ms
6,944 KB
testcase_23 AC 78 ms
6,940 KB
testcase_24 AC 76 ms
6,940 KB
testcase_25 AC 76 ms
6,940 KB
testcase_26 AC 75 ms
6,944 KB
testcase_27 AC 76 ms
6,940 KB
testcase_28 AC 74 ms
6,944 KB
testcase_29 AC 77 ms
6,940 KB
testcase_30 AC 77 ms
6,940 KB
testcase_31 AC 75 ms
6,940 KB
testcase_32 AC 78 ms
6,940 KB
testcase_33 AC 79 ms
6,944 KB
testcase_34 AC 81 ms
6,940 KB
testcase_35 AC 79 ms
6,944 KB
testcase_36 AC 2 ms
6,940 KB
testcase_37 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

pair<int, int> p[200009];

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, k; cin >> n >> k;
	string ans = "";
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		p[i].first = a;
		p[i].second = i;
		ans += "B";
	}
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		p[i].first -= a;
	}
	sort(p, p + n);
	for (int i = n - 1; i >= n - k; i--)
		ans[p[i].second] = 'A';
	cout << ans << '\n';
	return 0;
}
0