ZOJ 3757 Alice and Bod 模拟】的更多相关文章

上次的ZJU月赛题,规则比较复杂,当时就连题意都没摸清楚,只觉得非常复杂 比完后敲啊敲啊敲,连续WA啊,该反思下自己,没按照题意来设置条件,题目中说了 白球入袋并且... 给对手加分 ,白球未入袋并且...给对手加分,这个白球未入袋的情况也要加在判断条件里啊啊啊啊,还有就是有个地方要排序我居然忘了,好久都没发现. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm…
题目链接 题意 : 玩台球.Alice 和 Bob,一共可以进行m次,Alice 先打.有一个白球和n个标有不同标号的球,称目标球为当前在桌子上的除了白球以外的数值最小的球,默认白球的标号为0.如果白球落入洞中,要把白球拿出来放在桌子上,如果是其他的球就不拿哪怕是犯规打进去的.每打一局(每一局代表每人打一杆)时当发生以下三种行为时算是犯规,会将相应的罚分加给对方,自己不减分. 白球没有打中任何球.将目标球的数值加到对方的分数上. 白球没有入洞且至少打中一个球,一开始没有打中目标球或者一开始同时打…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3757 题意:根据所给的台球规则,按照每次的结果计算最终两人的得分 单纯的模拟题,分支比较多写起来较繁琐 注意区分犯规与进球得分的规则: 只要有犯规行为,都要按照规则给对手加分.无论是否进球. 当进球时,如果有犯规行为,不仅分要加给对手,还要加上犯规惩罚 #include<cmath> #include<cstdio> #include<cst…
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3757 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<vector> #include<string> #include<map> #include<set>…
这道题在LA是挂掉了,不过还好,zoj上也有这道题. 题意:好大一颗树,询问父子关系..考虑最坏的情况,30w层,2000w个点,询问100w次,貌似连dfs一遍都会TLE. 安心啦,这肯定是一道正常人能做的题目.不过是需要几个小技巧. 1.2000w个点不一定都要保存下来,事实上,虽然题目给了256M的空间,只要开了两个这么大的数组,MLE是跑不了的,所以只保存30w个父节点. 2.如果这30w个父节点构成一条链,dfs的栈肯定爆.所以需要用栈模拟dfs.这里用的是stack<int>,当然…
3757一个模拟题,简单,但容易错: 3758 大素数判定就行: #include<cstdio> #include<cstring> #include<algorithm> #define maxn 100009 using namespace std; ]; int hit[maxn]; int in[maxn]; int ball[maxn]; bool vis[maxn]; int main() { int n,m; int p,q; while(scanf(&…
Alice's present Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=95030#problem/A Description As a doll master, Alice owns a wide range of dolls, and each of them has a number tip on it's back, the tip…
只有在 Month 和 Day 都为素数的时候才能得到糖 那就模拟一遍时间即可. //#pragma comment(linker, "/STACK:16777216") //for c++ Compiler #include <stdio.h> #include <iostream> #include <fstream> #include <cstring> #include <cmath> #include <sta…
题目链接: HDU:http://acm.hdu.edu.cn/showproblem.php?pid=4791 ZJU:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5072 Problem Description Alice is providing print service, while the pricing doesn't seem to be reasonable, so people using her pr…
- Total Amount Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 2476 Description Given a list of monetary amounts in a standard format, please calculate the total amount. We define the format as fo…