hdu2069-2071
hdu2069
选取硬币组成定值,暴力
#include<stdio.h>
int v[]={,,,,,}; int main(){
int n;
while(scanf("%d",&n)!=EOF){
int ans=,ans1=;
for(int i=n/;i>=;i--){
for(int j=(n-*i)/;j>=;j--){
for(int k=(n-*i-*j)/;k>=;k--){
for(int q=(n-*i-*j-*k)/;q>=;q--){
ans1=i+j+k+q+n-i*-j*-k*-q*;
if(ans1<=)ans++;
}
}
}
}
printf("%d\n",ans); }
return ;
}
hdu2070
斐波那契数列
#include<stdio.h>
int main()
{
int n,i;
long long a[]={,};
for (i=;i<=;i++) a[i]=a[i-]+a[i-];
while (scanf("%d",&n)!=EOF&&n!=-)
{
printf ("%I64d\n",a[n]);
}
return ;
}
hdu2071
求数列最大值
#include<stdio.h>
int main()
{
int t;
while (scanf("%d",&t)!=EOF)
{
int i;
for (i=;i<=t;i++)
{
int n,j;
scanf("%d",&n);
double a[],m;
for (j=;j<=n;j++) scanf("%lf",&a[j]);
m=a[];
for (j=;j<=n;j++) if (m<a[j]) m=a[j];
printf("%.2lf\n",m);
}
}
return ;
}
hdu2069-2071的更多相关文章
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- HDU 2071 Max Num
http://acm.hdu.edu.cn/showproblem.php?pid=2071 Problem Description There are some students in a clas ...
- loj#2071. 「JSOI2016」最佳团体
题目链接 loj#2071. 「JSOI2016」最佳团体 题解 树形dp强行01分规 代码 #include<cstdio> #include<cstring> #inclu ...
- 杭电oj2031、2033、2070、2071、2075、2089、2090、2092、2096-2099
2031 进制转换 #include<stdio.h> #include<string.h> int main(){ int n,i,r,x,j,flag; ]; while ...
- hdu 2071
Ps:输出n个数里最大的 #include "stdio.h" int main(){ ],max; int i,j,n,t; while(~scanf("%d" ...
- HDOJ 2071 Max Num
Problem Description There are some students in a class, Can you help teacher find the highest studen ...
- zoj 2071 Technology Trader 最大权闭合子图
传送门 和上一题一样, 也是一个最大权闭合子图.不过建图好麻烦的感觉 写了好久. 源点和原材料连边, 权值为val. 汇点和产品连边, 权值为val. 产品与和它有关系的材料连边, 权值inf. 最 ...
- hdoj:2071
Max Num Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Sub ...
- 【LOJ】#2071. 「JSOI2016」最佳团体
题解 01分数规划,二分加树背包-- 代码 #include <bits/stdc++.h> #define enter putchar('\n') #define space putch ...
- hdu2069(Coin Change)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2069 Coin Change Time Limit: 1000/1000 MS (Java/Other ...
随机推荐
- 记录Vmware Workstation及Centos6.8 的安装
网上找到的一个非常详细的安装详解.个人觉得非常好.于是加保存一下.地址:http://www.mamicode.com/info-detail-1462939.html
- C#一套简单的单例系统
单例基类 public class CSingletonBase<TYPE> { public static TYPE Singleton { get { return m_singlet ...
- Python mysql-表的创建,删除和更新
2017-09-06 20:59:56 数据库的创建 CREATE DATEBASE <数据库的名称> 表的创建 CREATE TABLE <表名> (<列名1> ...
- python-day9-循环嵌套
练习:99乘法表: # for line in range(1,10): #line=2# for row in range(1,line+1):# print('%s*%s=%s' %(line,r ...
- POJ-1129 Channel Allocation (DFS)
Description When a radio station is broadcasting over a very large area, repeaters are used to retra ...
- 将 HttpPostedFile 转换成 Image 或者 Bitmap
代码如下: HttpFileCollection httpfiles = context.Request.Files; files = httpfiles[i]; Image im = Image.F ...
- OC self注意事项
#import <Foundation/Foundation.h> @interface Person : NSObject - (void)test; + (void)test; - ( ...
- QT分析之WebKit
该文章整理自 网易博客 http://blog.163.com/net_worm/blog/static/12770241920101831312381/ 转载请注明出处 WebKit是QT4新整合的 ...
- dup的使用
转自:http://www.cnblogs.com/GODYCA/archive/2013/01/05/2846197.html 下面是关于实现重定向的函数dup和dup2的解释: 系统调用dup和d ...
- java并发编程:线程安全管理类--原子操作类--AtomicStampedReference<V>
1.类 AtomicStampedReference<V> AtomicStampedReference 维护带有整数“标志”的对象引用,可以用原子方式对其进行更新. 实现注意事项.通过创 ...