HDU1098
来源:互联网 发布:黑刀秋水淘宝网 编辑:程序博客网 时间:2024/05/29 17:24
题目描述:
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".
大致思路:
简单的数论问题,把表达式化简之后就比较好做了。
代码:
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".
大致思路:
简单的数论问题,把表达式化简之后就比较好做了。
代码:
#include<cstdio>using namespace std;int main(){ int n,i,t; while(scanf("%d",&n)!=EOF) { t=0; for(i=1;i<=65;i++) { if((18+n*i)%65==0) { printf("%d\n",i); t++; break; } } if(t==0) printf("no\n"); }}
0 0
- HDU1098
- hdu1098
- HDU1098
- hdu1098
- hdu1098
- HDU1098
- hdu1098 -数论
- hdu1098(基础)
- hdu1098 Ignatius's puzzle
- hdu1098:Ignatius's puzzle
- hdu1098-Ignatius's puzzle
- HDU1098 Ignatius's puzzle
- hdu1098 Ignatius's puzzle
- hdu1098 ~费马小定理
- hdu1098(数学归纳法)
- HDU1098 Ignatius's puzzle
- HDU1098数学归纳
- HDU1098 规律题
- 一句话摘录(软件工程)
- Subsequence
- a^b
- edge
- elevator
- HDU1098
- Fence Repair
- Expedition
- linux命令行参数处理
- YII CLinkPager分页
- Yii学习——-核心应用组件
- linuxcast学习笔记啊
- 数学很好学!
- A段架构师技术的十个学习步骤&演练