/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 3ms 4.527 MiB
#2 Wrong Answer 3ms 4.277 MiB
#3 Wrong Answer 4ms 4.277 MiB

Code

/**
 *    author:   Binoy Barman
 *    created:  2024-12-10 16:11:18
**/

#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 "debug/whereisit.hpp"
#else
#define dbg(...) 42
#endif
#define int long long

struct Person {
    string name, job;
    int age, pry;
    Person(string _name, string _job, int _age, int _pry) {
        name = _name;
        job = _job;
        age = _age;
        pry = _pry;
    }
};
class Compare {
  public:
    bool operator()(Person p1, Person p2){
        return p1.pry < p2.pry;
    }
};

int32_t main() {
Dark_Lord_Binoy
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int d, j, g;
    cin >> d >> j >> g;
    map<string, int> job;
    for (int i = 0; i < j; i++) {
        string w;
        int p;
        cin >> w >> p;
        job[w] = p;
    }
    vector<int> age(500001, 0);
    for (int i = 0; i < g; i++) {
        int l, u, p;
        cin >> l >> u >> p;
        for (int i = l; i <= u; i++) age[i] = p;
    }
    priority_queue<Person, vector<Person>, Compare> q;
    int vac = 0;
    while(d--) {
        int n, m;
        cin >> n >> m;
        vac += m;
        for (int i = 0; i < n; i++) {
            string nam, w; int ag;
            cin >> nam >> w >> ag;
            int priority = job[w] + age[ag];
            q.push(Person(nam, w, ag, priority));
        }
        while(!q.empty() && vac != 0) {
            Person v = q.top();
            q.pop();
            vac--;
            cout << v.name << " " << v.job << " " << v.age << nl;
        }
    }
    cout << "Still unvaccinated people: " << q.size() << nl;

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1148 e-Vaccine
Contest
LU IUJPC : Sylhet Division 2024 Replay Contest
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-10 10:38:09
Judged At
2024-12-10 10:38:09
Judged By
Score
0
Total Time
4ms
Peak Memory
4.527 MiB