Drawing Lines

시간 제한1초메모리 제한2048 MB

요약
좌표 범위 [-10000,10000]이고 길이가 100 이상인 숨은 선분의 두 끝점을, 최대 25000번의 상호작용 질의로 찾는다.
난이도

보통10점 중 6점

유형
기하, 이분 탐색, 구현
정답자
아직 제출이 없습니다

문제

This is an interactive problem.

The jury has an image of a straight line segment with endpoints (X_1,Y_1)(X\_1, Y\_1) and (X_2,Y_2)(X\_2, Y\_2). The coordinates satisfy the following constraints:

  • X\_1, Y\_1, X\_2, Y\_2 \in \left\[-10\\,000; 10\\,000\right].
  • The length of the segment is at least 100100.

Your task is to produce the same image.

You are allowed to create several images of the same kind: images of a straight line segment with endpoints (x_1,y_1)(x\_1, y\_1) and (x_2,y_2)(x\_2, y\_2). After you created an image, you will get the similarity (sim\mathrm{sim}) of your image and jury's by the following formulas:

dst(a_1,b_1,a_2,b_2)=(a_1−a_2)2+(b_1−b_2)2;\mathrm{dst}(a\_1, b\_1, a\_2, b\_2) = \sqrt{(a\_1 - a\_2)^2 + (b\_1 - b\_2)^2}\text{;} s=min⁡(dst(x_1,y_1,X_1,Y_1)+dst(x_2,y_2,X_2,Y_2),dst(x_1,y_1,X_2,Y_2)+dst(x_2,y_2,X_1,Y_1));s = \min\left(\mathrm{dst}(x\_1, y\_1, X\_1, Y\_1) + \mathrm{dst}(x\_2, y\_2, X\_2, Y\_2), \mathrm{dst}(x\_1, y\_1, X\_2, Y\_2) + \mathrm{dst}(x\_2, y\_2, X\_1, Y\_1)\right)\text{;} sim=max⁡(0,40,000−s40,000).\mathrm{sim} = \max\left(0, \frac{40\\,000 - s}{40\\,000}\right)\text{.}

The goal is to make an image with 100100\\% similarity using no more than 25,00025\\,000 tries.

예제1

  1. 예제 1

    입력
    
    29.4
    
    94.9
    
    99.7
    
    99.9
    
    99.7
    
    99.9
    
    100.0
    
    예상 출력
    -10000 -10000 10000 10000
    
    0 -1000 0 1000
    
    100 -10 -100 10
    
    -70 0 70 0
    
    -50 0 -50 1
    
    50 0 -50 1
    
    50 0 -50 0