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 ...
随机推荐
- LeetCode 22. Generate Parentheses(构造)
题目大意:给n个'(' 和 ')',构造出所有的长度为2*n并且有效的(可匹配的)字符串. 题目分析:这道题不难,可以直接搜索出所有可能的字符串,然后再逐一判断是否合法即可.但是还有更好的办法,实际上 ...
- fabric 学习笔记
fabric安装 目前,从PyPI可以搜索到主要的fabric库为“ Fabric 2.1.3 ”.“ fabric2 2.1.3 ”和“ Fabric3 1.14.post1 ”. Fabric:官 ...
- form数据请求参数格式
请求后台参数格式问题 当请求后台传递参数时,有多中类型,而每一种都需要前后台进行配合,而这有时候会很简单,有时候却十分困难,记录一下,以备后期深究 数据 后台需要的数据 form表单 嵌套数据,第二层 ...
- spring cloud学习(三)使用Ribbon实现客户端负载均衡
使用Ribbon实现客户端的负载均衡 * 个人博客空间 : https://zggdczfr.cn/ * Ribbon Spring Cloud Netflix Ribbon 是一个客户端负载均衡的组 ...
- forget word qz_out_b1
1★ be bi prep 使~成为: 2★ bene b əni 好,善 :祈祷 3★ bi 2, 双重, 两个 bi 4★ by b æ / 通过,在~之前
- 玩转控件:重绘DEVEXPRESS中DateEdit控件 —— 让DateEdit支持只选择年月 (提供源码下载)
前言 上一篇博文<玩转控件:重绘ComboBox —— 让ComboBox多列显示>中,根据大家的回馈,ComboBox已经支持筛选了,更新见博文最后最后最后面. 奇葩 这两天遇到 ...
- Vue 就地复用策略注意事项
---template部分 div el-popover(ref="message", placement="top-start", title="标 ...
- windows自动快捷方式
http://jingyan.baidu.com/article/dca1fa6fb8c408f1a5405242.html
- 《Python》 内置函数
一.内置函数: Python给你提供的,拿来直接用的函数,比如print.input等等,就是内置函数. 截止到Python版本3.6.2,现在Python一共为我们提供了68个内置函数. ...
- python的if语法
在赋值表达式中 a=a+3 if a else 0 这种简洁的语法,似乎必须要跟上else,不能写成 a=a+3 if a ,否则会报错