Ignatius is poor at math,he falls across a puzzle problem,so he has no choice but to appeal to Eddy. this problem describes that:f(x)=5*x^13+13*x^5+k*a*x,input a nonegative integer k(k<10000),to find the minimal nonegative integer a,make the arbitrary integer x ,65|f(x)if
no exists that a,then print "no".

The input contains several test cases. Each test case consists of a nonegative integer k, More details in the Sample Input.
The output contains a string "no",if you can't find a,or you should output a line contains the a.More details in the Sample Output.
题目大意为:对于函数f(x)=5*x^13+13*x^5+k*a*x,输入任意一个数k,是否存在一个数a,对任意x都能使得f(x)能被65整除,如果存在这样一个数a,则输出,如果不存在,输出no。
解题思路:假如存在a满足条件,因为是任意x,就假设x=1,则f(x)为18+ak,则(18+ak)%65==0,就存在数a,a的取值范围就是1到65,由于是求最小的a,所以只要找到一个a,就输出,然后break。
注:其实在读懂题以后,这就是一个数学问题,开始我不知道怎么确定a的范围,在请教数学好的同学以后,由于除数是65,所以a的范围为1到65,如果是66的话就相当于轮了一个周期。在这些英文题中,会经常有这些关键词(黑体斜体),可以把它标记出来。
 
#include<stdio.h>
int main()
{

int
n,a,k;
while
(scanf("%d",&k)!=EOF)
{

for
(a=;a<=;a++)
{

if
((+a*k)%==)
{

printf("%d\n",a);
break
;
}
}

if
(a>=)
printf("no\n");
}

  return
;
}
 

hdu1098的更多相关文章

  1. Hdu-1098解题报告

    Hdu-1098解题报告 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1098 题意:已知存在一个等式f(x)=5*x^13+13*x^5+k*a*x ...

  2. 数学: HDU1098 Ignatius's puzzle

    Ignatius's puzzle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others ...

  3. OJ题目分类

    POJ题目分类 | POJ题目分类 | HDU题目分类 | ZOJ题目分类 | SOJ题目分类 | HOJ题目分类 | FOJ题目分类 | 模拟题: POJ1006 POJ1008 POJ1013 P ...

随机推荐

  1. springboot整合JPA(简单整理,待续---)

    整合步骤 引入依赖: <dependencies> <dependency> <groupId>org.springframework.boot</group ...

  2. Serializable中的serialVersionUID

    有序列化,就必然有反序列化!比如在A端为UserLogin(见上一篇对象序列化)做了序列化,然后在B端进行反序列化. 首先需要,A端和B端都定义有相同的UserLogin类.可是,万一两端的UserL ...

  3. opencv学习之路(37)、运动物体检测(二)

    一.运动物体轮廓椭圆拟合及中心 #include "opencv2/opencv.hpp" #include<iostream> using namespace std ...

  4. topcoder srm 610 div1

    problem1 link 计算每个格子向上的最大高度.然后每个格子同一行前面的格子以及当前格子作为选取的矩形的最后一行,计算面积并更新答案. problem2 link 对于两个数据$(x_{1}, ...

  5. POJ 3311 Hie with the Pie 【状压DP】

    Description The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possi ...

  6. mui中confirm在苹果出现bug,confirm点击确定跳转页面再返回后,页面被遮罩盖住无法使用

    项目中使用confirm mui.confirm('您还未抽奖,现在去抽奖吗?', function (res) { if (res.index === 1) { window.location.hr ...

  7. Xilinx FPGA DPR技术

    动态部分重配置技术 DPR(Dynamic Partial Reconfiguration)可以使得PL的一个部分或几个部分在运行时刻被完全地重新配置.这些部分需要被指定为可重配置分区(Reconfi ...

  8. Thinkphp5背景图片的引入~ 以及图片的引入

    将图片信息从数据库查询 再渲染于前台页面

  9. ArcGIS JS API4 With VueJS集成开发

    1.USING VUEJS WITH ARCGIS API FOR JAVASCRIPT,集成VUE到ArcGIS JS开发中. 2.ARCGIS API 4 FOR JS WITH VUE-CLI ...

  10. Linux之磁盘信息查看

    一.磁盘情况查询 1.查看磁盘整体情况 命令:df 参数: -a:列出所有的文件系统,包括系统特有的/proc等文件系统 -k:以KB的容量显示各文件系统 -m:以MB的容量显示各文件系统 -h:以人 ...