| ||||||||||
| 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 | |||||||||
为什么WA.....#include <stdio.h>
#include <memory.h>
int corridor[201];
int src[201];
int dst[201];
int main(int argc, char *argv[])
{
int t;
scanf("%d",&t);
while(t--)
{
memset(corridor,0,sizeof(corridor));
memset(src,0,sizeof(src));
memset(dst,0,sizeof(dst));
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d%d",src+i,dst+i);
for(int i=0;i<n;i++)
for(int j=(src[i]-1)/2;j<=(dst[i]-1)/2;j++)
corridor[j]+=10;
int max=0;
for(int i=0;i<200;i++)
if(corridor[i]>max)
max=corridor[i];
if(max!=0)
printf("%d\n",max);
else
printf("10\n");
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator