#include <bits/stdc++.h>
using namespace std;
const long Nmax = 1e5 + 5;
long c[Nmax];
int n, m;
struct mang {
int first, second;
};
bool cmp(mang x, mang y) {
if (x.first == y.first) return x.second < y.second;
else return x.first < y.first;
}
int main() {
cin.tie(NULL) -> sync_with_stdio(false);
cin >> n >> m;
mang a[Nmax];
for (int i = 1; i <= n; ++i)
cin >> a[i].first >> a[i].second;
for (int j = 1; j <= m; ++j) cin >> c[j];
sort(a+1, a+n+1, cmp);
sort(c+1, c+m+1);
int ind = 1;
int ans = 1;
for (int i = 1; i <= m; ++i) {
while (ind <= n && a[ind].first > c[i]) ind++;
if (ind > n) break;
cout << ind << endl;
ans++;
ind++;
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1112 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1112 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1112 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |