Submission #781943

# Submission time Handle Problem Language Result Execution time Memory
781943 2023-07-13T14:02:42 Z FEDIKUS Radio Towers (IOI22_towers) C++17
0 / 100
11 ms 1176 KB
#include "towers.h"

#include <bits/stdc++.h>

using namespace std;

int maxi=-1;
vector<int> *h;

void init(int n, vector<int> _h) {
  h=&_h;
  maxi=max_element((*h).begin(),(*h).end())-(*h).begin();
}

int max_towers(int l, int r, int d) {
  if(l<maxi && maxi<r){
    if((*h)[l]+d<=(*h)[maxi] && (*h)[r]+d<=(*h)[maxi]) return 2;
    else return 1;
  }else return 1;
}
# Verdict Execution time Memory Grader output
1 Runtime error 11 ms 868 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 336 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 336 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 10 ms 1176 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 676 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 336 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 11 ms 868 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -