# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
109022 | PeppaPig | 늑대인간 (IOI18_werewolf) | C++14 | 2494 ms | 220804 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "werewolf.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5+5;
int n, m, q;
struct node {
int d;
node *l, *r;
node(int d, node *l, node *r) : d(d), l(l), r(r) { }
};
node* newleaf(int d) { return new node(d, nullptr, nullptr); }
node* newpar(node *l, node *r) { return new node(l->d + r->d, l, r); }
node* build(int l = 1, int r = n) {
if(l == r) return newleaf(0);
int mid = (l + r) >> 1;
return newpar(build(l, mid), build(mid+1, r));
}
node* update(node *p, int x, int l = 1, int r = n) {
if(l == r) return newleaf(p->d + 1);
int mid = (l + r) >> 1;
if(x <= mid) return newpar(update(p->l, x, l, mid), p->r);
else return newpar(p->l, update(p->r, x, mid+1, r));
}
# | 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... |