【codeforces 799B】T-shirt buying 【题目链接】:http://codeforces.com/contest/799/problem/B 【题意】 告诉你每个人喜欢的衣服的颜色; 然后告诉你每件衣服的正面和背面的颜色以及它的价格; 只要某件衣服的正面或背面是某个人喜欢的颜色; 则那个人就会喜欢它; 然后每个人会挑自己最喜欢的且最便宜的衣服买; ...
Codeforces 799B - T-shirt buying(STL) 题目链接:http://codeforces.com/problemset/problem/799/B 题目大意:有n件T恤,每件T体恤都分别有价格(每件衣服的价格不重复)、前面的颜色、背部的颜色三种属性。接下来有m个人每个人都有一种喜欢的颜色,他们按先后顺序选择衣服,如果没有喜欢的颜色的衣服了就输出“-1...
【题目链接】:http://codeforces.com/contest/799/problem/B 【题意】 告诉你每个人喜欢的衣服的颜色; 然后告诉你每件衣服的正面和背面的颜色以及它的价格; 只要某件衣服的正面或背面是某个人喜欢的颜色; 则那个人就会喜欢它; 然后每个人会挑自己最喜欢的且最便宜的衣服买; 给你每个人来的先后顺序; 让你求出...
Codeforces 799B -T-shirt buying(SET) 有n 件T恤。第 i 件T恤的价格为 pi。每个T恤有两面,第 i 件T恤正面颜色为 ai,反面颜色为 bi 有m 个人想买T恤,每个人都恰好买一件。第 j 个人最喜欢颜色 cj。 一个人会选择买一件至少有一面颜色为他喜欢的颜色的,最便宜的T恤。如果没有合法的T恤,则不买。这...
I know when we try to find and delete an element which is not present in set usingset.erase(set.find(x)),then it gives an exception as find returns an iterator that points at the end of the set. My doubt is does this happen even if I useset.erase(x), or was this ambiguous nat...
The t-shirt of the i-th type has two integer parameters — ci and qi, where ci— is the price of the i-th type t-shirt, qi— is the quality of the i-th type t-shirt. It should be assumed that the unlimited number of t-shirts of each type goes on sale in the shop, but ...
#P183D. T-shirt Description You are going to work in Codeforces as an intern in a team ofnengineers, numbered1throughn. You want to give each engineer a souvenir: a T-shirt from your country (T-shirts are highly desirable in Codeforces). Unfortunately you don't know the size of the ...
If you are a t-shirt winner, double check your information on your Bayan Contest Profile. T-shirts will be sent after the final event which is going to be on early 2015. We might invite one of the t-shirt winners as our event blogger to the onsite final. ...
CodeForces - 799B-T-shirt buying (优先队列) 1/*2Name:3Copyright:4Author:5Date: 2018/5/2 16:09:546Description:优先队列7*/8#include <iostream>9#include <cstdio>10#include <vector>11#include <cstring>12#include <queue>13usingnamespacestd;14constintMAXN =200005;15intprice[MAXN];16...
Codeforces Round #413 B T-shirt buying (STL set) 链接:http://codeforces.com/contest/799/problem/B 题意: 给定n件衣服,对于第i(1<i<=n)件衣服,分别有价格pi,前颜色ai,后颜色bi三个值。然后有m个顺序访问店铺的顾客,每位顾客有一个最喜欢的颜色,只要衣服有一面是他们最喜欢的颜色,他们就会买下这些...