poj 3100 (zoj 2818)||ZOJ 2829 ||ZOJ 1938 (poj 2249)
来源:互联网 发布:公众号小说收费源码 编辑:程序博客网 时间:2024/06/13 01:23
水题三题:
1.给你B和N,求个整数A使得A^n最接近B
2. 输出第N个能被3或者5整除的数
3.给你整数n和k,让你求组合数c(n,k)
1.poj 3100 (zoj 2818) Root of the Problem:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2818
http://poj.org/problem?id=3100
#include<cstdio>#include<cmath>int main(){int b,n;while(~scanf("%d%d",&b,&n),b||n){int a=pow(b,1.0/n);int ans=a;if(b-pow(ans,n) > pow(ans+1,n)-b)ans++;printf("%d\n",ans);}return 0;}
2.ZOJ 2829 Beautiful Number
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1829
#include<cstdio>const int MAXN=300000;int a[MAXN],len=1;int main(){for(int i=3;i<MAXN;i++)if(i % 3==0 || i %5==0)a[len++]=i;int n;while(~scanf("%d",&n)){printf("%d\n",a[n]);}return 0;}
http://poj.org/problem?id=2249
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=938
#include<cstdio>typedef long long LL;LL ans,n,k;int main(){while(scanf("%lld%lld",&n,&k),n){ans=1;if(k == 0){printf("1\n");continue;}if(k > n-k )k=n-k;for(int i=1;i<=k;i++){ans=ans*(n-i+1)/i;}printf("%lld\n",ans);}return 0;}
2 0
- poj 3100 (zoj 2818)||ZOJ 2829 ||ZOJ 1938 (poj 2249)
- zoj 1354 poj 1222
- poj 1637 zoj 1992
- poj 3067 && zoj 3129
- ZOJ 1082(POJ 1125)
- zoj 1857 || poj 2607
- zoj poj 题目分类
- ZOJ POJ题目分类
- zoj 1361 | poj 1324
- POJ 2080/ZOJ 2420
- poj 1511,zoj 2008
- POJ 1129/ZOJ 1084
- zoj、poj 题目分类
- poj 2263&&zoj 1952
- poj 2253&zoj 1942
- poj 2240 &zoj 1092
- poj 1556 &zoj 1721
- poj 2585& zoj 2193
- 【Watir Webdriver】自动化上传照片到百度相册
- leetcode Next Permutation
- 混淆的艺术-(苍井空变凤姐)Proguard源码分析(三)Proguard配置解析~上
- 添加文件到Sdcard出现Failed to push selection: Invalid argument问题
- 4.2 函数形参、实参、默认参数
- poj 3100 (zoj 2818)||ZOJ 2829 ||ZOJ 1938 (poj 2249)
- UITableView 滚动流程性优化
- 每日学习心得:$.extend()方法和(function($){...})(jQuery)详解
- PowerDesigner导出mysql脚本里包含视图
- macbook装机注意事项&&双系统崩溃解决办法
- 获取android应用签名证书(打包APK用到的那个文件)的SHA1,MD5,SHA256值
- poj3740 Easy Finding DLX
- MySQL server has gone away报错原因分析
- UVA - 1372 Log Jumping