水题三题:

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;
}

3.ZOJ 1938 Binomial Showdown (poj 2249)

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;
}

poj 3100 (zoj 2818)||ZOJ 2829 ||ZOJ 1938 (poj 2249)的更多相关文章

  1. POJ 2235 Frogger / UVA 534 Frogger /ZOJ 1942 Frogger(图论,最短路径)

    POJ 2235 Frogger / UVA 534 Frogger /ZOJ 1942 Frogger(图论,最短路径) Description Freddy Frog is sitting on ...

  2. POJ 3100 Root of the Problem || 1004 Financial Management 洪水!!!

    水两发去建模,晚饭吃跟没吃似的,吃完没感觉啊. ---------------------------分割线"水过....."--------------------------- ...

  3. POJ 3100 &amp; ZOJ 2818 &amp; HDU 2740 Root of the Problem(数学)

    题目链接: POJ:id=3100" style="font-size:18px">http://poj.org/problem? id=3100 ZOJ:http ...

  4. zoj 2818 Root of the Problem(数学思维题)

    题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2818 题目描述: Given positive integer ...

  5. POJ 3090 Visible Lattice Points (ZOJ 2777)

    http://poj.org/problem?id=3090 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1777 题目大意: ...

  6. POJ 1775 Sum of Factorials (ZOJ 2358)

    http://poj.org/problem?id=1775 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1334 题目大意: ...

  7. zoj 2818 Root of the Problem

    Root of the Problem Time Limit: 2 Seconds      Memory Limit: 65536 KB Given positive integers B and ...

  8. ZOJ 2679 Old Bill ||ZOJ 2952 Find All M^N Please 两题水题

    2679:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1679 2952:http://acm.zju.edu.cn/onli ...

  9. ZOJ 3911 Prime Query ZOJ Monthly, October 2015 - I

    Prime Query Time Limit: 1 Second      Memory Limit: 196608 KB You are given a simple task. Given a s ...

随机推荐

  1. eclipse中编码的设置

    Windows-------->prefenerce------>General-------->Workspace

  2. 61.C++文件操作实现硬盘检索

    #include <iostream> #include <fstream> #include <memory> #include <cstdlib> ...

  3. 洛谷P2115 [USACO14MAR]破坏Sabotage

    题目描述 Farmer John's arch-nemesis, Farmer Paul, has decided to sabotage Farmer John's milking equipmen ...

  4. Android 关于::app:clean :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE,引用jar冲突问题

    错误提示: Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTest ...

  5. CF 843 A. Sorting by Subsequences

    A. Sorting by Subsequences You are given a sequence a1, a2, ..., an consisting of different integers ...

  6. idea配置spark运行模式

    1. 配置运行参数: Menu -> Run -> Edit Configurations -> 选择 + -> Application   -Dspark.master=lo ...

  7. Selenium爬取淘宝商品概要入mongodb

    准备: 1.安装Selenium:终端输入 pip install selenium 2.安装下载Chromedriver:解压后放在…\Google\Chrome\Application\:如果是M ...

  8. css笔记(二)——几种经常使用的模式

    文本垂直居中 对于行内元素,height会自己主动收缩到包裹住文本的高度,所以不存在这个问题. 可是对于block和inline-block等盒子元素.假设设置了height属性,则文本默认会在上方显 ...

  9. android图片特效处理之怀旧效果

    图片特效处理系列将介绍图片的像素点的特效处理,这些物资注重的是原理.也就是说只要你知道这些算法不管是C++,VB,C#,Java都可以做出相同的特效.下面将介绍图片怀旧效果的算法.算法如下: 上面公式 ...

  10. IAR FOR STM8 学习笔记 IAR工程的建立

    STM8是ST意法半导体针对工业应用和消费电子开发而推出的8位单片机. 每种MCU都有自身的优点与缺点,与其它8-bit MCU相比,STM8 8-bit MCU最大的特点是: · 内核: o 最高f ...