传送门 C. Second price auction time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Nowadays, most of the internet advertisements are not statically linked to a web page. Instead, what will be sho…
A Game题意:A,B各自拥有两堆石子,数目分别为n1, n2,每次至少取1个,最多分别取k1,k2个, A先取,最后谁会赢. 分析:显然每次取一个是最优的,n1 > n2时,先手赢. 代码: #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define esp 1e-14 #define lson l, m, rt<<1 #define rson m+1, r, rt<<1…
A. Game 题目大意:A有N1个球,B有N2个球,A每次可以扔1-K1个球,B每次可以扔1-K2个球,谁先不能操作谁熟 思路:.....显然每次扔一个球最优.... #include<iostream> #include<cstdio> #include <math.h> #include<algorithm> #include<string.h> #include<queue> #define MOD 10000007 #def…
Special Offer! Super Price 999 Bourles! Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 219B Description Polycarpus is an amateur businessman. Recently he was surprised to find out that…
B. Approximating a Constant Range When Xellos was doing a practice course in university, he once had to measure the intensity of an effect that slowly approached equilibrium. A good way to determine the equilibrium intensity would be choosing a suffi…
C. Day at the Beach One day Squidward, Spongebob and Patrick decided to go to the beach. Unfortunately, the weather was bad, so the friends were unable to ride waves. However, they decided to spent their time building sand castles. At the end of the…
转载请注明出处:http://www.cnblogs.com/Delostik/p/3553114.html 目前已有[A B C D E] 例行吐槽:趴桌子上睡着了 [A. Genetic Engineering] http://codeforces.com/contest/391/problem/A 问最少插入几个字符,使得字符串不存在连续偶数个相同字母.不说什么 #include <iostream> #include <string> using namespace std…
题目:http://codeforces.com/problemset/problem/391/E2    题意:有三棵树.每棵树有ni个结点,加入两条边把这三棵树连接起来,合并成一棵树.使得合并的树中随意两点之间的最短路径    的和最大. 分析:    三棵树要合并成一棵树,则第一棵树必须选择一个点,如果为X.第二棵树必须选择两个点,如果为Y1, Y2,第三棵树必须选择一个点,如果为Z    记第一棵树中全部结点到X的路径总和为:tot1    第二棵树中全部结点到Y1,Y2的路径总和分别为…
链接 https://codeforces.com/contest/1282/problem/B2 题意: 商店买东西,商店有n个物品,每个物品有自己的价格,商店有个优惠活动,当你买恰好k个东西时可以只为其中最贵的那个付款,求有限的钱中买到的最多的物品数量,你可以多次使用优惠. 思路:把所有商品的价格排序从小到大一遍,设第i个物品的价格是a[i],Sum[i]表示购买前i个物品花费的钱,作为前缀和.可以发现当你买了当第i个物品时,那么只需要支付Sum[i-k] + a [i] 即可,因为你买了当…
A(By talker): 题意分析:以a(int) op b(int)形式给出两个整数和操作符, 求两个整数是否存在操作符所给定的关系 ,有则输出true,无则输出false: 思路:由于无时间复杂度的限制,做为 签到题怎么快怎么写(比赛时,赛后 可以考虑尽量压缩代码),裸暴 力,if else拉伸判断每一个就 好了..处理起来的难点可能是中间字 符的读入处理,可以用%s读入然 后strcmp判断,反正怎么无 脑怎么写好了 B (By 2981405123): http://www.jians…