# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1025987 | socpite | Holiday (IOI14_holiday) | C++17 | 235 ms | 12744 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"holiday.h"
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+5;
const long long INF = 1e18;
long long A[maxn];
long long dpfx[maxn], dsfx[maxn];
int s, N, D;
int pos[maxn];
long long FW[2][maxn];
void add(int idx, long long val){
for(idx; idx <= N; idx += idx&(-idx)){
FW[0][idx] += val;
FW[1][idx]++;
}
}
long long gt(int k){
if(k < 0)return -INF;
int pos = 0;
long long sum = 0;
for(int i = 17; i >= 0; i--){
if(pos + (1<<i) > N)continue;
if(k - FW[1][pos^(1<<i)] >= 0){
pos^=(1<<i);
k -= FW[1][pos];
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... |