# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
671757 | Hacv16 | Dancing Elephants (IOI11_elephants) | C++17 | 1 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "elephants.h"
#include<bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
typedef long long ll;
const int MAX = 2e6 + 15;
int n, L, X[] = {10, 15, 17, 20};
vector<int> x;
void init(int n_, int l_, int x_[]){
n = n_, L = l_;
x.resize(n);
for(int i = 0; i < n; i++)
x[i] = x_[i];
}
vector<int> Merge(vector<int>& v, vector<int>& t){
vector<int> ret(sz(v) + sz(t));
merge(all(v), all(t), ret.begin());
return ret;
}
int update(int i, int y){
vector<int> l, r, m;
m.push_back(y);
for(int j = 0; j < i; j++)
l.push_back(x[j]);
for(int j = i + 1; j < sz(x); j++)
r.push_back(x[j]);
vector<int> aux1 = Merge(l, m);
vector<int> aux2 = Merge(aux1, r);
swap(x, aux2);
int ans = 0;
for(int j = 0, t = -1; j < x.size(); j++)
if(x[j] > t) ans++, t = x[j] + L;
return ans;
}
/*int main(){
init(4, 10, X);
cout << update(2, 16) << '\n';
cout << update(1, 25) << '\n';
cout << update(3, 35) << '\n';
cout << update(0, 38) << '\n';
cout << update(2, 0) << '\n';
return 0;
}*/
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |