Submission #1061802

# Submission time Handle Problem Language Result Execution time Memory
1061802 2024-08-16T13:38:41 Z MarwenElarbi Radio Towers (IOI22_towers) C++17
0 / 100
4000 ms 1716 KB
#include <bits/stdc++.h>
using namespace std;
#include "towers.h"
#define pb push_back
#define ll long long
#define fi first
#define se second
int n;
vector<int> tab;
void init(int N, std::vector<int> H) {
  n=N;
  for (int i = 0; i < N; ++i)
  {
    tab.pb(H[i]);
  }
}

int max_towers(int L, int R, int D){
  int dp[n];
  int mx=-1;
  for (int i = L; i <= R; ++i)
  {
    dp[i]=1;
    for (int j = i-1; j >= L; --j)
    {
      if(tab[j]<=mx-D&&tab[i]<=mx-D) dp[i]=max(dp[i],dp[j]+1);
      mx=max(mx,tab[j]);
    }
  }
  return dp[R];
}
# Verdict Execution time Memory Grader output
1 Execution timed out 4067 ms 1264 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 1st lines differ - on the 1st token, expected: '13', found: '44'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 1st lines differ - on the 1st token, expected: '13', found: '44'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4008 ms 1716 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4016 ms 856 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 1st lines differ - on the 1st token, expected: '13', found: '44'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4067 ms 1264 KB Time limit exceeded
2 Halted 0 ms 0 KB -