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 |
思路很简单但为什么错啦!!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator