题目链接:zoj 3829 Known Notation作者:jostree 转载请说明出处使用贪心+模拟。由于没有数字之间没有空格,因此该题有如下性质:1.如果该字符串全部为数字,则无需操作,直接输出0。2.连续的n个数字后面接连续的m个*,当n>m时,一定是有效的答案。从而最终的目的就是把最后的...
分类:
其他好文 时间:
2014-10-12 20:53:48
阅读次数:
178
Information Entropy
Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge
Information Theory is one of the most popular courses in Marjar University. In this course, there is an i...
分类:
其他好文 时间:
2014-10-12 19:25:08
阅读次数:
206
题目链接:ZOJ 3819 Average Score
题意:给出A班和B班的学生成绩,如果bob(A班的)在B班的话,两个班级的平均分都会涨。求bob成绩可能的最大,最小值。
A班成绩平均值(不含BOB)>A班成绩平均值(含BOB) && B班成绩平均值(不含BOB)
求解两个不等式,注意精度
AC代码:
#include
int main()
{
int...
分类:
其他好文 时间:
2014-10-12 18:53:38
阅读次数:
172
Known Notation
Time Limit: 2 Seconds Memory Limit: 131072 KB
Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also kn...
分类:
其他好文 时间:
2014-10-12 18:52:18
阅读次数:
319
Domination
Time Limit: 8 Seconds Memory Limit: 131072 KB Special Judge
Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his frie...
分类:
其他好文 时间:
2014-10-12 18:35:28
阅读次数:
297
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5373题目意思: 有两个class:A 和 B,Bob 在 Class A 里面。现在给出 Class A(n-1人) 和 Class B(m人) 所有人的分数,除了Bo...
分类:
其他好文 时间:
2014-10-12 18:24:58
阅读次数:
204
题目链接:ZOJ 3827 Information Entropy
根据题目的公式算吧,那个极限是0
AC代码:
#include
#include
#include
const double e=exp(1.0);
double find(char op[])
{
if(op[0]=='b')
return 2.0;
else if(o...
分类:
其他好文 时间:
2014-10-12 17:59:48
阅读次数:
156
dp :#include#include#includeusingnamespacestd;constintMAX=51;doubledp[MAX*MAX][MAX][MAX];intmain(){intcas;intn,m;scanf("%d",&cas);while(cas--){scanf("...
分类:
其他好文 时间:
2014-10-12 17:58:28
阅读次数:
177
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4882
现在在牡丹江,明天regional现场赛,不出一个月就要退役了,求保佑
今天热身赛做题很紧张,老是打错字,所以晚上写写代码练练手
脑子还是不好使,没想到可以并查集
思路:题目中的操作导致的一个结果是,一条边会成为一个集合的w,---- 如果能想到这里可能就能想到...
分类:
其他好文 时间:
2014-10-11 23:27:07
阅读次数:
355
题意:
给一个原串,再给n个串,每个串有属性,属性0代表可以重叠,1代表不可以重叠
问每个串出现了多少次
思路:
为了方便建立两个自动机(0的一个,1的一个)
然后可以重叠的很好做,以前都做过
不可重叠的话需要记录两个东西
len[i]代表每个串的长度,used[i]代表每个串在之前出现的位置,初始化-1
然后遍历到的时候对于当前位置 j, 必须j>=used[i]+len[i] ...
分类:
其他好文 时间:
2014-10-11 13:38:45
阅读次数:
237