제출 #349949

#제출 시각아이디문제언어결과실행 시간메모리
349949idk321코끼리 (Dancing Elephants) (IOI11_elephants)C++11
26 / 100
9045 ms2924 KiB
#include "elephants.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; int n; const int N = 150001; int pos[N]; set<int> val; int l; void init(int n, int L, int x[]) { l = L; for (int i = 0; i < n; i++) { pos[i] = x[i]; val.insert(x[i]); } } int update(int i, int y) { val.erase(pos[i]); pos[i] = y; val.insert(y); int last = -1; int res = 0; for (auto it = val.begin(); it != val.end(); it++) { //cout << *it << " " << last << endl; if (*it > last) { last = *it + l; res++; } } return res; }
#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...