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

这个不是费马大定理吧

Posted by orbby at 2011-09-24 21:37:47 on Problem 2419 and last updated at 2011-09-24 21:38:08
In Reply To:用 费马大定理 失败,这里的数据有重,一个人可以两次听到一棵树 Posted by:yuanyirui at 2007-03-30 16:32:06
> #include <stdio.h>
> #include <iostream>
> using namespace std;
> int main()
> {
>    // freopen("in.txt","r",stdin);
>    // freopen("out.txt","w",stdout);
>     int p,n;
>     int s[100],i,a,b,tmp,ans;
>     scanf("%d%d",&p,&n);
>     for(i=1;i<=p;i++) s[i]=0;
>     while(scanf("%d%d",&a,&b)!=EOF){
>         s[a] += b*b*b;  //如果数据不出现重复,把多维映射到一维就没有问题 
>     }
>     sort(s+1,s+p);
>     ans=0;
>     for(i=1,tmp=-1;i<=p;i++){
>         if(s[i]>tmp){
>             tmp=s[i];
>             ans++;
>         }
>     }
>     printf("%d\n",ans);
>     return 1;
> }

即使没有重复这个也是错的吧,还有,这个不是费马大定理吧

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