제출 #391206

#제출 시각아이디문제언어결과실행 시간메모리
391206rocks03코끼리 (Dancing Elephants) (IOI11_elephants)C++14
26 / 100
9022 ms1112 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define ff first #define ss second #define pb push_back #define SZ(x) ((int)(x).size()) #define all(x) x.begin(), x.end() #define debug(x) cout << #x << ": " << x << " " #define nl cout << "\n" #define rep(i, a, b) for(int i = (a); i < (b); i++) #define per(i, a, b) for(int i = (a); i >= (b); i--) mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int *a, N, L; vector<int> st; void init(int n, int l, int X[]){ a = X, N = n, L = l; rep(i, 0, n) st.pb(X[i]); } int update(int v, int y){ st.erase(find(all(st), a[v])); a[v] = y; st.insert(upper_bound(all(st), a[v]), a[v]); int ans = 0, i = 0; while(i < N){ ans++; i = upper_bound(all(st), st[i] + L) - st.begin(); } 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...