Submission #845819

# Submission time Handle Problem Language Result Execution time Memory
845819 2023-09-06T16:00:54 Z Marco_Escandon Radio Towers (IOI22_towers) C++17
4 / 100
532 ms 1880 KB
#include<bits/stdc++.h>
#pragma once
using namespace std;
#include <vector>
typedef long long ll;
ll p=0;
vector<ll> h;
void init(int N, std::vector<int> H)
{
  p=N+2;
  h.resize(N);
  h[0]=H[0];
  h[N-1]=H[N-1];
  for(int i=1; i<N-1; i++)
  {
    if(H[i]>H[i-1]&&H[i]>H[i+1])
    {
      p=i;
    }
      h[i]=H[i];
  }
}
int max_towers(int L, int R, int D)
{
  if(L<p&&R>p&&h[p]-D>=h[R]&&h[p]-D>=h[L])
  {
    return 2;
  }
  return 1;
}

Compilation message

towers.cpp:2:9: warning: #pragma once in main file
    2 | #pragma once
      |         ^~~~
# Verdict Execution time Memory Grader output
1 Correct 239 ms 1188 KB Output is correct
2 Correct 491 ms 1856 KB Output is correct
3 Correct 532 ms 1880 KB Output is correct
4 Correct 503 ms 1828 KB Output is correct
5 Correct 462 ms 1848 KB Output is correct
6 Correct 509 ms 1860 KB Output is correct
7 Correct 450 ms 1852 KB Output is correct
8 Correct 0 ms 600 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
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: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 333 ms 1824 KB 1st lines differ - on the 1st token, expected: '11903', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 137 ms 780 KB 1st lines differ - on the 1st token, expected: '7197', found: '2'
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: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 239 ms 1188 KB Output is correct
2 Correct 491 ms 1856 KB Output is correct
3 Correct 532 ms 1880 KB Output is correct
4 Correct 503 ms 1828 KB Output is correct
5 Correct 462 ms 1848 KB Output is correct
6 Correct 509 ms 1860 KB Output is correct
7 Correct 450 ms 1852 KB Output is correct
8 Correct 0 ms 600 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Incorrect 0 ms 344 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
12 Halted 0 ms 0 KB -