Submission #1025987

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10259872024-07-17 12:15:35socpiteHoliday (IOI14_holiday)C++17
24 / 100
235 ms12744 KiB
#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];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

holiday.cpp: In function 'void add(int, long long int)':
holiday.cpp:16:9: warning: statement has no effect [-Wunused-value]
   16 |     for(idx; idx <= N; idx += idx&(-idx)){
      |         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...