2014牡丹江K Known Notation】的更多相关文章

Known Notation Time Limit: 2 Seconds      Memory Limit: 65536 KB Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also known as postfix notation since every operator in an expres…
http://acm.zju.edu.cn/onlinejudge/showContestProblems.do?contestId=358 The 2014 ACM-ICPC Asia Mudanjiang Regional Contest 136 - The 2014 ACM-ICPC Asia Mudanjiang Regional Contest Solved ID Title Ratio (AC/All) Yes A Average Score 61.78% (456/738) Yes…
Description Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also known as postfix notation since every operator in an expression follows all of its operands. Bob is a student in…
主题链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do? problemId=5383 Known Notation Time Limit: 2 Seconds      Memory Limit: 65536 KB Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science.…
主妇:老年人谁是炮灰牡丹江,我们的团队只是做同步大赛 他决定开爆震H什么时候,A 5min 1Y.I在该限制后,纠结了很久30min+ 1Y,神继续承担各种位置卡D在,hpp见B我认为这是非常熟悉的研究ing 告诉我,然后看积分榜,并且K和H. K想叫队友一起想一下(毕竟过的人非常多了),可是不好意思叫.然后看H,非常有一种XML那种树形数据描写叙述结构的味道.可是语法简单太多了(好像不应该扯XML的--) 感觉上是一个中难偏简单的模拟,于是就開始考虑怎么实现好了. 估算一下字符串长度,1000…
problemId=5380" style="background-color:rgb(51,255,51)">题目链接 字符串模拟 const int MAXN = 2000000; char ipt[MAXN], t[MAXN]; int f[MAXN], len, to[MAXN]; map<string, string> mp[MAXN]; string x, key, ans; string i2s(int n) { string ret = &q…
题目链接 题意: 输入一个长度不超过1000的字符串,包含数字(1-9)和星号(*).字符串中的空格已经丢失,所以连起来的数字串能够看成很多分开的数.也能够看成连续的数,即能够随意加入空格. 如今有两种操作:1)在任何位置加入随意类型的字符(数字或者星号)    2)交换字符串中的随意两个字符 求:最少操作多少次,使得得到的串是一个合法的逆波兰式 分析: 对于n个星号,n+1个数字的字符串,假设将星号都移动到串的末尾.那么一定是合法的 对于操作1,假设须要插入数字,那么插入到字符串的最前边是最优…
The 2014 ACM-ICPC Asia Mudanjiang Regional Contest 题目链接 没去现场.做的网络同步赛.感觉还能够,搞了6题 A:这是签到题,对于A堆除掉.假设没剩余在减一.B堆直接除掉 + 1就能够了 B:二分贪心,二分长度.然后会发现本质上是在树上最长链上找两点,那么有二分出来的长度了,就从两端分别往里移动那么长,那两个位置就是放置位置.然后在推断一下就能够了 D:概率DP.首先知道放一个棋子.能够等价移动到右上角区域,那么就能够dp[x][y][k],表示…
#include <iostream> #include <stdio.h> #include <cmath> #include <algorithm> #include <iomanip> #include <cstdlib> #include <string> #include <memory.h> #include <vector> #include <queue> #includ…
/* 将给定的一个字符串分解成ABABA 或者 ABABCAB的形式! 思路:暴力枚举A, B, C串! */ 1 #include<iostream> #include<cstring> #include<cstdio> #include<string> using namespace std; string str; ]; int main(){ int t; scanf("%d", &t); getchar(); while…
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 friends. What's more, he bought a large decorative chessboar…
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 friends. What's more, he bought a large decorative chessboar…
Hierarchical Notation Time Limit: 2 Seconds      Memory Limit: 131072 KB In Marjar University, students in College of Computer Science will learn EON (Edward Object Notation), which is a hierarchical data format that uses human-readable text to trans…
Description Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What's more, he bought a large decorative chessboard with N rows and M columns. Every day after work, Edward will place…
3799567 2014-10-14 10:13:59                                                                     Accepted                                                             3822 C++ 1870 71760 njczy2010 3799566 2014-10-14 10:13:25                            …
Untrusted Patrol Time Limit: 3 Seconds                                     Memory Limit: 65536 KB                             Edward is a rich man. He owns a large factory for health drink production. As a matter of course, there is a large warehouse…
首先赞一下题目, 好题 题意: Marjar University has decided to upgrade the infrastructure of school intranet by using fiber-optic technology. There are N buildings in the school. Each building will be installed with one router. These routers are connected by optic…
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 friends. What's more, he bought a large decorative chessboar…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5376 题意:每天往n*m的棋盘上放一颗棋子,求多少天能将棋盘的每行每列都至少有一颗棋子的期望 分析: 我们来分析一波: 讲解一下弱弱的我的解题思路 (1)首先可以想到的是设一个 dp[val]  表示 当前用了val 个旗子距离目标状态还有几天的概率.但是我们可以发现单纯的一个状态val 是不能表示出准确的状态 , 比如说现在只是知道了我使用了多少的旗子,当前不知道有多少行和…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5374 思路:题目的意思是求树上的两点,使得树上其余的点到其中一个点的最长距离最小.可以想到这题与树直径有关,我们可以这样做,首先求出树的直径,然后取出树的中点以及与该中点相邻,并且是直径上的一个点,这样就把这棵树划分为两颗子树,然后分别求出这两棵树的直径,最后要选择的两个点分别就是这两棵树的直径上的中点. 一开始是用dfs写的,结果爆栈了,改成bfs就过了. #in…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5373 题目意思: 有两个class:A 和 B,Bob 在 Class A 里面.现在给出 Class A(n-1人) 和 Class B(m人) 所有人的分数,除了Bob,所以Class A 少了一个人.现在需要找出 Bob 最大可能的分数和最少可能的分数,使得他在Class A 里面拉低平均分,而在Class B 里面提高平均分. 由于数据量不大,所以可以暴力枚…
I - Information Entropy Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Description Information Theory is one of the most popular courses in Marjar University. In this course, there is an important chapter abo…
题目链接 题意: 给一个n*m的矩阵,每天随机的在未放棋子的格子上放一个棋子.求每行至少有一个棋子,每列至少有一个棋子的天数的期望  (1 <= N, M <= 50). 分析: 比較明显的概率DP,难点在于怎样设计状态.覆盖了多少行和列是不可缺少的,之后比較关键的就是想到还有一个属性:多少个交叉点(即放过的点) double dp[55][55][2550]; bool vis[55][55][2550]; int tot; int n, m; inline double getp(int…
套公式 Sample Input 33 bit25 25 50 //百分数7 nat1 2 4 8 16 32 3710 dit10 10 10 10 10 10 10 10 10 10Sample Output 1.5000000000001.4808108324651.000000000000 # include <iostream> # include <cstdio> # include <cstring> # include <algorithm>…
题意:给出A班和B班的学生成绩,如果bob(A班的)在B班的话,两个班级的平均分都会涨.求bob成绩可能的最大,最小值. A班成绩平均值(不含BOB)>A班成绩平均值(含BOB) && B班成绩平均值(不含BOB)< B班成绩平均值(含BOB) 化简后得 B班成绩平均值(不含BOB) < X < A班成绩平均值(不含BOB) Sample Input 24 35 5 54 4 36 55 5 4 5 31 3 2 2 1Sample Output 4 42 4 #…
题目大意:给出一列取样的几个山的高度点,求山峰有几个? Sample Input 291 3 2 4 6 3 2 3 151 2 3 4 5Sample Output 30 # include <iostream> # include <cstdio> # include <cstring> # include <algorithm> # include <cmath> # define LL long long using namespace…
题目链接:ZOJ 3827 Information Entropy 依据题目的公式算吧,那个极限是0 AC代码: #include <stdio.h> #include <string.h> #include <math.h> const double e=exp(1.0); double find(char op[]) { if(op[0]=='b') return 2.0; else if(op[0]=='n') return e; else if(op[0]=='…
A  Average Score http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5373 a班有n个人,b班有m个人,bob在a班,现在知道除了bob以外的所有人的成绩,还知道bob如果从a班转到b班,两个班的平均成绩都会提高,问bob合法的成绩区间. 解法,求一下两个班的平均成绩,bob的成绩肯定要比a班的小,比b班的大. #include<cstdio> int main(){ int t,n,m,x,sa,sb; w…
The 2014 ACM-ICPC Asia Mudanjiang Regional Contest A.Average Score B.Building Fire Stations C.Card Game D.Domination E.Excavator Contest F.Fiber-optic Network G.Garden and Sprinklers H.Hierarchical Notation I.Information Entropy J.Jacobi Pattern K.Kn…
2014牡丹江亚洲区域赛邀请赛 B题:图论题目 题解:这里 K题:想法题 分析:两种变化.加入和交换.首先:星号是n的话最少须要的数字是n+1,那么能够首先推断数字够不够,不够的话如今最前面添数字,假设满足的话直接模拟假设数字不够的话把当前的星号和最后一个数字交换就可以. css函数能够不用. AC代码: #include <cstdio> #include <iostream> #include <algorithm> #include <vector>…