水
躺平平的弱鸡
IT界资深菜鸟。。
展开
-
hdu1234开门人和关门人
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1234就是水。。。#include #include #include using namespace std;const int maxn = 1000;struct record{ int starth,startm,starts; int en原创 2016-03-24 17:46:55 · 396 阅读 · 0 评论 -
hdu1194Beat the Spread!
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1194思路:如果绝对值比和还大就不可能,然后就可以暴力枚举了。代码:#include int abs(int n){ return n > 0 ? n : -n;}int main(){ int _; while(~sca原创 2016-04-24 10:30:28 · 325 阅读 · 0 评论 -
hdu1202The calculation of GPA
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1202继续水水水水水。代码:#include #include struct Node{ double s; double p; double gp;}a[1000000];int main(){ int _; whi原创 2016-04-24 11:01:40 · 281 阅读 · 0 评论 -
hdu1219AC Me
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1219for(int i = 0;i 代码:#include #include char s[100005];int a[30];int main(){ while(gets(s)) { memset(a,0,sizeof(a)原创 2016-04-24 11:25:06 · 346 阅读 · 0 评论 -
hdu1236排名
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1236水水代码:#include #include #include using namespace std;int n,m,g;int s[15];struct Node { char num[30]; int a; int scor原创 2016-04-24 11:42:49 · 282 阅读 · 0 评论 -
NYOJ1092数字分隔(二)(水水)
参照了别人的思路。代码:#include #include const int maxn = 120;char s[maxn];int main(){ while(~scanf("%s",s + 1)) { int flag = 0; //标记是否有负号 char* point; int len ;原创 2016-09-12 18:40:54 · 459 阅读 · 0 评论 -
uva401Palindromes
这个题的核心就是判断镜像字符串,镜像字符串是不能包含 没有reverse的字符的,例如B C代码:#include #include char s[100];bool is_h(){ int len = strlen(s); if(len == 1) return 1; int i = 0,j = len - 1; w原创 2016-09-19 22:57:51 · 165 阅读 · 0 评论 -
uva232Crossword Answers
模拟不解释。源码#include #include #include using namespace std;char s[15][15];int f[15][15];int n,m;struct N{ int num; char s1[20];}down[105];bool cmp(N x,N y){ return x.num原创 2016-09-21 16:41:18 · 265 阅读 · 0 评论 -
uva1368Consensus String(水)
一开始理解错了题意,以为要求的序列是m个中的一个。。源码#include #include #include using namespace std;int n,m;char s[55][1005];char ans[1005];int a[30];int main(){ int t; scanf("%d",&t); whi原创 2016-09-21 17:48:46 · 226 阅读 · 0 评论 -
uva10340 (字符串模拟)
不解释,直接上源码。#include #include const int maxn = 1e6 + 5;char s[maxn],t[maxn];int main(){ while(~scanf("%s%s",s,t)) { int len_s = strlen(s); int len_t = strlen(t);原创 2016-09-26 17:00:07 · 209 阅读 · 0 评论 -
uva1339古老的密码
理解题意真的很重要,题目说某种映射,而不单单是 B->A ,C -> B 这种的。源码:#include #include #include using namespace std;char s[105],s1[105];int s_v[105],s1_v[105];int main(){ while(~scanf("%s%s",s,s1)) {原创 2016-09-26 17:37:09 · 303 阅读 · 0 评论 -
uva489 (模拟加判断)
源码#include #include #define maxn 1000005char s[maxn],s1[maxn];int v[30];int len_s,len_s1;int error ;bool guess(char c){ int r = strlen(s); int flag = 0; if(v[c - 'a'])原创 2016-09-27 19:25:04 · 340 阅读 · 0 评论 -
hdu1170Balloon Comes!
水题我都不想贴题目链接了。代码#include #include char c;char a[10],b[10];int main(){ int _; scanf("%d",&_); while(_--) { getchar(); scanf("%c%s%s",&c,a,b);原创 2016-04-24 09:59:56 · 266 阅读 · 0 评论 -
hdu1164Eddy's research I
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1164素数筛了。代码:#include int prime[1000000];void init(){ for(int i = 2;i <= 65535;++i) prime[i] = 1; for(int i = 2;i <=原创 2016-04-23 23:37:42 · 292 阅读 · 0 评论 -
hdu1235
更水。。。#include #include #include using namespace std;int a[1005];int main(){ int n; while(~scanf("%d",&n),n) { for(int i = 0;i < n;++i) scanf("%d",&a[i]);原创 2016-03-24 17:51:47 · 312 阅读 · 0 评论 -
1256画8
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1256这个题描述有点不清楚,要计算一下高度和6的关系,才是宽度。。。代码#include int down,up,h;char key;int cnt6;void print_horizontal(){ for(int i = 1; i <= cnt6;原创 2016-03-24 18:29:14 · 309 阅读 · 0 评论 -
hdu1262寻找素数对
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1262太水了....#include #include #include bool isP(int n){ if(n == 1) return false; int k = sqrt(n); for(int i = 2; i原创 2016-03-24 19:17:23 · 339 阅读 · 0 评论 -
hdu1248寒冰王座
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1248就是一个完全背包的模板题,水水水。代码:#include #include #include using namespace std;int n;int c[] = {150,200,350};int w[] = {150,200,350};int原创 2016-04-25 17:44:11 · 230 阅读 · 0 评论 -
hdu1302The Snail
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1302这道题真的醉了。。代码:#include int main(){ double h,u,d,f; while(~scanf("%lf%lf%lf%lf",&h,&u,&d,&f),h) { double sum =原创 2016-04-25 19:09:49 · 385 阅读 · 0 评论 -
杭电题目分类
基础题:1000、1001、1004、1005、1008、1012、1013、1014、1017、1019、1021、1028、1029、1032、1037、1040、1048、1056、1058、1061、1070、1076、1089、1090、1091、1092、1093、1094、1095、1096、1097、1098、1106、1108、1157、1163、1164、1170、1194、1原创 2016-04-25 20:20:44 · 248 阅读 · 0 评论 -
hdu1399Starship Hakodate-maru
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1399这道题普通的双层循环15MS代码:#include int a[200];int b[200];int n;int ans ;int a_len,b_len;void init(){ for(int i = 0; i < 54; ++i)原创 2016-05-10 17:40:37 · 369 阅读 · 0 评论 -
hdu1391Number Steps
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1391x,y的范围是 0到5000.。。。代码:#include struct point{ int x,y;}a[10005];int main(){ a[0].x = 0; a[0].y = 0; a[1].x = 1;原创 2016-05-04 21:38:06 · 305 阅读 · 0 评论 -
HDU1058Humble Numbers
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1058水水更健康。。代码:#include #include #include using namespace std;typedef long long ll;ll ans[6000];ll prime[] = {2,3,5,7};void init()原创 2016-04-22 23:26:53 · 213 阅读 · 0 评论 -
hdu1070Milk
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1070水。代码:#include #include #include using namespace std;struct Node{ char s[105]; int price; int v; double perPrice;原创 2016-04-23 00:37:22 · 338 阅读 · 0 评论 -
hdu1163Eddy's digital Roots
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1163九余数定理:一个数的每位数字之和如果不小于10,那么就继续相加,直到小于10,相当于这个数对9取余。代码:#include int main(){ int n; while(~scanf("%d",&n),n) {原创 2016-04-23 17:09:55 · 253 阅读 · 0 评论 -
hdu1397素数筛+打表+标记+二分
呵呵呵呵呵。。代码:#include #include #include #include using namespace std;const int maxn = 1 << 15;int f[maxn + 5] ;vector primes;int v[maxn + 5];int v1[maxn + 5];void Eratoshenes(int n)原创 2016-09-30 18:16:51 · 372 阅读 · 0 评论