Submission #671699

#TimeUsernameProblemLanguageResultExecution timeMemory
671699Hacv16Dancing Elephants (IOI11_elephants)C++17
26 / 100
9099 ms3548 KiB
#include "elephants.h" #include<bits/stdc++.h> #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") using namespace std; typedef long long ll; const int MAX = 2e6 + 15; int n, l, x[MAX]; set<int> s; void init(int n_, int l_, int x_[]){ n = n_, l = l_; for(int i = 0; i < n; i++) x[i] = x_[i], s.insert(x[i]); } int update(int i, int y){ s.erase(x[i]); s.insert(y); x[i] = y; int ans = 0, r = -1; for(auto x : s) if(x > r) ans++, r = x + l; 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...