Submission #1040920

#TimeUsernameProblemLanguageResultExecution timeMemory
1040920MrPavlitoExhibition (JOI19_ho_t2)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> #define int long long #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define sc second #define endl "\n" #define pii pair<int,int> using namespace std; const int MAXN = 1e5+5; const int mod7 = 1e9+7; const long long inf = 1e18; bool CMP(pii p1, pii p2) { if(p1.sc == p2.sc)return p1.fi < p2.fi; return p1.sc < p2.sc; } signed main() { ios_base::sync_with_stdio(false),cin.tie(0), cout.tie(0); int tt=1; //cin >> tt; while(tt--) { int n,m; cin >> n >> m; vector<pii> slike(n); for(int i=0; i<n; i++)cin >> slike[i].fi >> slike[i].sc; sort(all(slike), CMP); vector<int> ramovi(m); for(int i=0; i<m; i++)cin >> ramovi[i]; sort(all(ramovi)); int pointer = 0; int rez = 0; for(int i=0; i<m; i++) { if(slike[pointer].fi <= ramovi[i]) { rez++; pointer++; } } cout << rez << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...