# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
441457 | elazarkoren | Fountain (eJOI20_fountain) | C++17 | 845 ms | 34616 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 <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#define x first
#define y second
#define int long long
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
const int MAX_N = 1e5 + 2;
const int infinity = 1e9 + 1;
int d[MAX_N], c[MAX_N], loga[MAX_N];
int32_t main() {
int n, q;
cin >> n >> q;
for (int i = 1; i <= n; i++) cin >> d[i] >> c[i];
for (int i = 2; i <= n; i++) {
loga[i] = loga[i >> 1] + 1;
}
vector<vii> dp(loga[n] + 1, vii(n + 2, {n + 1, infinity}));
d[n + 1] = c[n + 1] = infinity;
stack<int> stk;
stk.push(n + 1);
for (int i = n; i; i--) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |