| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1110519 | luvna | Rabbit Carrot (LMIO19_triusis) | C++14 | 21 ms | 5320 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define endl "\n"
using namespace std;
const int N = 2e5 + 15;
int n, m;
int a[N];
int lis(vector<int>& potential){
vector<int> vec;
for(int x : potential){
int pos = upper_bound(all(vec), x) - vec.begin();
if(pos == (int)vec.size()) vec.push_back(x);
else vec[pos] = x;
}
return (int)vec.size();
}
void solve(){
cin >> n >> m;
vector<int> potential;
for(int i = 1; i <= n; i++){
cin >> a[i];
if(a[i] <= i*m) potential.push_back(i*m - a[i]);
}
cout << n - lis(potential) << endl;
}
signed main(){
ios_base::sync_with_stdio(NULL);
cin.tie(0); cout.tie(0);
#define task "task"
if(fopen(task".INP", "r")){
freopen(task".INP", "r", stdin);
freopen(task".OUT", "w", stdout);
}
int t; t = 1; //cin >> t;
while(t--) solve();
}
컴파일 시 표준 에러 (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... | ||||
