Submission #478407

#TimeUsernameProblemLanguageResultExecution timeMemory
478407FireGhost1301Exhibition (JOI19_ho_t2)C++11
0 / 100
1 ms336 KiB
/** __author__ : FireGhost problems_ID: JOI19_ho_t2 */ #include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define eb emplace_back #define fi first #define se second #define all(x) x.begin(), x.end() using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair<int, int>; const int N = 1e5 + 3; const int MOD = 1e9 + 7; struct item { int s, v; bool operator < (const item &o) const { return v < o.v; } }; int n, m, c[N], dp[N], p[N]; item a[N]; void solve() { cin >> n >> m; for (int i = 1; i <= n; ++i) cin >> a[i].s >> a[i].v; for (int i = 1; i <= m; ++i) cin >> c[i]; sort(a + 1, a + n + 1); sort(c + 1, c + n + 1); int j = n, ans = 0; for (int i = n; i > 0; --i) { if (a[i].s > c[j]) continue; --j, ++ans; } cout << ans; } int main() { cin.tie(NULL); ios_base::sync_with_stdio(false); int t = 1; while (t--) solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...