题目链接 ZOJ Monthly, March 2018 Problem G 题意 给定一个字符串.现在求一个下标范围$[0, n - 1]$的$01$序列$f$.$f[x] = 1$表示存在一种方案,删掉原字符串中的连续$x$个字母, 使得剩下的字符串中任意相邻的两个字母都不同.在这道题中所有的字符串首尾字符看做是相邻的. 对于每个起始位置求出最多往右延伸到的位置,满足该区间代表的字符串是一个满足任意相邻字母不同的字符串. 首先考虑一个连续的满足任意相邻字母不同的字符串.设其长度为$l$…
Problem G. k-palindrome 题目连接: http://opentrains.snarknews.info/~ejudge/team.cgi?SID=c75360ed7f2c7022&all_runs=1&action=140 Description We will say that a string T is a k-palindrome for some positive integer k if and only if k is not grater than th…
想要输出""的话: cout<<"A person whose name is \""<<name<<"\" and age is "<<age<<" is created!"<<endl; Home Web Board ProblemSet Standing Status Statistics Problem G: 克隆人来了!…
Home Web Board ProblemSet Standing Status Statistics Problem C: 重载字符的加减法 Problem C: 重载字符的加减法 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 493 Solved: 248[Submit][Status][Web Board] Description 定义一个字符类Character,只有一个char类型的数据成员. 重载它的+.-.<<和>&g…
这个题目主要是乘法运算符的重载,卡了我好久,矩阵的乘法用3个嵌套的for循环进行,要分清楚矩阵的乘法结果是第一个矩阵的行,第二个矩阵的列所组成的矩阵. 重载+,*运算符时,可以在参数列表中传两个矩阵引用,分别表示前后进行运算的矩阵,或者是只传运算符之后的矩阵引用,前一个矩阵用的是隐含的this指针指向的矩阵.我用的是后者. Home Web Board ProblemSet Standing Status Statistics Problem G: 强悍的矩阵运算来了 Problem G:…
Problem G: Check The Check Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 10 Solved: 3[Submit][Status][Web Board] Description Your task is to write a program that reads a chessboard configuration and identifies whether a king is under attack (in chec…
Problem G Good Teacher I want to be a good teacher, so at least I need to remember all the student names. However, there are too many students, so I failed. It is a shame, so I don't want my students to know this. Whenever I need to call someone, I c…
Problem G Time Limit : 4000/2000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 16 Accepted Submission(s) : 5 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description There are Y lines parallel t…
Problem G: If We Were a Child AgainTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 18 Solved: 14[Submit][Status][Web Board]DescriptionThe Problem The first project for the poor student was to make a calculator that can just perform the basic arithmetic…
Problem G: Keywords SearchTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 10 Solved: 6[Submit][Status][Web Board] [Edit] [TestData]Descriptionn the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey also wants to…
Problem G: 圆周率 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 155 Solved: 99[Submit][Status][Web Board] Description YT大学附小举办背诵圆率 PI 的比赛.谁背的正确的位数越多,谁为胜者.很多小学生背的位数很多,但是往往会有少数位置的数是错误的.为了快速加测出错误的圆周率,将圆周率 PI 小数点后的数字求模进行简单验证. 例如:某学生背的圆周率为 3.15,则1510 mod 9…
Problem Description A relay is a race for two or more teams of runners. Each member of a team runs one section of the race. Your task is to help to evaluate the results of a relay race. You have to process several teams. For each team you are given a…
Problem Description There are many people's name and birth in a list.Your task is to print the name from young to old.(There is no pair of two has the same age.) Input First line contains a single integer T≤ which denotes the number of test cases. Fo…
G - Big Brother Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status 现在有n个囚笼,需要关押m个犯人,the big brother很担心囚笼的安全性,因为犯人都有自己的想法,他们只想住在特定的囚笼里面,那么big brother想知道最多 能关押多少个犯人,每个囚笼只能关押一个犯人,一个犯人也只能关押在一个囚笼里面. Input 第一行…
G - Infected Land Time Limit: 6000/3000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status The earth is under an attack of a deadly virus. Luckily, prompt actions of the Ministry of Health against this emergency successfully…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5954 Problem DescriptionYou have got a cylindrical cup. Its bottom diameter is 2 units and its height is 2 units as well.The height of liquid level in the cup is d (0 ≤ d ≤ 2). When you incline the cup t…
The Problem to Slow Down You Problem's Link: http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=141572 Mean: 给你两个字符串,求这两个字符串相同回文串的匹配对数. analyse: 每个字符串建一棵回文树,分别从0结点和1结点两棵树一起往下dfs,对于同一条路径上的结点,一定是相同的回文,然后两个的数量相乘加到answer中. Time complexity: O(N)…
题意:有n杯盐溶液,给定每杯里面盐的质量以及盐溶液的质量.问你有多少种方案选择一个子集,使得集合里面的盐溶液倒到一个被子里面以后,浓度为A/B. 折半枚举,暴力搜索分界线一侧的答案数,跨越分界线的答案,一侧用map存下来,枚举另一侧去统计. #include<cstdio> #include<map> using namespace std; typedef long long ll; ll ans; int n,a,b,m[39],t[39]; map<ll,int>…
f(n)定义为n的十进制表示下所有位的平方和. 问你方程K*f(n)=n在a<=n<=b中的解的个数. 发现f(n)最大不超过2000,可以直接枚举f(n),然后判断K*f(n)的位的平方和是否恰好为f(n). #include<cstdio> #include<iostream> using namespace std; typedef long long ll; ll K,a,b; int main(){ // freopen("g.in",&q…