| ||||||||||
| 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 | |||||||||
粘一发代码,求不打我[cpp]
#include<bits/stdc++.h>
using namespace std;
int n,h,l,r,sum[10005];
set<pair<int,int> > Set;
signed main(void){
cin>>n>>l>>h>>r;
for(int i=1,x,y;i<=r;i++)cin>>x>>y,Set.insert((pair<int,int>){min(x,y),max(x,y)});
for(set<pair<int,int> >::iterator it=Set.begin();it!=Set.end();++it)sum[it->first+1]+=1,sum[it->second]-=1;
for(int i=2;i<=n;i++)sum[i]+=sum[i-1];
for(int i=1;i<=n;i++)cout<<(h-i==l?0:sum[i])<<endl;
}
[/cpp]
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator