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

已AC,贴代码,求优化

Posted by speedcell4 at 2011-02-08 17:00:22 on Problem 2894
#include<stdio.h>
int t,n,a,b;
char c;
char kan(int n)
{
    return 'A'-1+n;
}
int main()
{
    scanf("%d",&t);
    while(t--)
    {
        int time[1001]={0};
        scanf("%d",&n);
        while(n--)
        {
            scanf("%c",&c);
            getchar();
            scanf("%d%d",&a,&b);
            for(int i=a;b-i;i++) time[i]++;
            
        }
        for(int i=0;1001-i;i++) if(time[i]>0) printf("%c",kan(time[i]));
        printf("\n");
    }
}

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