Berland shop sells nn kinds of juices. Each juice has its price cici. Each juice includes some set of vitamins in it. There are three types of vitamins: vitamin "A", vitamin "B" and vitamin "C". Each juice can contain one, tw…
Berland shop sells nn kinds of juices. Each juice has its price cici. Each juice includes some set of vitamins in it. There are three types of vitamins: vitamin "A", vitamin "B" and vitamin "C". Each juice can contain one, tw…
B. Vitamins 题目链接:https://codeforces.com/contest/1042/problem/B 题意: 给出几种药,没种可能包含一种或多种(最多三种)维生素,现在问要吃到这三种维生素买药最少花费是多少. 题解: 嗯...可以直接暴力: #include <bits/stdc++.h> using namespace std; typedef long long ll; ; int n; int c[N]; ]; ]; int main(){ scanf("…
题意:有n片药,有三种颜色,白色比红色重,红色比蓝色重,给你一些它们之间的重量关系,比如1>3,2=4之类,问你它们的颜色,如果没法判断的输出?. 先并查集把等于号全缩起来,然后按照大于号建图,就是一张DAG,枚举所有的点,发现它如果是一个长度为3的链的中间结点,那么它.它指向的.指向它的颜色都可以判断了. 其他的都无法判断. #include<cstdio> #include<cstring> using namespace std; int v[2][499505],ne…
A - A CodeForces - 1042A There are nn benches in the Berland Central park. It is known that aiai people are currently sitting on the ii-th bench. Another mm people are coming to the park and each of them is going to have a seat on some bench out of n…
Dialogue 1 Healthy diet 关于健康饮食 F:Bob, look at this sentence. 'Healthy eating is not about strict nutrition philosophies, staying unrealistically thin, or depriving yourself of foods you love.' It's interesting, isn't it? 鲍勃,听听这个句子:健康的饮食不是指那些严格的营养哲…