![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
简单题
今天没吃药
这个作者很懒,什么都没留下…
展开
-
HDU1040 - As Easy As A+B (简单题)
题目链接思路代码思路水题代码#include <algorithm>#include <cstdio>using namespace std;int num[1010];int main(){ int t, n; scanf("%d", &t); while(t--) { scanf("%d", &n); for(int i=0原创 2015-09-04 17:14:08 · 283 阅读 · 0 评论 -
SPOJ42 - Adding Reversed Numbers (简单题)
题目链接思路题意真的很容易理解错呀…… 就是给两个数,翻转后加和,然后再翻转后输出 用字符串加,不用翻转(从头开始加就是反的),直接加然后除掉前面的 0 输出就行代码#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;char ans[20];char原创 2015-10-11 20:17:57 · 379 阅读 · 0 评论 -
HDU1425 - sort (简单题)
题目链接思路代码思路水题,可以直接用 sort 过。另一种思路就是:因为题中的数据是不重复的,且数据较少,所以直接开一个数组,将对应的位置设置为真,然后从后往前输出即可,也是比较慢的,但也是一种思路。代码#include <cstdio>#include <cstring>using namespace std;bool num[1000100];int main(){ int n原创 2015-09-08 17:13:12 · 719 阅读 · 0 评论 -
HDU1048 - The Hardest Problem Ever (简单题)
题目链接思路代码思路一道简单的入门题,列出表,然后输入输出就行。不过最开始智商被压制了,漏掉了字母 DD, WA 到哭。代码#include <cstring>#include <cstdio>using namespace std;int main(){ char table[250]; char text[1000]; table[0] = '\n'; fo原创 2015-09-06 19:03:01 · 423 阅读 · 0 评论 -
HDU5427 - A problem of sorting (简单题)
题目链接思路代码思路简单题, 给姓名和生日的组合, 让按照年龄的大小输出。 不过姓名可能中间有空格,因为生日是一行的后4位,所以直接读一行,然后在生日前截断,排序就行。代码#include <cstring>#include <algorithm>#include <cstdio>using namespace std;struct node{ char name[110];原创 2015-09-06 20:26:19 · 970 阅读 · 0 评论 -
HDU1049 - Climbing Worm (模拟)
题目链接思路代码思路因为最后一次不用下滑,所以我们模拟到 deep−updeep-up 就可以停止了。代码#include <cstdio>using namespace std;int main(){ int deep, up, down; while(scanf("%d%d%d", &deep, &up, &down)&&deep) { for(int原创 2015-09-06 23:18:51 · 393 阅读 · 0 评论 -
HDU1039 - Easier Done Than Said? (简单题)
题目链接思路代码思路题目要求按照3个标准来验证密码是否合格。所以遍历一遍字符串,看是否满足就可以了,这一类题的题意都很简单,就是要细心,考虑到一些边界特殊情况什么的。细节见代码……代码#include <cstdio>#include <cstring>using namespace std;char str[1000];int main(){ bool vowel[130];原创 2015-09-04 17:05:52 · 397 阅读 · 0 评论 -
HDU1036 - Average is not Fast Enough! (简单题)
题目链接思路代码思路比较难的地方就是各种格式控制,做题的时候细心点就可以了。代码#include <cstdio>#include <cmath>using namespace std;int main(){ int n, id, ans; double s; char str[10]; bool finish; scanf("%d%lf", &n, &s原创 2015-09-04 15:42:02 · 513 阅读 · 0 评论 -
HDU1037 - Keep on Truckin' (简单题)
题目链接思路代码思路这是一道英语阅读题代码#include <cstdio>using namespace std;int main(){ int a, b, c; scanf("%d%d%d", &a, &b, &c); if(a<168) printf("CRASH %d\n", a); else if(b<168) printf("CRASH %d\n",原创 2015-09-04 15:56:43 · 343 阅读 · 0 评论 -
HDU5586 - Sum (最大子列和)
题目链接思路代码思路将数组处理一下,保存变化后和变化的差值。 这样的话,正数代表有益,负数代表无益,这样对整个数组进行一次遍历,就可以得到最大获益的变化。代码#include <iostream>#include <cstdlib>#include <cstdio>using namespace std;typedef long long ll;int num[1000100];int原创 2015-12-08 12:33:24 · 442 阅读 · 0 评论