Submission #1073504

# Submission time Handle Problem Language Result Execution time Memory
1073504 2024-08-24T15:29:28 Z fv3 Radio Towers (IOI22_towers) C++17
4 / 100
683 ms 1368 KB
#include "towers.h"
#include <bits/stdc++.h>

using namespace std;
const int INF = 1 << 30;

int N;
vector<int> H;

int K = 0;

void init(int N_, vector<int> H_)
{
  N = N_;
  H = H_;

  int mx = 0;
  for (int i = 0; i < N; i++)
  {
    if (H[i] > mx)
    {
      mx = H[i];
      K = i;
    }
  }
}

int max_towers(int L, int R, int D) 
{
  if (L < K && K < R) 
  {
    if (H[K] - max(H[L], H[R]) >= D)
      return 2;
    return 1;
  }

  return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 296 ms 1112 KB Output is correct
2 Correct 683 ms 1368 KB Output is correct
3 Correct 647 ms 1368 KB Output is correct
4 Correct 594 ms 1368 KB Output is correct
5 Correct 642 ms 1368 KB Output is correct
6 Correct 551 ms 1368 KB Output is correct
7 Correct 594 ms 1368 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 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 463 ms 1368 KB 1st lines differ - on the 1st token, expected: '11903', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 188 ms 684 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 296 ms 1112 KB Output is correct
2 Correct 683 ms 1368 KB Output is correct
3 Correct 647 ms 1368 KB Output is correct
4 Correct 594 ms 1368 KB Output is correct
5 Correct 642 ms 1368 KB Output is correct
6 Correct 551 ms 1368 KB Output is correct
7 Correct 594 ms 1368 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 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 -