/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 328.0 KiB
#2 Accepted 202ms 10.602 MiB
#3 Accepted 205ms 10.477 MiB
#4 Accepted 194ms 10.602 MiB
#5 Accepted 205ms 10.703 MiB
#6 Accepted 211ms 10.605 MiB
#7 Accepted 241ms 10.645 MiB
#8 Accepted 201ms 10.602 MiB
#9 Accepted 163ms 10.598 MiB
#10 Accepted 133ms 10.637 MiB
#11 Accepted 96ms 6.477 MiB
#12 Accepted 22ms 2.008 MiB

Code

/**
 *  written by Binoy Barman .
**/

#include<bits/stdc++.h>
using namespace std;
#define nl '\n'
#define all(v) v.begin(), v.end()
#define Too_Many_Jobs int tts, tc = 1; cin >> tts; hell: while(tts--)
#define Dark_Lord_Binoy ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifdef LOCAL
#include "unravel.hpp"
#else
#define dbg(...) 42
#endif
#define ll long long

int32_t main() {
Dark_Lord_Binoy
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n, m;
    cin >> n;
    multimap<int, int, greater<int>> f;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        f.insert(pair<int, int>(x, -1));
    }
    cin >> m;
    for (int i = 0; i < m; i++) {
        int x;
        cin >> x;
        f.insert(pair<int, int>(x, i));
    }
    vector<int> a(m + 1);
    int rnk = 0;
    for(auto i : f) {
        rnk++;
        if(i.second != -1) {
            a[i.second] = rnk;
        }
    }
    for (int i = 0; i < m; i++) {
        cout << a[i] << " ";
    }

    return 0;
}

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 15:30:51
Judged At
2024-11-11 03:34:11
Judged By
Score
100
Total Time
241ms
Peak Memory
10.703 MiB