Submission #62169

#TimeUsernameProblemLanguageResultExecution timeMemory
62169realityDancing Elephants (IOI11_elephants)C++17
26 / 100
9014 ms1828 KiB
#include "elephants.h" #include "bits/stdc++.h" using namespace std; #define fi first #define se second #define ll long long #define dbg(v) cerr<<#v<<" = "<<v<<'\n' #define vi vector<int> #define vl vector <ll> #define pii pair<int,int> #define mp make_pair #define db long double #define pb push_back #define all(s) s.begin(),s.end() template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;} template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;} int n,l; vi s; void init(int N, int L, int X[]) { n = N; l = L; for (int i = 0;i < n;++i) s.pb(X[i]); } int update(int i, int y) { s[i] = y; int ans = 0; set < int > ss(all(s)); int prev = -(l + 1); for (auto it : ss) { if (it > prev) { ++ans; prev = it + 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...