HDOJ
Lostwinder
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDOJ1003 Max Sum
一道基础的动态规划。。。 废话不多说,贴代码。原创 2014-06-28 15:08:57 · 521 阅读 · 0 评论 -
HDOJ1019 Least Common Multiple
大体思路是先求出1,2个数的LCM2,再求LCM2和第3个数的LCM=L原创 2014-07-09 13:38:33 · 502 阅读 · 0 评论 -
HDOJ1021 Fibonacci again
水题。。 #include "stdio.h" int main(){ unsigned char f[1000009]; int k,i; f[1]=1; f[2]=2; for(i=3;i<=1000000;i++)f[i]=(f[i-1]+f[i-2])%3; while(scanf("%d",&k)!=EOF){ if(!f[k+1])printf("yes\n");el原创 2014-07-09 14:12:49 · 587 阅读 · 0 评论 -
HDOJ1014 Uniform Generator
水题。。找规律可知两数最大公约数为1时是GOOD,反之是BAD。 注意输出格式。 #include "stdio.h" int GCD(int a,int b){ if(!b)return a; else return GCD(b,a%b); } int main(){ int gcd,x,y; while(scanf("%d%d原创 2014-07-08 21:28:00 · 580 阅读 · 0 评论 -
HDOJ1027 Ignatius and the Princess II
这道题有多种做法。数学编码、康托展开、STL库等。原创 2014-07-11 11:20:07 · 866 阅读 · 0 评论 -
HDOJ1027
#include "stdio.h" int main(){ unsigned char is_used[1002]; int n,m,i,j,Count,c; int jiecheng[12]={1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800}; while(scanf("%d%d",&n,&m)!=EOF){ for(i=1原创 2014-07-11 11:11:04 · 628 阅读 · 0 评论 -
HDOJ1028 Ignatius and the Princess III
64以前DFS,65以后打表- - #include "stdio.h" int count=0; int ans[56]={2012558,2323520,2679689,3087735,3554345,4087968,4697205,5392783, 6185689,7089500,8118264,9289091,10619863,12132164,13848650,15796476,180原创 2014-07-11 13:27:03 · 555 阅读 · 0 评论 -
HDOJ1029 Ignatius and his princess IV
水题。。类似桶排的思路- - #include #include #include using namespace std; const int maxn=500000; int a[maxn]; int main() { int n; while(scanf("%d",&n)!=EOF) { memset(a,0,sizeof(a));原创 2014-07-11 13:28:12 · 519 阅读 · 0 评论 -
HDOJ1018 Big Numbers
不得不说,数据太水。。 968MSxian xian原创 2014-07-09 13:21:26 · 608 阅读 · 0 评论 -
HDOJ1017 A Mathematical Curiosity
此题表述过于隐晦。。话说出题人的语文(英语)是体育老师教的?- -原创 2014-07-09 13:07:42 · 634 阅读 · 0 评论 -
HDOJ1016 Prime Ring Problem
水题。这道题如果取n=19,直接枚举的运算量大概在原创 2014-07-09 12:50:46 · 542 阅读 · 0 评论 -
HDOJ1008 Elevator
水题。不多说。原创 2014-06-29 14:27:55 · 468 阅读 · 0 评论 -
HDOJ1032 The 3n+1 problem
一道水题。。 Caution:1.题目中没有给出i,j的大小关系,所哟原创 2014-06-30 11:57:49 · 642 阅读 · 0 评论 -
HDOJ1048 The Hardest Problem Ever
此题目完全和标题对不上号。。 #include "stdio.h" int main(){ char str[28]="VWXYZABCDEFGHIJKLMNOPQRSTU"; int i,j; char ch; while(1){ for(i=1;i<=6;i++)ch=getchar(); if(ch=='\n'){ while((ch=getchar())!='\n'原创 2014-06-30 13:02:30 · 609 阅读 · 0 评论 -
HDOJ1012 u Calculate e
这题如果不AC的话,也太说不过去了。。 预先计算0~9时式子的值,然后直接输出。原创 2014-06-30 12:37:41 · 675 阅读 · 0 评论 -
HDOJ1058 H数
思路:从{d[p2]*2,d[p3]*3,d[p5]*5,d[p7]*7}这四个数中取出原创 2014-06-30 14:33:51 · 617 阅读 · 0 评论 -
HDOJ1128 Self Numbers
#include "stdio.h" /*#include "time.h"*/ const int MAXINT=1000000; int count=0; int Make(int x){ int temp=x; while(x>0){ temp=temp+x%10; x=x/10; count++; } return temp; } int main(){ unsign原创 2014-07-07 13:47:28 · 567 阅读 · 0 评论 -
HDOJ1020 Encoding
水题。。简单模拟就可以了。原创 2014-07-09 13:55:42 · 506 阅读 · 0 评论 -
HDOJ1015 Safecracker
水题。。注意读题。。 #include "stdio.h" #include "stdlib.h" #include "string.h" int cmp(const void *a,const void *b){ return(*(int *)b-*(int *)a); } int power(int a,int b){ int i,mul=1; for(i=1;i<=b;原创 2014-07-08 22:21:00 · 577 阅读 · 0 评论
分享