Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:我真就不明白了,拿我的程序测试的数据和别人AC的代码测试的数据吻合,为什么WA啊!!WA的吐血了,做了好几个题目都是这样,没信心了!

Posted by lovexinbao at 2011-05-11 12:13:15 on Problem 1091
In Reply To:我真就不明白了,拿我的程序测试的数据和别人AC的代码测试的数据吻合,为什么WA啊!!WA的吐血了,做了好几个题目都是这样,没信心了! Posted by:lovexinbao at 2011-05-11 09:36:10
> 我测试
> 5 5 
> out 3124
> 10 10
> out 9990233352
> 别人AC的代码也是这样!
> 为什么我的过不了啊!
> 我的CODE:
> #include <iostream>
> #include <vector>
> #include<math.h>
> using namespace std;
> bool judgeprime(int m)
> {
>   int x=0;
>   bool isprime=true;
>   for(int i=2;i<=sqrt(m*1.0);i++)
>   {
>     if(m%i==0)
>     {
>       isprime=false;
>       break;
>     }
>   }
>   return isprime;
> }
> int main()
> {    
>   int n,m;
>   __int64 result_number;
>   cin>>n>>m;
>   if(judgeprime(m)==true)
>   {
>     result_number=(pow(m*1.0,n*1.0)-1);
>   }
>   else
>   {
>     vector<int> prime;
>     for(int i=2;i<=m/2;i++)
>     {
>       
>       if(m%i==0&&judgeprime(i)==true)
>       {
>         prime.push_back(m/i);
>       }      
>     }
>    result_number=pow(m*1.0,n*1.0);
>   for(int i=0;i< prime.size();i++)  
>   {
>     result_number-=pow(prime[i]*1.0,n*1.0);
>   }
>   result_number+=(prime.size()-1);
>   }  
>   cout<<result_number<<endl;
>   system("pause")  ;
>   return 0;
> }
> 应该没错!__int 64 不是说能过吗?我要吐血了! 我做了几道题目都是这样!测试的数据(随即的)都和别人AC代码相同,就是过不了!.WA的肠子都出来了!
来个人解答一下!
或者谁AC了的给点数据啊!我测试一下

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator