이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n, L, R, Y;
cin >> n >> L >> R >> Y;
map<int, int> mp;
for (int i = 0, x, v, h; i < n; i++) {
cin >> x >> v >> h;
int l = max(1LL * L, x - (1LL * h * Y - 1) / v);
int r = min(1LL * R, x + (1LL * h * Y - 1) / v);
mp[l]++, mp[r + 1]--;
}
vector<int> res(n + 1);
int lst = L, cur = 0;
for (auto &p : mp) {
res[cur] += p.first - lst;
cur += p.second, lst = p.first;
}
res[cur] += R + 1 - lst;
for (int i = 0; i <= n; i++) {
if (i) res[i] += res[i - 1];
cout << res[i] << "\n";
}
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |