Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
已AC,贴代码,求优化#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator