Submission #254714

#TimeUsernameProblemLanguageResultExecution timeMemory
254714SortingDancing Elephants (IOI11_elephants)C++14
26 / 100
9045 ms1912 KiB
#include "elephants.h" #include <bits/stdc++.h> using namespace std; const int k_N = 15e4 + 3; int n, l; int *x, tmp[k_N]; void init(int N, int L, int X[]){ n = N; l = L; x = X; } int update(int idx, int y){ x[idx] = y; for(int i = 0; i < n; ++i) tmp[i] = x[i]; sort(tmp, tmp + n); int start = 0, ans = 1; for(int i = 0; i < n; ++i){ if(tmp[i] > l + tmp[start]){ start = i; ans++; } } return ans; }
#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...