結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー 👑 NachiaNachia
提出日時 2021-10-29 21:37:32
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 980 bytes
コンパイル時間 916 ms
コンパイル使用メモリ 88,424 KB
実行使用メモリ 9,632 KB
最終ジャッジ日時 2023-07-29 07:20:20
合計ジャッジ時間 9,954 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 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,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 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,380 KB
testcase_16 AC 37 ms
6,468 KB
testcase_17 AC 67 ms
9,028 KB
testcase_18 AC 51 ms
7,896 KB
testcase_19 AC 22 ms
4,816 KB
testcase_20 AC 23 ms
5,096 KB
testcase_21 AC 70 ms
9,520 KB
testcase_22 AC 71 ms
9,424 KB
testcase_23 AC 70 ms
9,380 KB
testcase_24 AC 71 ms
9,616 KB
testcase_25 AC 71 ms
9,496 KB
testcase_26 AC 71 ms
9,508 KB
testcase_27 AC 71 ms
9,524 KB
testcase_28 AC 70 ms
9,624 KB
testcase_29 AC 70 ms
9,564 KB
testcase_30 AC 70 ms
9,468 KB
testcase_31 AC 70 ms
9,472 KB
testcase_32 AC 71 ms
9,528 KB
testcase_33 AC 69 ms
9,420 KB
testcase_34 AC 71 ms
9,632 KB
testcase_35 AC 70 ms
9,524 KB
testcase_36 AC 1 ms
4,380 KB
testcase_37 AC 2 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
#define rep(i,n) for(int i=0; i<(n); i++)


int main(){
  int num_items; cin >> num_items;
  int num_choice_a; cin >> num_choice_a;
  vector<i64> value_a(num_items);
  for(auto& a : value_a) cin >> a;
  vector<i64> value_b(num_items);
  for(auto& a : value_b) cin >> a;

  vector<pair<i64,i64>> value_ids(num_items);
  for(int i=0; i<num_items; i++){
    value_ids[i].first = value_a[i] - value_b[i];
    value_ids[i].second = i;
  }

  string ans = string(num_items, 'B');
  sort(value_ids.begin(), value_ids.end(), greater<pair<i64,i64>>());
  for(int i=0; i<num_choice_a; i++) ans[value_ids[i].second] = 'A';
  cout << ans << "\n";
  return 0;
}




struct ios_do_not_sync {
    ios_do_not_sync() {
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
    }
} ios_do_not_sync_instance;
0