gym 101755】的更多相关文章

<题目链接> 题目大意: 一家公司想让n个人给他们的产品评论,所以依次去找这n个人,第i个人会评论当且仅当已经有ai个人评论或他确实对这个产品感兴趣,但是这n个人都不对这个产品感兴趣,问这个公司至少要说服几个人对该产品该兴趣才能至少收到m个人的评论. 解题分析: 直接二分答案,然后按顺序进行判断,如果ai大于当前评论的人就说服该人,这里用到了贪心的思想(本题的关键),因为说服该人能够提供评论数的贡献,所以越早做贡献能够带来更多的贡献,然后根据评论的人数与m的比较来控制二分答案的方向. #inc…
别问我为什么现在才发... 我怎么睡醒午觉吃了个饭就晚上九点半了啊????? 真实自闭场,感觉码力严重不足需要补魔. A: #include <bits/stdc++.h> using namespace std; typedef long long ll; ll s,g; int main(){ ios::sync_with_stdio(false); cin>>s>>g; ){ cout<<-; }else if(s==g){ cout<<-…
题目链接:http://codeforces.com/gym/101755/problem/K 题目理解: 一家公司想让n个人给他们的产品评论,所以依次去找这n个人,第i个人会评论当且仅当已经有ai个人评论或他确实对这个产品感兴趣,但是这n个人都不对这个产品感兴趣,问这个公司至少要说服几个人对该 产品该兴趣才能至少收到m个人的评论.假如你要强迫人肯定要强迫最前边的,因为说服一个人对评论数贡献为1​,而提早做贡献可以带来更多的贡献(因为是一个一个地找人,前面的贡献对后面有用) 对于这种情况,有种强…
题目链接:http://codeforces.com/gym/101755/problem/H 题目分析:先bfs一遍怪兽可以到达的点,再bfs人可以走的地方看可不可以到达终点: 很显然读到  2<=n*m<=200000 时,就不可以用二维数组存图了,不过据说因为数据比较水,可以用vector存图: vector存图AC代码: /* */ # include <iostream> # include <stdio.h> # include <string.h&g…
 Gym 101047M Removing coins in Kem Kadrãn Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output Andréh and his friend Andréas are board-game aficionados. They know many of their friend…
 Gym 101047K Training with Phuket's larvae Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output Thai cuisine is known for combining seasonings so that every dish has flavors that are…
Gym 101047E Escape from Ayutthaya Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u  Practice  Description standard input/output Ayutthaya was one of the first kingdoms in Thailand, spanning since its foundation in 1350 to…
 Gym 101047B  Renzo and the palindromic decoration Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output At the ruins of Wat Phra Si Sanphet (วดพระศรสรรเพชญ), one can find famous inscr…
题目链接 http://codeforces.com/gym/101102/problem/J Description standard input/output You are given an array A of integers of size N, and Q queries. For each query, you will be given a set of distinct integers S and two integers L and R that represent a…
题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/outputStatements The jury of Berland regional olympiad in informatics does not trust to contest management systems, so the Berland regional programming contest is judged by th…