Submission #284873

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2848732020-08-28 07:22:55TMJNDancing Elephants (IOI11_elephants)C++17
97 / 100
9005 ms7048 KiB
#include "elephants.h"
#include <bits/stdc++.h>
using namespace std;
const int bsize=800;
int N,A[150000],B[150000],C[150000],P[150000],L,D[1000],c;
vector<int>vb[1000];
pair<int,int>pp[150000];
void update_bucket(int t){
for(int i:vb[t]){
C[i]=t;
}
for(int i=vb[t].size()-1;i>=0;i--){
int l,r;
l=i;
r=vb[t].size();
while(l+1!=r){
int m=(l+r)/2;
if(P[vb[t][i]]+L<P[vb[t][m]]){
r=m;
}
else{
l=m;
}
}
if(r==vb[t].size()){
A[vb[t][i]]=1;
B[vb[t][i]]=P[vb[t][i]]+L;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

elephants.cpp: In function 'void update_bucket(int)':
elephants.cpp:27:7: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |   if(r==vb[t].size()){
      |      ~^~~~~~~~~~~~~~
elephants.cpp: In function 'void erase(int)':
elephants.cpp:40:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |  for(int i=0;i<vb[id].size()-1;i++){
      |              ~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...