这题是从某个群里听别人在抱怨这题老是PE,打开status果然满眼的Presentation Error...于是闲着来做了一下. 其实挺水的,不过各种设定多一点,注意一点就行了. 一开始以为词数超过80个才换行,原来是字符数... 样例过了之后提交了结果也PE了... 于是随便弄了一下输入,胡乱复制,然后输出到文件里面检查,发现了各种字数超过80,原来还是有些细节没处理好. 于是又修改了几个地方终于A掉了. 这题的确有点恶心,考的是细节问题. 代码: #include <iostream>…
Problem Description If you ever tried to read a html document on a Macintosh, you know how hard it is if no Netscape is installed. Now, who can forget to install a HTML browser? This is very easy because most of the times you don't need one on a MAC…
直接看sample input = = 又一道模拟. #include <iostream> #include <string> #include <cstdio> using namespace std; string s; int main() { // freopen("date.out","w",stdout); ; while(cin>>s) { if(s=="<br>") {…
意甲冠军:出现<br>总结,出现<hr>出口'-',今天的字加上各行的假设是长于80然后包,每个字之前,留下一个空白格,为了输出新行结束. #include<iostream> using namespace std; int main() { char s[100]; int len,cnt=0; while(scanf("%s",s)==1) { if(!strcmp(s,"<br>")) { cnt=0; put…
题目其实不难,但是要注意题目的要求,当前字数(>0)+当前单词长度+1若超过80则需要回车后,输出当前word,并且重新计数.这道题目的数据感觉比较水,不过测试的时候,最后使用fprintf输出在文件中,便于观察. #include <stdio.h> #include <string.h> #define MAXNUM 85 char line[MAXNUM]; char word[MAXNUM]; int main() { int i; , len; //FILE *fo…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1088 对比输出 代码: #include <stdio.h> #include <string.h> #include <math.h> #include <algorithm> #include <iostream> #include <ctype.h> #include <iomanip> #include <que…
http://acm.hdu.edu.cn/showproblem.php?pid=5795 A Simple Nim Problem Description   Two players take turns picking candies from n heaps,the player who picks the last one will win the game.On each turn they can pick any number of candies which come from…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5349 MZL's simple problem Description A simple problemProblem DescriptionYou have a multiple set,and now there are three kinds of operations:1 x : add number x to set2 : delete the minimum number (if the…
A Simple Game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others)Total Submission(s): 1487    Accepted Submission(s): 939 Problem Description Agrael likes play a simple game with his friend Animal during the classes. I…
题 Description Rhason Cheung had a simple problem, and asked Teacher Mai for help. But Teacher Mai thought this problem was too simple, sometimes naive. So she ask you for help. Teacher Mai has m functions f1,f2,...,fm:{1,2,...,n}→{1,2,...,n}(that mea…
题 Description Lele now is thinking about a simple function f(x). If x < 10 f(x) = x. If x >= 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10); And ai(0<=i<=9) can only be 0 or 1 . Now, I will give a0 ~ a9 and two positive…
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5794 题意:让一个棋子从(1,1)走到(n,m),要求像马一样走日字型并只能往右下角走.里面还有r个障碍点不能经过或者到达,问有多少种走法可以走到(n,m). 思路:画个图可以发现走的点像一个斜着的杨辉三角.所以可以得到一个从点 i 走到点 j 的路径数是一个组合数. 大概就是长这样,杨辉三角的每个点的数如下. 1 1       1 1      2      1 1       3 …
A Simple Problem with Integers Time Limit: 5000/1500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4000    Accepted Submission(s): 1243 Problem Description Let A1, A2, ... , AN be N elements. You need to deal with…
解题心得: 1.仔细读题,细心细心...... 2.题的几个要求:超过八十个字符换一行,<br>换行,<hr>打印一个分割线,最后打印一个新的空行.主要是输出要求比较多. 3.检验的时候可以使用文件读入和文件输出,这样方便判别. 题目: Problem Description If you ever tried to read a html document on a Macintosh, you know how hard it is if no Netscape is inst…
MZL's simple problem Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 740    Accepted Submission(s): 357 Problem Description A simple problemProblem DescriptionYou have a multiple set,and now the…
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 592 Accepted Submission(s): 341 Problem Description After he has learned how to play Nim game, Mike begins to try another stone game which seems muc…
A Simple Problem with Integers Case Time Limit: 2000MS Description You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other i…
两种构造的方式都是正确的: 1. #include<cstdio> #include<cstring> #include<algorithm> #define maxn 60 #define ll long long using namespace std; int x; ll M,n; struct matrix { int len_x; int len_y; ll data[maxn][maxn]; void ini() { len_x=; len_y=; mems…
题意是对一段文本进行处理,如果读到 <br>,则换行:如果读到 <hr>,若当前行无字符,则输出 80 个 ’-‘ 并换行,否则在下一行输出 80 个 ’-‘ 再换行:如果一行的字符数(含空格)已达到 80,则换行. 记录一下当前行的字符数模拟即可,代码如下: #include <bits/stdc++.h> using namespace std; int main() { ]; ; while(~scanf("%s",s)) { if(!strc…
题意:有m个1~n的映射,而且对于任意的 i 满足 f1(f2(...fm(i))) = i 其中有些映射是知道的,有些是不知道的,问一共有多少种置换的组合. 分析: 首先这些置换一定是1~n的一个置换(也就是1~n的一个排列)才行,因为如果某两个数映射到同一个数的话,那么这个数往后无论怎么映射,这两个数最终映射的结果还是一样的. 如果所有的f都给出来的话,那么只要判断一下就行. 如果有一个置换不知道的话,这个置换是可以通过前后的置换计算出来的,所以只有唯一解. 如果有两个置换不知道的话,第一个…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5128 解题报告:在一个平面上给出n个点的坐标,用这n个点作为矩形的四个顶点,作两个矩形,要求两个矩形不能相交,也不能有边和点相交,然后两个矩形的面积之和要最大,求最大的面积之和是多少?如果不存在输出imp 因为n <=30,所以可以先把所有的矩形枚举出来,然后再暴力判断两两矩形组合,首先要满足位置关系,然后取面积和最大就是了.要注意的地方就是要小心一个大矩形包含一个小矩形的情况,在这种情况下,是满足…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5112 解题报告:扫一遍 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> using namespace std; ; struct node { double t,x; }rec[maxn]; double Max(do…
Computer Virus on Planet Pandora Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 256000/128000 K (Java/Others) Total Submission(s): 4090    Accepted Submission(s): 1072 Problem Description     Aliens on planet Pandora also write computer prog…
Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4972    Accepted Submission(s): 2250 Problem Description 话说上回讲到海东集团推选老总的事情,最终的结果是XHD以微弱优势当选,从此以后,“徐队”的称呼逐渐被“徐总”所取代,海东集团(HDU)也算是名副其实了.…
The more, The Better Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6324    Accepted Submission(s): 3722 Problem Description ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4727 题目大意:队列里所有人进行报数,要找出报错的那个人 思路:,只要找出序列中与钱一个人的数字差不是1的人即可,但是要注意的是这些人是从一个队列中间截取下来的,所以很有可能第一个人就报错了,一开始没有考虑这种状况所以出错了 #include<cstdio> #include <iostream> using namespace std; int main() { int t,n,an…
UVA - 10014 Simple calculations Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu id=19100" style="color:blue">Submit Status Description  Simple calculations  id=19100" style="color:blue">The Pro…
话不多说,日常一水题,水水更健康!┗|`O′|┛ 嗷~~ a/b + c/d Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 14345    Accepted Submission(s): 7470 Problem Description 给你2个分数,求他们的和,并要求和为最简形式.   Input 输入首先包含一个正整数T(T<=…
今年暑假不AC Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 55813    Accepted Submission(s): 30009 Problem Description “今年暑假不AC?” “是的.” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%...”确实如此,世界杯来了,球迷的节日也来了,估计很多AC…
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 87684    Accepted Submission(s): 36912 Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了.A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务…