시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 2 | 1 | 1 | 50.000% |
Space shuttle has lost its black-box somewhere in the universe, and the crew is trying to find it as soon as possible.
Signal emitted from the box is not strong enough to determine the exact position of the box. However, when the spaceship moves, the instruments can determine if the signal from the box is now stronger or weaker than before, and hence the crew knows if the spaceship is now closer or further from the box.
The universe is a three-dimensional space consisted of NxNxN small squares. Each square is represented by three coordinates, all of them are positive integers less than or equal to N.
At the beginning, spaceship is located in the square (1,1,1), and the black-box is at an different unknown location.
Write a program that will find the black-box (i.e. by moving the spaceship to the exact position of the black-box) with at most 200 calls to function Pomak
.
You should implement the following function. The program should include svemir.h
using the preprocessing directive #include
.
void solve(int N)
N
is the value of the number N.Your program can call the following function.
int Pomak(int x, int y, int z)
Olympiad > Croatian Highschool Competitions in Informatics > 2005 > National Competition #1 - Seniors 2번
C++17, C++14, C++20, C++14 (Clang), C++17 (Clang), C++20 (Clang)