# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
16199 | jihoon | K blocks (IZhO14_blocks) | C++98 | 137 ms | 80896 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
#define inf 500000000
int n,k;
int su[100002];
int dp[100002][101];
int dpp[100002][101];
vector<int> st;
int stp;
int main(){
int i,j;
scanf("%d %d",&n,&k);
for(i=1;i<=n;i++){
scanf("%d",&su[i]);
}
su[0]=inf;
for(i=0;i<=n;i++){
for(j=0;j<=k;j++){
dp[i][j]=inf;
dpp[i][j]=inf;
}
}
st.push_back(0);
stp=1;
for(i=1;i<=n;i++){
while(stp>0){
if(su[st[stp-1]]>su[i]) break;
for(j=0;j<=k;j++){
# | 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... |