/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 320.0 KiB
#2 Wrong Answer 53ms 5.332 MiB

Code

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

#define int long long

int32_t main () {
  cin.tie(0)->sync_with_stdio(0);
  int t = 1;
  ///cin >> t;
  while (t--) {
      vector<pair<int,int>>v;
      int n, m;
      cin >> n;
      for (int i = 0; i < n; i++) {
          int x;
          cin >> x;
          v.push_back({x,INT_MAX});
      }
      cin >> m;
      int ans[m]{};
      for (int i = 0; i < m; i++) {
          int x;
          cin >> x;
          v.push_back({x,-i});
      }
      sort (v.rbegin(), v.rend());
      for (int i = 0; i < v.size(); i++) {
          if (v[i].second == INT_MAX) continue;
          ans[-1*v[i].second] = i+1;
      }
      for (int i = 0; i < m; i++) {
          cout << ans[i] << ' ';
      }
      cout << '\n';
  }
}

Information

Submit By
Type
Submission
Problem
P1049 Combined scoreboard
Contest
Brain Booster #3
Language
C++20 (G++ 13.2.0)
Submit At
2024-05-06 16:39:07
Judged At
2024-11-11 03:32:55
Judged By
Score
0
Total Time
53ms
Peak Memory
5.332 MiB