# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
434209 | dutch | Selling RNA Strands (JOI16_selling_rna) | C++17 | 227 ms | 116324 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
#define num(c) (c > 'A') + (c > 'C') + (c > 'G') + (c > 'U')
template<class T> struct fenwick{
vector<T> a; int n, p=1<<30; T s;
fenwick(int N) : a(++(n=N)) {}
fenwick& operator[](int i){ p = i; return *this; }
void operator+=(T v){
for(++p; p<n; p+=p&-p) a[p] += v; }
void operator=(T v){ operator+=(v - operator()(p, p)); }
T operator()(int i){
for(s=0, ++i; i; i^=i&-i) s += a[i];
return s; }
T operator()(int l, int r){ return operator()(r) - operator()(l-1); }
int lower_bound(T v){
for(s=0, p=1<<21; p/=2; ) if(s+p<=n && a[s+p]<v) v -= a[s+=p];
return s;
}
};
const int LIM = (int)2e6+1;
array<int, 4> g[LIM];
int t0[LIM], t1[LIM], dfsTimer = -1;
void dfs(int u){
t0[u] = ++dfsTimer;
for(int &v : g[u]) if(v > 0) dfs(v);
# | 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... |