# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
815978 | acatmeowmeow | Zoltan (COCI16_zoltan) | C++11 | 143 ms | 16256 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>
using namespace std;
#define int long long
const int N = 2e5, modulo = 1e9 + 7;
int n, x[N + 5], y[N + 5];
pair<int, int> dp[N + 5], dp2[N + 5], tree[N + 5];
vector<int> mp;
pair<int, int> combine(pair<int, int>&a, pair<int, int>&b) {
if (a.first == b.first) return {a.first, (a.second + b.second) % modulo};
else return a > b ? a : b;
}
void update(int k, pair<int, int>x) {
for (; k <= n; k += k&-k) tree[k] = combine(tree[k], x);
}
pair<int, int> query(int k) {
pair<int, int> ans = {0, 0};
for (; k; k -= k&-k) ans = combine(ans, tree[k]);
return ans;
}
int binpow(int n, int k) {
if (!k) return 1;
else {
int ans = binpow(n, k/2);
ans *= ans, ans %= modulo;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |