HDOJ 1098 Ignatius's puzzle
来源:互联网 发布:淘宝培训心得 编辑:程序博客网 时间:2024/06/05 17:21
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".
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
111009999
Sample Output
22no43已AC:#include <iostream>int main(){ using namespace std; int k; while(cin >> k) { k = k%65; int a = 0; for(int i=1; i<65; ++i) { if((i*k)%65==47) { a = i; break; } } if(a) cout << a << endl; else cout << "no" << endl; } return 0;}
- HDOJ 1098 Ignatius's puzzle
- HDOJ 1098 Ignatius's puzzle
- hdoj 1098 Ignatius's puzzle
- HDOJ 1098 Ignatius's puzzle
- hdoj-1098-Ignatius's puzzle
- HDOJ 1098 Ignatius's puzzle [数学归纳]
- HDOJ 1098 Ignatius's puzzle [数学归纳]
- hdoj 1098 Ignatius's puzzle(暴力)
- HDOJ 1098 Ignatius's puzzle(数学)
- hdu 1098 Ignatius's puzzle
- hdu 1098 Ignatius's puzzle
- HDU 1098 Ignatius's puzzle
- HDU 1098 Ignatius's puzzle
- Hdu 1098 - Ignatius's puzzle
- hdu 1098 Ignatius's puzzle
- hdu 1098 Ignatius's puzzle
- HDU 1098 Ignatius's puzzle
- hdu-1098 Ignatius's puzzle
- [职场]程序员该高调还是低调
- 【介绍关闭Windows 8系统的多种方法】
- 设计模式与原则:观察者模式
- HashMap源码学习
- 【快速找回删除的文件的方法汇总】
- HDOJ 1098 Ignatius's puzzle
- linux内核模块hello.c的思路
- [转]Ubuntu下创建、重命名、删除文件及文件夹,强制清空回收站方法
- 省赛小结-7th Jilin Province Collegiate Programming Contest
- Chomsky文法类型判断
- 【转】C++初级到高级的学习书籍流程
- opencv中cvCreateTrackbar()函数的说明
- vb随机显示10个数,并显示最大的数
- 黑马程序员_Java基础Day09(下)_异常(未完)