# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
576271 | mars | Fountain (eJOI20_fountain) | C++14 | 288 ms | 21228 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int dp[100005][20];
int water[100005][20];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, q, diam, a, b;
cin >> n >> q;
priority_queue<pair<int, int>> pq; // diameter, id
for (int i = 1; i <= n; i++) {
cin >> diam >> water[i][0];
while(!pq.empty() && -pq.top().first < diam) {
dp[pq.top().second][0] = i;
pq.pop();
}
pq.push({-diam, i});
}
while(!pq.empty()) {
dp[pq.top().second][0] = 0;
pq.pop();
}
dp[0][0] = 0;
water[0][0] = 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... |