제출 #836803

#제출 시각아이디문제언어결과실행 시간메모리
836803Abrar_Al_Samit송신탑 (IOI22_towers)C++17
0 / 100
520 ms1056 KiB
#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;
}

컴파일 시 표준 에러 (stderr) 메시지

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...