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

C代码,超简单,为什么还wa。。。

Posted by 879837607 at 2015-10-30 11:13:21 on Problem 1083
#include <stdio.h>
#include<string.h>
int main()
{
    int T,i,j,q,maxl,N;
    int arr[400][2];
    int arr2[400][2];
    while(scanf("%d",&N)!=EOF)
    {
        while(N--)
        {
            scanf("%d",&T);
        memset(arr2,0,sizeof(arr2));
        for(i=0;i<T;i++)
            for(j=0;j<2;j++)
            scanf("%d",&arr[i][j]);
        for(i=0;i<T;i++)
            for(j=0;j<2;j++)
                for(q=0;q<T;q++)
                    if(arr[i][j]>arr[q][0]&&arr[i][j]<arr[q][1])
                        arr2[i][j]++;

         for(maxl=0,i=0;i<T;i++)
            for(j=0;j<2;j++)
                if(maxl<arr2[i][j])maxl=arr2[i][j];
        printf("%d\n",(maxl+1)*10);
        }

    }
	return 0;
}

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