結果
| 問題 | No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-01 13:40:46 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 39 ms / 2,000 ms |
| + 841µs | |
| コード長 | 499 bytes |
| 記録 | |
| コンパイル時間 | 402 ms |
| コンパイル使用メモリ | 81,660 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-09-12 22:11:18 |
| 合計ジャッジ時間 | 8,461 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}