제출 #824966

#제출 시각아이디문제언어결과실행 시간메모리
824966LittleCube송신탑 (IOI22_towers)C++17
4 / 100
570 ms1460 KiB
#include "towers.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;

namespace 
{
  int N, k = 0, ono = 0;
  vector<int> H;
  void init()
  {
    while(k + 1 < N && H[k] < H[k + 1])
      k++;
    if(k == 0 || k == N - 1)
      ono = 1;
  }
}

void init(int _N, vector<int> _H) {
  N = _N;
  H = _H;
  init();
}

int max_towers(int L, int R, int D) {
  if(R <= k || k <= L || ono)
    return 1;
  else if(H[L] <= H[k] - D && H[R] <= H[k] - D)
    return 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...