Submission #607425

#TimeUsernameProblemLanguageResultExecution timeMemory
607425CoolRabbitXTDancing Elephants (IOI11_elephants)C++14
0 / 100
1 ms340 KiB
#include "elephants.h" #include <bits/stdc++.h> using namespace std; int n; int l; vector <int> x; vector <int> sorted; int current_first; int camera_count = 1; void init(int N, int L, int X[]) { n = N; l = L; x.resize(n); for(int i = 0; i < n; i++){ x[i] = X[i]; } } int update(int i, int y) { x[i] = y; for(int i = 0; i<n; i++){ sorted[i] = x[i]; } sort(sorted.begin(), sorted.end()); current_first = sorted[0]; for(int i = 1; i<n; i++){ if(x[i] - current_first > l){ camera_count ++; current_first = sorted[i]; } } return camera_count; }
#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...