/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 163ms 7.906 MiB
#3 Accepted 162ms 7.781 MiB
#4 Accepted 172ms 7.906 MiB
#5 Accepted 160ms 8.004 MiB
#6 Accepted 161ms 7.777 MiB
#7 Accepted 154ms 7.906 MiB
#8 Accepted 146ms 7.789 MiB
#9 Accepted 133ms 7.879 MiB
#10 Accepted 113ms 7.902 MiB
#11 Accepted 111ms 6.953 MiB
#12 Accepted 27ms 2.391 MiB

Code

#include<bits/stdc++.h>
#define ll long long 
using namespace std;

int main(){
  /*int t;
  cin >> t;
  while (t--){*/
    int n, m;
    cin >> n;
    vector<pair<int, pair<int, int>>> a(n);
    for (int i = 0; i < n; i++){
      int x;
      cin >> x;
      a[i].first = -x;
      a[i].second.first = i + 1;
      a[i].second.second = 1;
    }
    cin >> m;
    map<int, int> mp;
    for (int i = 0; i < m; i++){
      int x;
      cin >> x;
      mp[n + i + 1] = 0;
      a.push_back({-x, {n + i + 1, 0}});
    }
    sort(a.begin(), a.end());
    for (int i = 0; i < n + m; i++){
      if (a[i].second.second == 0){
        mp[a[i].second.first] = i + 1;
      }
    }
    for (auto [f, s] : mp){
      cout << s << ' ';
    }
  //}
}

Information

Submit By
Type
Submission
Problem
P1049 Combined scoreboard
Contest
Brain Booster #3
Language
C++17 (G++ 13.2.0)
Submit At
2024-05-06 15:46:01
Judged At
2024-11-11 03:33:52
Judged By
Score
100
Total Time
172ms
Peak Memory
8.004 MiB