- 博客(106)
- 收藏
- 关注

原创 本博客所有ACM题目AC代码(持续更新中)
hdoj题目AC代码hdoj_1000 A + B Problem http://blog.youkuaiyun.com/love_acm_love_mm/article/details/8827555hdoj_1001 Sum Problem http://blog.youkuaiyun.com/love_acm_love_mm/article/details/8828069hdoj_1002 A
2013-05-28 00:24:36
2952
原创 hdoj_2049 不容易系列之(4)——考新郎
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2049 //C++代码#include#includeusing namespace std;int main(){ int C,n,m,k,i; __int64 t,f[21]; f[1]=0,f[2]=1; for(i=3;i<=20;i++) f[i]=(i-1)*(f[
2013-06-02 20:54:13
617
原创 hdoj_2048 神、上帝以及老天爷
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2048 //C++代码#include#includeusing namespace std;int main(){ int C,n,i; double t,f[21]; f[1]=0,f[2]=1; for(i=3;i<=20;i++) f[i]=(i-1)*(f[i-1]+
2013-06-02 20:46:31
812
原创 hdoj_2047 阿牛的EOF牛肉串
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2047 //C++代码#include#includeusing namespace std;int main(){ int n,i; __int64 f[40]; f[1]=3,f[2]=8; for(i=3;i<=39;i++) f[i]=(f[i-1]+f[i-2])*2
2013-06-02 20:16:33
860
原创 hdoj_2046 骨牌铺方格
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2046 //C++代码#include#includeusing namespace std;int main(){ int n,i; __int64 f[51]; f[1]=1,f[2]=2; for(i=3;i<=50;i++) f[i]=f[i-1]+f[i-2]; w
2013-06-02 19:25:51
702
原创 hdoj_2045 不容易系列之(3)—— LELE的RPG难题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2045 //C++代码#include#includeusing namespace std;int main(){ int n,i; __int64 t=12,f[51]; f[1]=3,f[2]=6; for(i=3;i<=50;i++){ f[i]=t-f[i-1];
2013-06-02 19:18:21
683
原创 hdoj_2044 一只小蜜蜂...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2044 //C++代码#includeusing namespace std;int main(){ int n,a,b,i; long long f[49]; f[1]=1,f[2]=2; for(i=3;i<=48;i++) f[i]=f[i-1]+f[i-2]; cin>
2013-06-02 18:47:39
606
原创 hdoj_2043 密码
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2043 //C++代码#include#include#includeusing namespace std;int main(){ int n,len,i; char a[55]; cin>>n; while(n--){ cin>>a; len=strlen(a);
2013-06-02 18:34:03
674
原创 hdoj_2042 不容易系列之二
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2042 //C++代码#includeusing namespace std;int main(){ int n,a,i,f[31]; f[0]=3; for(i=1;i<=30;i++) f[i]=2*(f[i-1]-1); cin>>n; while(n--){ cin
2013-06-02 18:20:51
588
原创 hdoj_2041 超级楼梯
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2041 //C++代码#includeusing namespace std;int main(){ int n,m,i,f[41]; f[1]=f[2]=1; for(i=3;i<=40;i++) f[i]=f[i-1]+f[i-2]; cin>>n; while(n--){
2013-06-02 17:38:53
638
原创 hdoj_2040 亲和数
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2040 //C++代码#includeusing namespace std;int main(){ int n,a,b,i,sum; cin>>n; while(n--){ cin>>a>>b; sum=1; for(i=2;i*i<=a;i++){ if(a%
2013-06-02 17:30:18
742
原创 zoj_2836 Number Puzzle
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1836 //C++代码#includeusing namespace std;int n,m,ans,a[11];int gcd(int a,int b){ return b==0? a:gcd(b,a%b);}int lcm(int a,i
2013-06-01 14:56:48
594
原创 hdoj_2039 三角形
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2039 //C++代码#includeusing namespace std;int main(){ int n,m; cin>>n; while(n--){ double a,sum=0,max=0; m=3; while(m--){ cin>>a; su
2013-05-31 23:00:29
616
原创 hdoj_2037 今年暑假不AC
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2037 //C++代码#include#includeusing namespace std;struct T{ int s,e; bool operator <(const T a) const{ return e<a.e; }}t[100];int main(){
2013-05-31 22:38:12
646
原创 hdoj_2036 改革春风吹满地
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2036 //C++代码#include#include#includeusing namespace std;int main(){ int n; while(cin>>n,n){ double ans=0; int x1,y1,x2,y2,x3,y3; cin>>x
2013-05-31 22:16:39
850
原创 hdoj_2035 人见人爱A^B
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2035 //C++代码#includeusing namespace std;int main(){ int a,b; while(cin>>a>>b,a||b){ int ans=1,i; for(i=0;i<b;i++) ans=(ans*a)%1000; cout<
2013-05-31 21:51:49
679
原创 hdoj_2034 人见人爱A-B
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2034 //C++代码#include#includeusing namespace std;int main(){ int n,m,i,j,k,a[100],b[100]; while(cin>>n>>m,n||m){ for(i=0;i>a[i]; for(i=0;i>
2013-05-31 21:44:57
872
原创 hdoj_2033 人见人爱A+B
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2033 //C++代码#includeusing namespace std;int main(){ int n,AH,AM,AS,BH,BM,BS; cin>>n; while(n--){ cin>>AH>>AM>>AS>>BH>>BM>>BS; int CH=0,CM=
2013-05-31 21:07:45
815
原创 hdoj_2032 杨辉三角
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2032 //C++代码#includeusing namespace std;int main(){ int n,i,j,a[30][30]; for(i=0;i<30;i++) a[i][0]=a[i][i]=1; for(i=2;i<30;i++){ for(j=1;j<=
2013-05-31 20:49:11
669
原创 hdoj_2031 进制转换
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2031 //C++代码#includeusing namespace std;int main(){ int n,r,m,i,a[35]; while(cin>>n>>r){ bool flag=0; if(n<0){ flag=1; n=-n; } m=
2013-05-31 13:43:15
724
原创 codeforces_59B Fortune Telling
题目链接:http://codeforces.com/problemset/problem/59/B //C++代码#includeusing namespace std;int main(){ int n,m,sum=0,a=101; cin>>n; while(n--){ cin>>m; sum+=m; if(m&1 && m<a) a=m; } if(s
2013-05-31 10:42:20
864
原创 hdoj_2030 汉字统计
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2030 //C++代码//汉字对应两位ASCII码,且为负数#include#include#includeusing namespace std;int main(){ int n,m,i; char a[1000]; (cin>>n).getline(a,1000);
2013-05-31 09:57:35
614
原创 hdoj_2029 Palindromes _easy version
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2029 //C++代码#include#include#includeusing namespace std;int main(){ int n,i,len; char a[1000]; cin>>n; while(n--){ cin>>a; len=strlen(a
2013-05-30 23:30:22
543
原创 hdoj_2028 Lowest Common Multiple Plus
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2028 //C++代码#includeusing namespace std;int gcd(int a,int b){ return b==0? a:gcd(b,a%b);}int main(){ int n,m,ans; while(cin>>n){ ans=1;
2013-05-30 23:21:03
573
原创 hdoj_2027 统计元音
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2027 //C++代码#include#include#includeusing namespace std;int main(){ int n; char a[105]; (cin>>n).getline(a,105); while(n--){ int i,b[5]={
2013-05-30 23:13:41
729
原创 hdoj_2026 首字母变大写
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2026 //C++代码#include#include#include#includeusing namespace std;int main(){ char a[105]; while(cin.getline(a,105)){ int i,len=strlen(a);
2013-05-30 23:03:48
651
原创 hdoj_2025 查找最大元素
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2025 //C++代码#include#include#includeusing namespace std;int main(){ char a[105],ch; while(cin.getline(a,105)){ int i,len=strlen(a); ch=a[
2013-05-30 22:49:05
670
原创 hdoj_2024 C语言合法标识符
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2024 //C++代码#include#include#include#includeusing namespace std;int main(){ int n,i; char a[55]; (cin>>n).getline(a,55); while(n--){ cin
2013-05-30 22:38:59
682
原创 zoj_3621 Factorial Problem in Base K
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4745 //C++代码#include#include#includeusing namespace std;typedef long long LL;int main(){ string p; LL k; while(cin>>p>>k)
2013-05-30 22:02:35
658
原创 codeforces_38C Blinds
题目链接:http://codeforces.com/problemset/problem/38/C //C++代码#includeusing namespace std;int main(){ int n,l,max=0,ans=0,i,j,a[100]; cin>>n>>l; for(i=0;i<n;i++){ cin>>a[i]; if(a[i]>max) ma
2013-05-30 17:43:33
671
原创 hdoj_2023 求平均成绩
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2023 //C++代码#include#includeusing namespace std;int main(){ int n,m,i,j,a[50][5]; while(cin>>n>>m){ double b[50]={0},c[5]={0},d[5]; for(i=
2013-05-30 13:25:21
877
原创 hdoj_2022 海选女主角
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2022 //C++代码#include#includeusing namespace std;int main(){ int m,n,i,j,k; while(cin>>m>>n){ int x=1,y=1,s=0; for(i=1;i<=m;i++){ for(j=
2013-05-30 12:54:51
1080
原创 hdoj_2021 发工资咯:)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2021 //C++代码#includeusing namespace std;int cal(int n){ int count=0,i=0,a[6]={100,50,10,5,2,1}; while(n){ count+=n/a[i]; n%=a[i++]; } ret
2013-05-30 08:36:19
753
原创 hdoj_2020 绝对值排序
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2020 //C++代码#include#includeusing namespace std;int main(){ int n,i,j,k,t,a[105]; while(cin>>n,n){ for(i=0;i<n;i++){ cin>>a[i]; for(j=
2013-05-30 08:18:33
681
原创 hdoj_2019 数列有序!
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2019 //C++代码#includeusing namespace std;int main(){ int n,m,a,i; while(cin>>n>>m,n||m){ bool flag=0; for(i=1;i<=n;i++){ cin>>a; if(!f
2013-05-29 21:00:22
786
原创 hdoj_2018 母牛的故事
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2018 //C++代码#includeusing namespace std;int main(){ int n,i,f[55]; f[1]=1,f[2]=2,f[3]=3; for(i=4;i<55;i++) f[i]=f[i-1]+f[i-3]; while(cin>>n,n
2013-05-29 20:37:00
564
原创 hdoj_2017 字符串统计
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2017 //C++代码#include#include#includeusing namespace std;int main(){ int n,i,ans; char a[1000]; cin>>n; while(n--){ cin>>a; for(ans=0,i=
2013-05-29 18:29:07
641
原创 hdoj_2016 数据的交换输出
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2016 //C++代码#includeusing namespace std;int main(){ int n,a[100]; while(cin>>n,n){ int i,j=0; for(i=0;i<n;i++){ cin>>a[i]; if(a[i]<a[
2013-05-29 18:15:11
658
原创 hdoj_2015 偶数求和
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2015 //C++代码#includeusing namespace std;int main(){ int n,m; while(cin>>n>>m){ int i=(n-1)/m,j=0; while(j<i){ cout<<1+m+2*j*m<<" "; j
2013-05-29 18:03:21
609
原创 hdoj_2014 青年歌手大奖赛_评委会打分
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2014 //C++代码#include#includeusing namespace std;int main(){ int n; while(cin>>n){ double m,sum=0,min=100,max=0; for(int i=1;i<=n;i++){
2013-05-29 12:49:40
821
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人