# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
892755 | Kodik | Rabbit Carrot (LMIO19_triusis) | C++17 | 26 ms | 5460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
int main(){
ios_base::sync_with_stdio(false), cin.tie(NULL);
// freopen("cowjog.in", "r", stdin);
// freopen("cowjog.out", "w", stdout);
int pole_num, jump_height;
cin >> pole_num >> jump_height;
vector<int> poles(pole_num);
for(int &i : poles) cin >> i;
vector<int> poss_unchanged;
for(int i = 1; i <= pole_num; ++i){
if(i*jump_height >= poles[i-1]){
poss_unchanged.push_back(i*jump_height-poles[i-1]);
}
}
vector<int> ans;
for(int &i : poss_unchanged){
int pos = upper_bound(ans.begin(), ans.end(), i) - ans.begin();
if(pos == ans.size()){
ans.push_back(i);
}else{
ans[pos] = i;
}
}
cout << pole_num - ans.size() << '\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... |