Submission #423069

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4230692021-06-10 16:56:53MDarioThe Big Prize (IOI17_prize)C++11
20 / 100
129 ms5940 KiB
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
int maxn, abi[200001];
vector<int> v[200001];
void update_abi(int xf, int yf){
while(xf<=maxn){
abi[xf]+=yf;
xf+=xf&(-xf);
}
return;
}
int query_abi1(int xf){
int cr=0;
while(xf>0){
cr+=abi[xf];
xf-=xf&(-xf);
}
return cr;
}
int query_abi2(int xf){
int cr=0, cf=0;
for(int i=18; i>=0; i--){
if(cr+(1<<i)<=maxn){
if(cf+(1<<i)-abi[cr+(1<<i)]<xf){
cf+=(1<<i)-abi[cr+(1<<i)];
cr+=(1<<i);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:62:27: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]
   62 |             for(int i=0; r!=n-1; i++){
      |                          ~^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...