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

2894总是WA 谁能给组错的测试数据或者给改一下啊

Posted by muyue at 2008-08-02 11:27:34
#include<stdio.h>
#include<string.h>
int main(){
    int i,j,m,n,k,x,y;
    char a[1000],c,f;
    int b[1000],d[1000],e[1000];
    scanf("%d",&k);
    n=0;
     while(k--){
        memset(b,0,sizeof(b));
        scanf("%d",&m);
        if(m==0)
            continue;
        getchar();
        for(i=0;i<m;i++){
            scanf("%c %d %d",&a[i],&d[i],&e[i]);
            getchar();
            if(n<e[i])
                n=e[i];                    
        } 
        for(i=0;i<m;i++){
            x=d[i];y=e[i];
            for(j=x;j<y;j++)
                b[j]++;                         
        }  
        for(i=1;i<n;i++){
            for(j=1;j<=26;j++){
                if(b[i]==j){
                    c=b[i]+'A'-1;
                    printf("%c",c);
                    break;            
                }                   
            }
                                 
        }   
        printf("\n");     
    }
    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