| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1339337 | dusky | Fuel Station (NOI20_fuelstation) | C++20 | 99 ms | 12876 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
vector<pair<int, pair<int, int>>> stations;
signed main() {
// freopen("in.txt", "r", stdin);
ios::sync_with_stdio(0); cin.tie(0);
int n, d; cin >> n >> d;
for (int i = 0; i < n; i++) {
int x, a, b; cin >> x >> a >> b;
stations.push_back({x, {a, b}});
} sort(stations.begin(), stations.end());
stations.push_back({d, {0, d}});
int f = 0, cf = 0, cx = 0;
for (auto [x, s] : stations) {
auto [a, b] = s;
int dist = x-cx; cf -= dist;
if (cf < 0ll) { f += -cf; cf = 0; }
cf += a; cx = x;
} cout << f;
}| # | 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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
