这个题是说有C头牛去晒太阳,带了L瓶防晒霜,每瓶防晒霜都有一个SPF值(每瓶防晒霜都能解决一个最短路) 每头牛给出了他可以接受防晒霜的上限,和下限,每种防晒霜都给出了SPF值与数量。 从防晒霜的spf值最小开始贪心,每次将奶牛最大接受限度小的牛且符合条件选出,那么这头牛一定比其他牛接受范围更小,应该优先...
L;typedefpair<int,int>P;priority_queue<int,vector<int>,greater<int>>que;Pcow[2505];Pbottle[2505];intcowi,ans;voidadd(){for(inti=0;i<C;i++)cin>>cow[i].first>>cow[i].second;for(intj=0;j<L;j++)cin>>bottle[j].first>>bottle[j].second;}intmain(){intmax_spf;cowi=ans=...
To avoid unsightly burnswhiletanning, each of the C (1≤ C ≤2500) cows must cover her hide with sunscreen when they're at the beach. Cow i has a minimum and maximum SPF rating (1 ≤minSPFi ≤ 1,000; minSPFi ≤ maxSPFi ≤ 1,000) that will work. If the SPF rating is too l...