#include <bits/stdc++.h>
using namespace std;
void solve() {
int l, n;
cin >> l >> n;
vector<pair<int, int>> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i].first >> a[i].second;
}
sort(a.begin(), a.end());
vector<double> b;
for (auto &[t, v] : a) {
b.push_back(t + (double)l / v);
}
vector<double> dp;
for (double f : b) {
auto it = lower_bound(dp.begin(), dp.end(), -f);
if (it == dp.end()) dp.push_back(-f);
else *it = -f;
}
cout << dp.size() << "\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |