# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
39538 | 14kg | 역사적 조사 (JOI14_historical) | C++11 | 4000 ms | 15328 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 <stdio.h>
#include <algorithm>
#include <set>
#include <map>
#define N 100001
#define NN 262144
#define SQ 300
#define max2(x,y) (x>y?x:y)
using namespace std;
typedef pair<pair<int, int>, int> ppi;
int n, q_len, M_len, nn, in[N], Md[N];
long long tree[NN], out[N];
ppi Q[N];
set<int> S;
map<int, int> M;
bool cmp(ppi x, ppi y) {
pair<int,int> tx = { x.first.first / SQ,x.first.second / SQ };
pair<int,int> ty = { y.first.first / SQ,y.first.second / SQ };
return x < y;
}
void Push(int x, long long num) {
tree[nn + x - 1] += num;
for (int lev = (nn + x - 1) / 2; lev; lev /= 2) {
tree[lev] = max2(tree[lev * 2], tree[lev * 2 + 1]);
}
}
int main() {
scanf("%d %d", &n, &q_len);
Compilation message (stderr)
# | 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... |