http://www.ifrog.cc/acm/problem/1036?contest=1005&no=0 分类,考虑Q神出的是第一张或者是第二张,然后对手出那些牌来应付. Q神出第一张和第二张的情况是分开的,应该取两者的最大值.(因为要取最优情况) 而Q神出第一张的时候,对手出任意一张,是取min,保证对手出牌最优 注意这里花色是没用的. #include <cstdio> #include <cstdlib> #include <cstring> #inc…
Soldier and Cards time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Two bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, all values are…
B. Cards time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Catherine has a deck of n cards, each of which is either red, green, or blue. As long as there are at least two cards left, she can…
题目链接:http://codeforces.com/problemset/problem/546/C 题解: 用两个队列模拟过程就可以了. 特殊的地方是:1.如果等大,那么两张牌都丢弃 : 2.如果操作了很多次仍不能分出胜负,则认为平手.(至于多少次,我也不知道,只能写大一点碰运气,但要防止超时) 代码如下: #include<iostream>//C - Soldier and Cards #include<cstdio> #include<cstring> #in…
题意:给出罚时现场赛的题数和罚时,问是否有在金牌线下取整被卡出,四舍五入卡入的队伍 n<=1e5 思路: #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; typedef pair<int,int> PII; typedef pair<ll,ll> Pll; typ…
两个人玩牌,首先两个人都拿出自己手牌的最上面的进行拼点,两张拼点牌将都给拼点赢得人,这两张牌放入手牌的顺序是:先放对方的牌再放自己的.若最后有一个人没有手牌了,那么他就输了,求输出拼点的次数和赢得人的编号,如果一直无法结束比赛,则输出-1. 用队列模拟即可. #include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define reset(x) memset(x,0,si…
ZCC loves cards Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 260    Accepted Submission(s): 7 Problem Description ZCC loves playing cards. He has n magical cards and each has a number on it.…
B1018. 锤子剪刀布 (20) Discription: 大家应该都会玩"锤子剪刀布"的游戏:两人同时给出手势,胜负规则如图所示: 现给出两人的交锋记录,请统计双方的胜.平.负次数,并且给出双方分别出什么手势的胜算最大. Input: 输入第1行给出正整数N(<=105),即双方交锋的次数.随后N行,每行给出一次交锋的信息,即甲.乙双方同时给出的的手势.C代表"锤子".J代表"剪刀".B代表"布",第1个字母代表甲方…
LoadRunner 思考时间与事务响应时间的区别与关系   思考时间lr_think_time 就是一个事务要开始时思考的时间;比如 你要点击一个 登录按钮 我们都要点击这个按钮要先思考下 就是人为脑袋思维的延迟,还有手指点击鼠标的这个动作的时间 一般是1-5秒,这就是思考时间,性能测试模拟思考时间就是模拟真实人为动作的方式来做压力测试.一般在脚本中思考时间是这样写比较合理,在一个事务的结束点另一个事务的起始点,两者中间定义思考时间.lr_end_transaction("登录",…
MUH and House of Cards Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 471C Description Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo o…