Submission #253726

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2537262020-07-28 15:17:02kimbj0709Ball Machine (BOI13_ballmachine)C++14
100 / 100
790 ms43132 KiB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define maxn 100050
vector<vector<int> > adj(maxn);
vector<int> mini(maxn,-1);
vector<int> fenwick(maxn,0);
vector<int> num(maxn,0);
vector<int> ipos(maxn,0);
#define f first
#define s second
int parents[18][maxn];
void add(int a){
int pos = a+1;
while(pos<fenwick.size()){
fenwick[pos] += 1;
pos += pos&(-pos);
}
return;
}
void add2(int a){
int pos = a+1;
while(pos<fenwick.size()){
fenwick[pos] -= 1;
pos += pos&(-pos);
}
return;
}
int query(int a,int b){
int sum = 0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

ballmachine.cpp: In function 'void add(long long int)':
ballmachine.cpp:15:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(pos<fenwick.size()){
           ~~~^~~~~~~~~~~~~~~
ballmachine.cpp: In function 'void add2(long long int)':
ballmachine.cpp:23:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(pos<fenwick.size()){
           ~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...