/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 540.0 KiB
#2 Accepted 2ms 540.0 KiB
#3 Accepted 3ms 604.0 KiB
#4 Accepted 14ms 764.0 KiB
#5 Accepted 128ms 3.887 MiB
#6 Accepted 697ms 19.703 MiB
#7 Accepted 630ms 10.59 MiB
#8 Accepted 599ms 10.488 MiB
#9 Accepted 611ms 10.637 MiB
#10 Accepted 604ms 10.469 MiB

Code

//SUST_ZadeedBoss_Fanclub
//code_korlei_life_ase
//na_korle_lifeNai

#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T> using o_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define double long double
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); 

struct age
{
	int l,r,val;
};
void solve ()
{

	int d,j,g;cin>>d>>j>>g;
	priority_queue<pair<int,pair<int,string>>>pq;
	vector<age>v(g);
	map<string,int>mp;
	for(int i=0;i<j;i++)
	{
		string s;int a;
		cin>>s>>a;
		mp[s] = a;
	}
	for(int i=0;i<g;i++)
	{
		cin>>v[i].l>>v[i].r>>v[i].val;
		//cout<<v[i].l<<" "<<v[i].r<<" "<<v[i].val<<endl;
	}
	int cnt=1e9,pp=0;
	for(int i=0;i<d;i++)
	{
		int a,b;cin>>a>>b;
		pp+=b;
		for(int k=0;k<a;k++)
		{
			string s1,s2;int c;
			cin>>s1>>s2>>c;
			int pr=0;
			auto it= mp.find(s2);
			if(it!=mp.end())pr+=it->second;
			for(int j=0;j<g;j++)
			{
				if(c>=v[j].l && c<=v[j].r)
				{
					pr+=v[j].val;
					break;
				}
			}
			pq.push({pr,{cnt--,s1+" "+s2+" "+to_string(c)}});
		}
		while(pq.size() && pp-- && 1)
		{
			cout<<pq.top().second.second<<endl;
			pq.pop();
		}
	}
	cout<<"Still unvaccinated people: "<<pq.size()<<endl;
}

signed main()
{

	ios_base::sync_with_stdio(0);
	cin.tie(NULL);

	int TCASE = 1;
	// cin >> TCASE;

	for (int tcase = 1; tcase <= TCASE; tcase++)
	{
		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 08:30:42
Judged At
2024-12-09 08:30:42
Judged By
Score
100
Total Time
697ms
Peak Memory
19.703 MiB