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 |
请谁帮我看一下,为什么过不了呢,我在自己的vc里面可以过啊#include<iostream> using namespace std; void main() { int count[1001]={0},select[1001] = {0}, m,n,max1[1001] ,max2[1001],p,num = 0,a,b,result = 0; cin>>p; while( num < p ) { cin>>m>>n; max1[num] = m; max2[num] = n; for(int i = m; i <= n; i++) count[i]++; num++; } for( num = 0; num < p; num++) { a = b = max1[num]; for( int i = max1[num]+1; i <= max2[num]; i++) if( count[i] >= count[a]) { b = a; a = i; } if( !select[a] ) { result++; select[a] = 1; } if( !select[b] ) { result++; select[b] = 1; } } cout<<result; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator