結果
| 問題 |
No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-01 13:40:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 77 ms / 2,000 ms |
| コード長 | 499 bytes |
| コンパイル時間 | 705 ms |
| コンパイル使用メモリ | 71,032 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-10 02:05:46 |
| 合計ジャッジ時間 | 10,932 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 |
ソースコード
#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;
}