Submission #165556

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1655562019-11-27 12:42:01ArKCaCipele (COCI18_cipele)C++14
9 / 90
1089 ms198748 KiB
#include<bits/stdc++.h>
using namespace std;
int n,k,m;
int dizi1[5000],dizi2[5000],dp[5000][5000];
int dpf(int crr,int r){
if(crr==(n-1)){
int mn=INT_MAX;
for(int i=r;i<m;i++){
mn=min(mn,abs(dizi1[crr]-dizi2[i]) );
}
dp[crr][r]=mn;
return dp[crr][r];
}
if( (n-crr) > (m-r) ){
return INT_MAX;
}
if(dp[crr][r]!=-1){
return dp[crr][r];
}
int mn=INT_MAX;
// printf("a\n");
for(int i=r;i<m && ( (n-(crr+1)) <= (m-(i+1)) );i++){
mn=min(mn,max( abs(dizi1[crr]-dizi2[i] ),dpf(crr+1,i+1) ) );
}
dp[crr][r]=mn;
return dp[crr][r];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...