Submission #1015514

# Submission time Handle Problem Language Result Execution time Memory
1015514 2024-07-06T12:57:46 Z nam6 Radio Towers (IOI22_towers) C++17
0 / 100
10 ms 1368 KB
#include "towers.h"
#include<bits/stdc++.h>
using namespace std; 

int sommet; 
vector<int> altitudes; 

void init(int N, vector<int> H) {
  altitudes = H; 
  int hcur = 0; 
  int pos = 0; 
  while(H[pos] > hcur){
    hcur = H[pos]; 
    pos++; 
  }
  sommet = pos-1; 
  cout << sommet << endl;
}

int max_towers(int L, int R, int D) {
  if(L==R)
    return 1; 
  if(L<=sommet && R<=sommet)
    return 1; 
  if(L>=sommet && R>=sommet)
    return 1; 
  if(altitudes[sommet] - max(altitudes[L], altitudes[R]) < D)
    return 1; 
  return 2;
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1112 KB Possible tampering with the output or unexpected termination of the program
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Possible tampering with the output or unexpected termination of the program
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Possible tampering with the output or unexpected termination of the program
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 1368 KB Possible tampering with the output or unexpected termination of the program
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 600 KB Possible tampering with the output or unexpected termination of the program
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Possible tampering with the output or unexpected termination of the program
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1112 KB Possible tampering with the output or unexpected termination of the program
2 Halted 0 ms 0 KB -