Submission #836803

# Submission time Handle Problem Language Result Execution time Memory
836803 2023-08-24T15:57:06 Z Abrar_Al_Samit Radio Towers (IOI22_towers) C++17
0 / 100
520 ms 1056 KB
#include "towers.h"
#include <bits/stdc++.h>

using namespace std;

bool tp;
int n;
void init(int N, vector<int> H) {
  n = N;
  if(n==1) return;

  if(H[N-1]>H[N-2]) tp = 0;
  else if(H[0]>H[1]) tp = 1;
  else tp = 2;
}

int max_towers(int L, int R, int D) {
  if(n==1) return 1;
  if(tp < 2) return 1;
  return 2;
}

Compilation message

towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:19:9: warning: comparison of constant '2' with boolean expression is always true [-Wbool-compare]
   19 |   if(tp < 2) return 1;
      |      ~~~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 286 ms 676 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 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 1 ms 208 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 520 ms 1056 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 232 ms 464 KB 1st lines differ - on the 1st token, expected: '7197', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 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 286 ms 676 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -