結果

問題 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  
実行時間 78 ms / 2,000 ms
コード長 980 bytes
コンパイル時間 851 ms
コンパイル使用メモリ 89,300 KB
実行使用メモリ 9,744 KB
最終ジャッジ日時 2024-04-27 03:59:13
合計ジャッジ時間 8,190 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 41 ms
6,944 KB
testcase_17 AC 71 ms
9,344 KB
testcase_18 AC 56 ms
7,936 KB
testcase_19 AC 23 ms
6,940 KB
testcase_20 AC 26 ms
6,940 KB
testcase_21 AC 77 ms
9,624 KB
testcase_22 AC 76 ms
9,616 KB
testcase_23 AC 76 ms
9,744 KB
testcase_24 AC 77 ms
9,600 KB
testcase_25 AC 76 ms
9,600 KB
testcase_26 AC 77 ms
9,600 KB
testcase_27 AC 76 ms
9,728 KB
testcase_28 AC 77 ms
9,624 KB
testcase_29 AC 77 ms
9,552 KB
testcase_30 AC 78 ms
9,728 KB
testcase_31 AC 77 ms
9,640 KB
testcase_32 AC 77 ms
9,644 KB
testcase_33 AC 76 ms
9,716 KB
testcase_34 AC 77 ms
9,712 KB
testcase_35 AC 77 ms
9,600 KB
testcase_36 AC 2 ms
6,940 KB
testcase_37 AC 2 ms
6,944 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