有关数论方面的题要仔细阅读,分析公式。

Problem Description
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".

 
Input
The input contains several test cases. Each test case consists of a nonegative integer k, More details in the Sample Input.
 
Output
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.
 
Sample Input
11
100
9999
 
 
 
Sample Output
22 no 43
 
Author
eddy
 
 
 

题目大意:方程f(x)=5*x^13+13*x^5+k*a*x;输入任意一个数k,是否存在一个数a,对任意x都能使得f(x)能被65整出;输入a;

解题报告:假设存在这个数a ,因为对于任意x方程都成立,所以,当x=1时f(x)=18+ka;有因为f(x)能被65整出,这可得出f(x)=n*65;

即:18+ka=n*65;若该方程有整数解则说明假设成立。

所以,只要找到a,使得18+k*a能被65整除,也就解决了这个题目.

 #include<iostream>
using namespace std;
int main()
{
int k,i;
while(scanf("%d",&k)!=EOF)
{
for(i=;i<=;i++)
{
if((+k*i)%==){printf("%d\n",i);break;}
}
if(i>)printf("no\n");
}
return ;
}
 

hdu 1098 Ignatius's puzz的更多相关文章

  1. HDU 1098 Ignatius's puzzle

    http://acm.hdu.edu.cn/showproblem.php?pid=1098 题意 :输入一个K,让你找一个a,使得f(x)=5*x^13+13*x^5+k*a*x这个f(x)%65等 ...

  2. HDU 1098 Ignatius's puzzle(数学归纳)

    以下引用自http://acm.hdu.edu.cn/discuss/problem/post/reply.php?postid=8466&messageid=2&deep=1 题意以 ...

  3. HDU - 1098 - Ignatius's puzzle - ax+by=c

    http://acm.hdu.edu.cn/showproblem.php?pid=1098 其实一开始猜测只要验证x=1的时候就行了,但是不知道怎么证明. 题解表示用数学归纳法,假设f(x)成立,证 ...

  4. 题解报告:hdu 1098 Ignatius's puzzle

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1098 题目中文是这样的: 伊格内修斯在数学上很差,他遇到了一个难题,所以他别无选择,只能上诉埃迪. 这 ...

  5. 数学--数论--HDU 1098 Ignatius's puzzle (费马小定理+打表)

    Ignatius's puzzle Problem Description Ignatius is poor at math,he falls across a puzzle problem,so h ...

  6. HDU 1098 Ignatius's puzzle 费马小定理+扩展欧几里德算法

    题目大意: 给定k,找到一个满足的a使任意的x都满足 f(x)=5*x^13+13*x^5+k*a*x 被65整除 推证: f(x) = (5*x^12 + 13 * x^4 + ak) * x 因为 ...

  7. ACM: HDU 1028 Ignatius and the Princess III-DP

     HDU 1028 Ignatius and the Princess III Time Limit:1000MS     Memory Limit:32768KB     64bit IO Form ...

  8. hdu 1028 Ignatius and the Princess III 简单dp

    题目链接:hdu 1028 Ignatius and the Princess III 题意:对于给定的n,问有多少种组成方式 思路:dp[i][j],i表示要求的数,j表示组成i的最大值,最后答案是 ...

  9. HDU 1029 Ignatius and the Princess IV --- 水题

    HDU 1029 题目大意:给定数字n(n <= 999999 且n为奇数 )以及n个数,找出至少出现(n+1)/2次的数 解题思路:n个数遍历过去,可以用一个map(也可以用数组)记录每个数出 ...

随机推荐

  1. zoj3829 Known Notation --- 2014 ACM-ICPC Asia Mudanjiang Regional Contest

    根据规则,可以发现,一*之前必须有至少2数字.一(11*)这反过来可以被视为一数字. 因此,总位数必须大于*号码,或者你会加入数字. 添加数字后,,为了确保该解决方案将能够获得通过交流.那么肯定是*放 ...

  2. 国内外MD5在线解密网站

    -http://www.cmd5.com/english.aspx (457,354,352,282) - http://www.md5crack.com - http://www.hashcheck ...

  3. JS call与apply

    JS的call与apply call和apply是JS中比较重要的两个方法, 一般在框架和组件设计中用的较多,比如jQuery Code. 那么这两个方法是做什么的呢,下面我们通过代码来了解: 1 f ...

  4. Chapter 1 Securing Your Server and Network(1):选择SQL Server运行账号

    原文:Chapter 1 Securing Your Server and Network(1):选择SQL Server运行账号 原文出处:http://blog.csdn.net/dba_huan ...

  5. [Apache Spark源代码阅读]天堂之门——SparkContext解析

    略微了解Spark源代码的人应该都知道SparkContext,作为整个Project的程序入口,其重要性不言而喻,很多大牛也在源代码分析的文章中对其做了非常多相关的深入分析和解读.这里,结合自己前段 ...

  6. ExtJS4 表格的嵌套 rowExpander

    今天做一个grid,里面的数据须要带明细,思来想去还是搞个表格嵌套吧!看下图 对于grid中每一条记录点击左边的+号能展开一个明细的子表格 全部数据包含列名均从后台获得,子表格的数据临时在本地以做測试 ...

  7. YUV摘要格式

    始终保持视频数据YUV联系,因为基于其产品的组织不同的公司格不同的类型定义,派生出多种不同YUV格公式. 大体,YUV从在点的形式的像素组织中,有两个:1.planer状态.2.packet状态. p ...

  8. 集成ejs和angular

    我们也有一个系统angular用在应用中单页.正确angular做一些定制.集成seajs.不实用angular自己的模块管理. 只要angular也可单独使用在,一个较小的系统新开发,我不会用前js ...

  9. 第十六章——处理锁、阻塞和死锁(3)——使用SQLServer Profiler侦测死锁

    原文:第十六章--处理锁.阻塞和死锁(3)--使用SQLServer Profiler侦测死锁 前言: 作为DBA,可能经常会遇到有同事或者客户反映经常发生死锁,影响了系统的使用.此时,你需要尽快侦测 ...

  10. React-Native入门指南之HelloWorld

    iOS React-Native入门指南之HelloWorld React-native 作为facebook开源项目,最近是火的一塌糊涂,它采用node.js能够写ios和android的nativ ...