/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 1ms 816.0 KiB
#3 Accepted 3ms 796.0 KiB
#4 Accepted 29ms 1.984 MiB
#5 Accepted 191ms 12.836 MiB
#6 Wrong Answer 1030ms 50.801 MiB

Code

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

typedef long long ll;
#define bug(a) cout<<#a<<" : "<<a<<endl;
#define bug2(a,b) cout<<#a<<" : "<<a<<"\t"<<#b<<" : "<<b<<endl;
struct node{
    string n,j;
    int a,x,y;
};
bool cmp(node f,node g)
{
    if(f.x==g.x)return f.y<g.y;
    return f.x>g.x;
}
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t=1;
    while(t--){
        int d,j,g;
        cin>>d>>j>>g;
        map<string,int> mp;
        map<int,int>mp1;
        while(j--)
        {
            string s;
            int x;
            cin>>s>>x;
            mp[s]=x;
        }
        while(g--)
        {
            int a,b,c;
            cin>>a>>b>>c;
            for(int i=a; i<=b; i++)
            {
                mp1[i]=c;
            }
        }
        
        map<int,int> mp4;
        vector<node> v;
        int num=0,vac=0;
        j=0;
        while(d--)
        {
            int n,m;
            cin>>n>>m;
            num += n;
            vac += m;
            while(n--){
                string a,b;
                int c;
                cin>>a>>b>>c;
                int z=mp[b]+mp1[c];
                mp4[z]++;
                node temp;
                temp.n=a;
                temp.j=b;
                temp.a=c;
                temp.x=z;
                temp.y=mp4[z];
                v.push_back(temp);
            }
            sort(v.begin()+j,v.end(),cmp);
            while(m-- && j<v.size()){
                cout<<v[j].n<<" "<<v[j].j<<" "<<v[j].a<<endl;
                j++;
            }
        }
        num -= vac;
        if(num<0)num=0;
        cout<<"Still unvaccinated people: "<<num<<endl;
    }
    return 0;
}

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 07:54:06
Judged At
2024-12-09 07:54:06
Judged By
Score
30
Total Time
1030ms
Peak Memory
50.801 MiB