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. js 实现json数组集合去重,差集,并集,交集。

    let list = [ { id: "1", content: "A" }, { id: "2", content: "B&qu ...

  2. 14: InfluxDB+Grafana打造大数据监控利器

    参考博客: https://www.cnblogs.com/davidwang456/p/7795263.html

  3. [ERROR] --gtid-mode=ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updates

    centos7.5 做基于GTID的主从重启从库报错 问题: [root@db01-51 ~]# tail -50 /application/mysql/data/db01-51.err 2019-0 ...

  4. JS(JavaScript)的进一步了解6(更新中···)

    元素的属性 div.attributes 是所有标签属性构成的数据集合 div.classList 是所有class名构成的数组集合 在classList的原型链上看以看到add()和remove() ...

  5. HTML与CSS的一些知识(一)

    一般写代码的时候,总会有些小错误.为了便于修改以及查找,所以代码格式要写规范,而且一定一定要写注释.因为有时候代码写得多了,真的连自己都找不到自己要找的东西在哪里.还有命名也要见名知意. 再说一些HT ...

  6. 彻底清除 Windows 服务

    如果服务已经停止, 或从注册表中删除, 但是在任务管理器中仍能看到服务躺在列表里面. 只需要找到服务的PID, 然后运行命令: taskkill /PID 服务的PID /f 即可.

  7. 论文笔记:Learning Attribute-Specific Representations for Visual Tracking

    Learning Attribute-Specific Representations for Visual Tracking AAAI-2019 Paper:http://faculty.ucmer ...

  8. 第一次跑eureka

  9. 《内蒙古自治区第十三届大学生程序设计竞赛试题_H 公孙玉龙》

    这个题有点小坑,最坑的地方就是  输入的b 变量  有可能 是  负数  !   负数 !  负数!    对 ,你没有看错,就是负数,坑死我了, 一直都是  content.charAt(0) 判断 ...

  10. zookeeper调试命令

    转载自 https://www.cnblogs.com/andy6/p/7674028.html 一.zkServer.sh 1.查看 zkServer.sh 帮助信息[root@bigdata05 ...