# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
104529 | 2019-04-07T15:49:28 Z | figter001 | 코끼리 (Dancing Elephants) (IOI11_elephants) | C++17 | 0 ms | 0 KB |
// #include "grader.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const int N = 1e5+50; const ll oo = 1e18; const ll mod = 1e9+7; int n,l; vector<int> a; void init(int N, int L, int X[]){ n = N; l=L; for(int i=0;i<n;i++) a.push_back(X[i]); } int update(int x, int y){ vector<int> tmp; for(int i=0;i<n;i++){ if(i == x) continue; if(a[i] >= y && y != -1){ tmp.push_back(y); y = -1; } tmp.push_back(a[i]); } if(tmp.size() != a.size()) tmp.push_back(y); a = tmp; int ans = 0;z` int to = -1; for(int it : a){ if(it > to){ to = it+l; ans++; } } return ans; }