mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 7483.cpp
From http://blog.csdn.net/clz19960630/article/details/50965800
This commit is contained in:
parent
7937f6624a
commit
266f3140e5
29
UVALive/7483.cpp
Normal file
29
UVALive/7483.cpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
#define pb push_back
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int N;
|
||||||
|
while(cin>>N){
|
||||||
|
vector <int> arr[201];
|
||||||
|
for (int i=1;i<=N;i++){
|
||||||
|
int a, b;
|
||||||
|
scanf("%d%d",&a,&b);
|
||||||
|
arr[a].pb(b);
|
||||||
|
}
|
||||||
|
int mn=2e9, ans=0;
|
||||||
|
for (int i=1;i<=N+N;i++){
|
||||||
|
if (mn < i) ans++, mn = 2e9;
|
||||||
|
for(int j=0;j<arr[i].size();j++)
|
||||||
|
{
|
||||||
|
int e=arr[i][j];
|
||||||
|
mn=min(mn,e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mn < 2e9) ans++;
|
||||||
|
printf("%d\n", ans);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user