Submission #793062

#TimeUsernameProblemLanguageResultExecution timeMemory
793062CookieExhibition (JOI19_ho_t2)C++14
0 / 100
1 ms340 KiB
#include<bits/stdc++.h> #include<fstream> using namespace std; ifstream fin("FEEDING.INP"); ofstream fout("FEEDING.OUT"); #define sz(a) (int)a.size() #define ll long long #define pb push_back #define forr(i, a, b) for(int i = a; i < b; i++) #define dorr(i, a, b) for(int i = a; i >= b; i--) #define ld long double #define vt vector #include<fstream> #define fi first #define se second #define pll pair<ll, ll> #define pii pair<int, int> const ld PI = 3.14159265359; using u128 = __uint128_t; const int x[4] = {1, -1, 0, 0}; const int y[4] = {0, 0, 1, -1}; const ll mod = 1e9 + 7, inf = 1e9; const int mxn = 1e5 + 5; int n, m; pll p[mxn + 1]; ll c[mxn + 1]; bool cmp(pll a, pll b){ if(a.se == b.se)return(a.fi > b.fi); return(a.se > b.se); } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m; for(int i = 1; i <= n; i++){ cin >> p[i].fi >> p[i].se; } sort(p + 1, p + n + 1, cmp); for(int i = 1; i <= m; i++)cin >> c[i]; sort(c + 1, c + n + 1, greater<ll>()); int id = 1; for(int i = 1; i <= n; i++){ if(id <= m && p[i].fi <= c[id])id++; } cout << id - 1; return(0); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...