- 博客(10)
- 收藏
- 关注
原创 hdu ACM Steps 3.3
基本都是背包问题,不熟悉的同学可以找《背包九讲》 3.3.1 Big Event in HDU#include#includeusing namespace std;int dp[100000];int main(){ int n; scanf("%d",&n); while (n>=0) { int v[1
2012-08-16 10:36:33
656
原创 hdu ACM Steps 3.2
这节完全是基础的DP,就直接贴代码了 3.2.1 Max Sum#include#includeusing namespace std;int main(){ int t,n,max,res; int a[100001],dp[100001],f[100001]; scanf("%d",&t); for (int tt=1;tt<
2012-08-16 10:21:19
261
原创 hdu ACM Steps 3.1
3.1.1 超级楼梯#includeusing namespace std;long long a[100];int main(){ int n,m; a[1] = 1; a[2] = 1; for (int i=3;i<=40;i++) a[i]=a[i-1]+a[i-2]; scanf("%d",&n); while (n
2012-08-16 10:03:30
269
原创 hdu ACM Steps 2.3
2.3.1 A + B Problem II高精度什么的最讨厌了#include#include#define N 1005char A[N],B[N],sum[N];int main(){ int T,i,j,k,x,sign; while(scanf("%d",&T)!=EOF) { for(i=0;i<T;i++)
2012-08-15 15:40:01
437
原创 hdu ACM Steps 2.2
2.2.1 Fibonacci通项公式求值,再取对数求高四位,很巧妙的方法n较大时小数部分的幂趋向0,可以舍弃。取对数后值的整数部分代表位数,小数部分保存了具体信息(类似科学计数法)之后用小数部分求出前四位即可#include#includeusing namespace std;int fac[21]={0,1,1};const double f=(sqr
2012-08-15 15:07:59
327
原创 hdu ACM Steps 2.1
2.1.1 最小公倍数includeusing namespace std;int gcd(int x,int y){ if (!x || !y) return x>y ? x : y; for (int t;t=x%y;x=y,y=t); return y;}int main(){ int a,b; while (cin>>a>>b
2012-08-15 13:53:03
414
原创 hdu ACM Steps 1.3
1.3.1 FatMouse' Trade优先性价比高的,明显的贪心#include#includeusing namespace std;int main(){ int m,n; cout<<fixed<<setprecision(3); cin>>m>>n; while (m!=-1 || n!=-1) {
2012-08-13 12:16:50
279
原创 hdu ACM Steps 1.2
1.2.1 Financial Management#include#includeusing namespace std;int main(){ double sum=0,b; for (int i=0;i<12;i++) { cin>>b; sum+=b; } sum=sum/12;
2012-08-13 11:48:53
460
原创 hdu ACM Steps 1.1
1.1.1 A+B for Input-Output Practice (I)#includeusing namespace std;int main(){ int a,b; while (cin>>a>>b) { cout<<a+b<<endl; }} 1.1.2 A+B for Input-Output
2012-08-13 11:35:06
385
原创 目录
本人菜鸟一枚,望各路大牛不吝指教hdu的ACMSteps题目设计虽然存在不合理的地方(尼玛前面有些题目那么难是闹哪样),不过还是很适合作为专题练习的下面给出本人刷出的各章节大纲(据说不同的人题目会有些不一样,未验证)1.1 基本输入输出(各种A+B problem)1.2 基本数据处理(计数,求平均,字符转换什么的)1.3 贪心,排序2.1 简单数学,素数2.2 递归
2012-08-13 11:18:36
565
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人