Submission #991612

#TimeUsernameProblemLanguageResultExecution timeMemory
991612MalixExhibition (JOI19_ho_t2)C++14
100 / 100
92 ms4520 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vii; typedef pair<int,int> pi; typedef vector<pi> pii; #define REP(i,a,b) for(int i=a;i<b;i++) #define F first #define S second #define PB push_back #define MP make_pair ll INF=1e18+10; ll M=1e9+7; int main() { //ios::sync_with_stdio(0); //cin.tie(0); //freopen("test_input.txt", "r", stdin); //freopen("test_output.txt", "w", stdout); int n,m;cin>>n>>m; pii a(n); REP(i,0,n)cin>>a[i].S>>a[i].F; sort(a.begin(),a.end()); vi c(m); REP(i,0,m)cin>>c[i]; sort(c.begin(),c.end()); int ans=0;n--; while(m--){ while(n>=0&&a[n].S>c[m])n--; if(n>=0){ ans++; n--; } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...