Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
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: