Submission #836803

#TimeUsernameProblemLanguageResultExecution timeMemory
836803Abrar_Al_SamitRadio Towers (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; }

Compilation message (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...