博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
数学: HDU1098 Ignatius's puzzle
阅读量:5806 次
发布时间:2019-06-18

本文共 1624 字,大约阅读时间需要 5 分钟。

Ignatius's puzzle

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 9934    Accepted Submission(s): 6959
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
 
Problem :     Judge Status : Accepted
RunId : 21248504    Language : G++    Author :
Code Render Status : Rendered By HDOJ G++ Code Render Version 0.01 Beta
#include<iostream> #include<cstring> #include<cstdio> using namespace std; int main(){ int k,i; while(scanf("%d",&k)==1){ for(i=1;i<=65;i++) if((18 + i*k)%65==0) break; if(i<=65) printf("%d\n",i); else printf("no\n"); } }
#include
#include
#include
using namespace std;int main(){
int k,i; while(scanf("%d",&k)==1){
for(i=1;i<=65;i++) if((18 + i*k)%65==0) break; if(i<=65) printf("%d\n",i); else printf("no\n"); }}

转载于:https://www.cnblogs.com/Pretty9/p/7347710.html

你可能感兴趣的文章
[LeetCode] Implement strStr() 实现strStr()函数
查看>>
Requested Clipboard operation did not succeed的解决办法
查看>>
javadoc做注释
查看>>
grep命令
查看>>
7.3. Gnu Gatekeeper Test
查看>>
[翻译]Java 核心技术(第7版)(1)
查看>>
lodoop打印控件详解
查看>>
Android的五大布局
查看>>
使用SymbolResolver在Activity内访问宿主环境信息
查看>>
Linux下开启vim高亮
查看>>
重构项目使用Spring+Hibernate+HibernateAnnotation+GenericDao技术
查看>>
Jasmine测试ng Promises - Provide and Spy
查看>>
阿里云OSS图片上传类
查看>>
LUN 是到底是什么?[ZZ]
查看>>
无法加载 DLL“oramts.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)
查看>>
SQL压力测试用的语句和相关计数器
查看>>
TFS(Team Foundation Server)介绍和入门
查看>>
Centos6.8 搭建Lvs+Keepalived
查看>>
超级简单:DIV布局
查看>>
[LeetCode] Candy
查看>>