| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 874304 | mall0809 | Rabbit Carrot (LMIO19_triusis) | C++17 | 27 ms | 5336 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define C int(1e6+7)
#define el '\n'
#define MOD int(1e9+7)
#define all(a) a.begin(),a.end()
#define pb push_back
using namespace std;
typedef long long ll;
const ll M = 5e18;
ll dp[C];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
// freopen("cowjog.in","r",stdin);
// freopen("cowjog.out","w",stdout);
int n,k;cin>>n>>k;
vector<int> a;
for(int i=1;i<=n;i++){
ll x;cin>>x;
x = (ll)k*i-x;
if(x >= 0)a.pb(x);//if neg,must be change as in the first step from 0,you can't jump on it
}
for(int i=1;i<=a.size();i++)dp[i] = M;
dp[0] = 0;
for(int i=0;i<a.size();i++){
int id = upper_bound(dp,dp+a.size()+1,a[i]) - dp;
if(dp[id-1] <= a[i] && a[i] < dp[id])dp[id] = a[i];
}
for(int i=a.size();i>=0;i--){
if(dp[i] != M){
cout<<n-i;
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... | ||||
