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等于0。

思路: 这个题我也不是很会,看了网上的思路才做的。

http://www.cnblogs.com/g0feng/archive/2012/08/23/2652996.html

 

//HDU 1098
#include <iostream>
#include <stdio.h>
using namespace std ;
int main()
{
    int k ;
    while(scanf("%d",&k)!=EOF)
    {
        if(k % 65 == 0)
        {cout<<"no"<<endl ;continue ;}
        int i ;
        for(i = 1 ; i <= 65 ; ++i)
        {
            if((18 + k*i )%65 == 0)
            {
                printf("%d\n",i) ;
                break ;
            }
        }
        if(i > 65)
        cout<<"no"<<endl ;
    }
    return 0 ;
}
View Code

 

posted on 2013-12-11 21:16  枫、  阅读(186)  评论(0编辑  收藏  举报