| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 139288 | 吴晨曦 | 分发饼干 | C++ | Accepted | 100 | 0 MS | 268 KB | 415 | 2024-03-23 00:01:36 |
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 005; int a[N], b[N], use[N]; int main() { int n, m; cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; cin >> m; int s = 0; for (int i = 1; i <= m; i++) { cin >> b[i]; int tmp = lower_bound(a + 1, a + n + 1, b[i]) - a; if (tmp != n + 1 and !use[tmp]) s++, use[tmp] = true; } cout << s << endl; return 0; }