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

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,假设须要插入数字,那么插入到字符串的最前边是最优…
主题链接: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.…
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…
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/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…
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…
The 2014 ACM-ICPC Asia Mudanjiang Regional Contest 题目链接 没去现场.做的网络同步赛.感觉还能够,搞了6题 A:这是签到题,对于A堆除掉.假设没剩余在减一.B堆直接除掉 + 1就能够了 B:二分贪心,二分长度.然后会发现本质上是在树上最长链上找两点,那么有二分出来的长度了,就从两端分别往里移动那么长,那两个位置就是放置位置.然后在推断一下就能够了 D:概率DP.首先知道放一个棋子.能够等价移动到右上角区域,那么就能够dp[x][y][k],表示…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5374 思路:题目的意思是求树上的两点,使得树上其余的点到其中一个点的最长距离最小.可以想到这题与树直径有关,我们可以这样做,首先求出树的直径,然后取出树的中点以及与该中点相邻,并且是直径上的一个点,这样就把这棵树划分为两颗子树,然后分别求出这两棵树的直径,最后要选择的两个点分别就是这两棵树的直径上的中点. 一开始是用dfs写的,结果爆栈了,改成bfs就过了. #in…
#include <iostream> #include <stdio.h> #include <cmath> #include <algorithm> #include <iomanip> #include <cstdlib> #include <string> #include <memory.h> #include <vector> #include <queue> #includ…