Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

粘一发代码,求不打我

Posted by yousiki at 2016-07-11 23:59:03 on Problem 3263
[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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator