fork download
  1. #include <bits/stdc++.h>
  2. //#include "grader.cpp"
  3.  
  4. using namespace std;
  5.  
  6. const int MAXN = (1e7) + 7;
  7.  
  8. int n;
  9. long long l,d[MAXN],p[MAXN];
  10. long long dp[MAXN],ans;
  11.  
  12. long long percorri(int N, long long L, long long D[], long long P[]) {
  13. int i,j;
  14. n=N;
  15. l=L;
  16. for(i=1;i<=n;i++) d[i]=D[i-1],p[i]=P[i-1];
  17. for(i=n;i>=1;i--) {
  18. dp[i]=l-d[i]+p[i];
  19. for(j=i+1;j<=n && j<=i+10;j++) {
  20. dp[i]=min(dp[i],max(d[j]-d[i]+p[i]+p[j],dp[j]));
  21. }
  22. }
  23. ans=l;
  24. for(i=1;i<=n;i++) ans=min(ans,max(d[i]+p[i],dp[i]));
  25. return ans;
  26. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i586-linux-gnu/5/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty