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 ttbobo at 2009-08-05 20:27:14 on Problem 1083
#include <stdio.h>
#include <stdlib.h>
#include <string.h> 
int a[301],n,m,x,y,temp;
int main()
{
    int i,j,k,max;
    scanf("%d",&n);
    for (i=1;i<=n;i++)
    {
        memset(a,0,sizeof(a)); 
        scanf("%d",&m);
        max=0; 
        for (j=1;j<=m;j++)
        {
            scanf("%d%d", &x, &y);
            x = (x+1) / 2;
            y = (y+1) / 2;
            if (x>y) {y=temp;y=x;x=temp;}
            for (k=x;k<=y;k++)
            {
                a[k]++;
                if (a[k]>max) max=a[k]; 
            } 
        }
        printf("%d\n", max*10);
        system("pause"); 
    } 
} 

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