codeforces 360 E - The Values You Can Make】的更多相关文章

E - The Values You Can Make Description Pari wants to buy an expensive chocolate from Arya. She has n coins, the value of the i-th coin is ci. The price of the chocolate is k, so Pari will take a subset of her coins with sum equal to k and give it to…
[codeforces 360]A. Levko and Array Recovery 试题描述 Levko loves array a1, a2, ... , an, consisting of integers, very much. That is why Levko is playing with array a, performing all sorts of operations with it. Each operation Levko performs is of one of…
D - Remainders Game Description Today Pari and Arya are playing a game called Remainders. Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the value . There are n ancient numbersc1,  c2, ..., cn and Pari has to…
A题:Opponents 直接模拟 #include <bits/stdc++.h> using namespace std; ]; int main() { int n,k; while(~scanf("%d%d",&n,&k)) { ,sta=,first=,ans; ;i<k;i++) { sta=; scanf("%s",ch); ;i<n;i++) sta&=(ch[i]-'); ) p++; ||(i==k…
题目链接: E. The Values You Can Make time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Pari wants to buy an expensive chocolate from Arya. She has n coins, the value of the i-th coin is ci. The…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Pari wants to buy an expensive chocolate from Arya. She has n coins, the value of the i-th coin is ci. The price of the chocolate is k, so P…
题目链接:http://codeforces.com/contest/688/problem/E 题解:设dp[s1][s2]表示s1状态下出现s2是否合理.那么s1显然可以更具01背包来得到状态.首先看一下转移方程 if(dp[i-a[k]][j]) => (1)dp[i][j]=dp[i-a[k]][j], (2)dp[i][j+a[k]]=dp[i-a[k]][j] 解释(1),(2) 怎么得到的:当i-a[k]的状态存在那么显然可以推到i这个状态,那么j这个状态要么加上a[k]要么不加a…
C - NP-Hard Problem Description Recently, Pari and Arya did some research about NP-Hard problems and they found the minimum vertex cover problem very interesting. Suppose the graph G is given. Subset A of its vertices is called a vertex cover of this…
原题: Description Recently, Pari and Arya did some research about NP-Hard problems and they found the minimum vertex coverproblem very interesting. Suppose the graph G is given. Subset A of its vertices is called a vertex cover of this graph, if for ea…
B - Levko and Array 题目大意:给你你个长度为n的数列a,你最多改变k个值,max{ abs ( a[ i + 1] - a[ i ] ) } 的最小值为多少. 思路:这个题很难想到如何取check.. 二分最小值,然后用dp进行check,dp[ i ]表示前 i 项中第 i 个不改变最少 需要改变几个值. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #def…