codeforces 360 B】的更多相关文章

[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…
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…
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…
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…
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…
原题: 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…
Problem_A(CodeForces 688A): 题意: 有d天, n个人.如果这n个人同时出现, 那么你就赢不了他们所有的人, 除此之外, 你可以赢他们所有到场的人. 到场人数为0也算赢. 现给出这n个人d天的到勤情况, 求最大连胜天数. 思路: 暴力找下去, 维护最大天数即可. 代码: #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include…
D. Dividing Kingdom II 题目连接: http://www.codeforces.com/contest/687/problem/D Description Long time ago, there was a great kingdom and it was being ruled by The Great Arya and Pari The Great. These two had some problems about the numbers they like, so…
D. Remainders Game 题目连接: http://www.codeforces.com/contest/688/problem/D 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…