/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 328.0 KiB
#2 Wrong Answer 2ms 488.0 KiB
#3 Accepted 3ms 796.0 KiB
#4 Accepted 17ms 1.973 MiB
#5 Accepted 208ms 15.25 MiB
#6 Wrong Answer 1361ms 76.258 MiB

Code

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define all(v) v.begin(),v.end()
#define nl "\n"
#define FIO \
    ios_base::sync_with_stdio(false);\
    cin.tie(NULL);\
    cout.tie(NULL);
class cmp{
    public:
    bool operator()(pair<pair<pair<ll, ll>, ll>, pair<string, string>>a, pair<pair<pair<ll, ll>, ll>, pair<string, string>>b){
        if(a.first.first.first==b.first.first.first){
            return a.first.first.second>b.first.first.second;
        }
        return a.first.first.first<b.first.first.first;
    }
};
void solve()
{
    ll d, j, g; cin>>d>>j>>g; string s, t; ll r;
    map<string, ll> dq;
    while(j--){
        cin>>s>>r;
        dq[s]=r;
    }
    ll k=1;
    vector<pair<pair<ll, ll>, ll>>v;
    for(ll i=0;i<g;i++){
        ll p, q; cin>>p>>q>>r;
        v.push_back({{p, q}, r});
    }
    map<pair<string, string>, ll>mp;
    priority_queue<pair<pair<pair<ll, ll>, ll>, pair<string, string>>, vector<pair<pair<pair<ll, ll>, ll>, pair<string, string>>>, cmp>ff;
    while(d--){
        ll n, m; cin>>n>>m;
        for(ll i=0;i<n;i++)
        {
            cin>>s>>t>>r;
            mp[{s, t}]=r;
            ll p=0;
            for(ll j=0;j<g;j++)
            {
                if(v[j].first.first<=r && v[j].first.second>=r){
                    p=v[j].second;
                    break;
                }
            }
            ff.push({{{p+dq[t], k}, r}, {s, t}});
            k++;
        }
        for(ll i=0;i<m;i++)
        {
            if(ff.empty()) break;
            s=ff.top().second.first; t=ff.top().second.second;
            cout<<s<<" "<<t<<" "<<ff.top().first.second<<nl;
            ff.pop();
        }
    }
    cout<<"Still unvaccinated people: "<<ff.size()<<nl;
}

int32_t main()
{
 FIO
    ll t=1;
    // cin>>t;
    for(ll i=1;i<=t;i++)
    {
        // cout<<"Case "<<i<<": ";
        solve();
    }
}

Information

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