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

2952:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1951

ZOJ:2679先来~

水题大意:(题目大意:我什么时候改名了哇T T)

给你一个5位数的中间三个字母,还有一个数N让你求能被N整除的最大的五位数。

思路:

直接暴力枚举。。。。

#include<cstdio>
int num[6];
int main()
{
int T,n;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
scanf("%d%d%d",&num[2],&num[3],&num[4]);
bool ok=false;
for(int x=9;x>=1;x--)
{
num[1]=x;
for(int k=9;k>=0;k--)
{
num[5]=k;
int t=1,ans=0;
for(int i=5;i>=1;i--,t*=10)
ans=ans+ num[i]*t;
if(ans % n ==0)
{
ok=true;
printf("%d %d %d\n",x,k,ans/n);
goto end;
}
}
}
end:;
if(!ok)
printf("0\n"); }
return 0;
}

ZOJ : 2952

水题大意:

找出所有小于2^31能被表示为n ^m的数。

思路:

传说中的打表。

用long long 防乘法的时候直接越界了。

#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long LL;
const LL N=2147483648;
const int MAXN=50000;
int len=0;
LL ans[MAXN];
int main()
{ for(LL i=2;i*i<=N;i++)
{
LL temp=i;
while(true)
{
temp=temp*i;
if(temp>=N)
break;
ans[len++]=temp;
}
}
sort(ans,ans+len);
printf("%d\n",ans[0]);
for(int i=1;i<len;i++)
if(ans[i]!=ans[i-1])
printf("%lld\n",ans[i]);
return 0;
}

ZOJ 2679 Old Bill ||ZOJ 2952 Find All M^N Please 两题水题的更多相关文章

  1. ZOJ 2679 Old Bill(数学)

    主题链接:problemCode=2679" target="_blank">http://acm.zju.edu.cn/onlinejudge/showProbl ...

  2. zoj 2679 Old Bill

    Old Bill Time Limit: 2 Seconds      Memory Limit: 65536 KB Among grandfather��s papers a bill was fo ...

  3. ZOJ 2819 Average Score 牡丹江现场赛A题 水题/签到题

    ZOJ 2819 Average Score Time Limit: 2 Sec  Memory Limit: 60 MB 题目连接 http://acm.zju.edu.cn/onlinejudge ...

  4. 水题 ZOJ 3875 Lunch Time

    题目传送门 /* 水题:找排序找中间的价格,若有两个,选价格大的: 写的是有点搓:) */ #include <cstdio> #include <iostream> #inc ...

  5. 水题 ZOJ 3876 May Day Holiday

    题目传送门 /* 水题:已知1928年1月1日是星期日,若是闰年加1,总天数对7取余判断就好了: */ #include <cstdio> #include <iostream> ...

  6. 水题 ZOJ 3880 Demacia of the Ancients

    题目传送门 /* 水题:) */ #include <cstdio> #include <iostream> #include <algorithm> #inclu ...

  7. [ACM_水题] ZOJ 3706 [Break Standard Weight 砝码拆分,可称质量种类,暴力]

    The balance was the first mass measuring instrument invented. In its traditional form, it consists o ...

  8. [ACM_水题] ZOJ 3714 [Java Beans 环中连续m个数最大值]

    There are N little kids sitting in a circle, each of them are carrying some java beans in their hand ...

  9. [ACM_水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]

    MightyHorse is playing a music game called osu!. After playing for several months, MightyHorse disco ...

随机推荐

  1. 认识 Atlassian Datacenter 产品

    认识 Atlassian Datacenter 产品 云端原本就是群集化的架构,Atlassian 系列产品.应用的开发团队相当广范且行之有年,可是将应用程序作为节点(比方Jira,confluenc ...

  2. javascript变量类型及作用域

    javascript变量类型及作用域 一.简介 变量类型 ECMAScript变量可能包含两种不同类型的数据值:基本类型和引用类型. 基本类型 基本类型指的是简单的数据段,5种基本数据类型:undef ...

  3. fsck---于检查并且试图修复文件系统中的错误

    fsck命令被用于检查并且试图修复文件系统中的错误.当文件系统发生错误四化,可用fsck指令尝试加以修复. -a:自动修复文件系统,不询问任何问题: -A:依照/etc/fstab配置文件的内容,检查 ...

  4. golang 数组

    数组是Go语言编程中最常用的数据结构之一.顾名思义,数组就是指一系列同一类型数据的集合.数组中包含的每个数据被称为数组元素(element),一个数组包含的元素个数被称为数组的长度. 在Go语言中数组 ...

  5. 在Google Drive上建立免费静态站点

    现今建立一个属于自己的站点已经是一件非常普遍和简单的事情了. 你能够选择买空间,买域名.你也能够使用免费空间.免费域名.你能够选择动态的php wordpress,joomla或者是静态的站点(如使用 ...

  6. 将bat批处理命令文件固定到任务栏

    将bat批处理命令文件固定到任务栏第一种方法:使用链接工具http://www.xstui.com/read/3451.在任务栏点击右键,移动到工具栏,勾选链接工具2.你会在通知栏左侧看到链接字样,将 ...

  7. Hp Open View安装使用视频

    去年完成的cisco works 2000操作(http://chenguang.blog.51cto.com/blog/350944/124729)视频深受广大博友欢迎许多人来信咨询,最近刚做完一个 ...

  8. HTTP浅谈

    HTTP浅谈 1···什么是HTTP? HTTP协议就是超文本传输协议(HyperText Transfer Protocol),通俗理解是浏览器和web服务器传输数据格式的协议,HTTP协议是一个应 ...

  9. C#中选中指定文件并读取类似ini文件的内容

    一.背景 由于项目中需要去读取设备的配置信息,配置文件的内容和INI配置文件的格式类似,所以可以按照INI文件的方式来处理.涉及如何打开一个文件,获取打开的文件的路径问题,并读取选中的文件里边的内容. ...

  10. 【Codeforces Round #428 (Div. 2) C】Journey

    [Link]:http://codeforces.com/contest/839/problem/C [Description] 给一棵树,每当你到一个点x的时候,你进入x的另外一每一个出度的概率都是 ...