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动态添加行列

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Add-Delete Row.a ...

  2. 火狐开发----从头用到尾的cfx

    此教程阐述了如何使用 SDK 开发一个简单的扩展. 准备 要想使用 SDK 开发 Firefox 的扩展,您首先需要 安装并激活 SDK.一旦您完成了以上步骤,您将会看到一个命令行窗口. 初始化一个空 ...

  3. composer安装。

    我们这里实在Windows下进行的安装.1.下载Composer安装包.网址:https://getcomposer.org/download/下载Composer-Setup.exe 安装文件.2. ...

  4. 其他shell

    dash shell Debian的dash shell的历史很有趣.它是ash shell的直系后代,而ash shell则是Unix系统上原来 的Bourne shell的简化版本(参见第1章). ...

  5. UIPresentationController - iOS自定义模态弹出框

    参考: https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/Definin ...

  6. 树形插件zTree与组织插件jOrgChart交互

    <html> <head> <title>组织架构</title> <meta http-equiv="content-type&quo ...

  7. Unable to start Ocelot because either a ReRoute or GlobalConfiguration

    在ASP.Net Core项目APIGateway中添加Ocelot+Consul然后运行时 ,VS2017报如下错 : 内部异常 1: Exception: Unable to start Ocel ...

  8. leetcode02大数相加

    惭愧惭愧,这道题居然卡了两天,犯了一堆错误,现在一一总结 错误 头一天我看给的测试用例误以为输入是数组,做了半天也无法输出链表的正确格式,后来把输入当成链表,才正确了 我没看到编辑器给了一套链表,自己 ...

  9. 将python中的一个float变量转成内存的4个字节值

    #coding=utf- from struct import pack,unpack byte=pack('f',1.5) print(byte) print([i for i in byte]) ...

  10. VirtualBox中CentOS7.2 网络配置(固定IP+联网)

    一.前言 用虚拟机装Linux系统时,经常会出现一些问题.比如:从主机到虚拟机之间网络不通:虚拟机中无法联网:虚拟机中的IP地址不固定.为了解决这些问题,我曾花了不少时间.在此,记下填坑方法. 二.环 ...