Find the Parts
시간 제한4초메모리 제한2048 MB
무작위 잡음으로 이루어진 r x c 흑백 이미지를 400 KiB 메모리만 남기고 지운 뒤에도, 작은 사각형 조각의 위치를 정확히 답하는 방법을 설계한다.
문제
Two robots, Carl and Clara, are a part of a secret network designed to pass messages.
Robot Clara has got a secret message. The message has a form of a black-and-white rectangle of rows and columns which contains pixels. Each pixel is characterized by brightness: an integer from to (a byte) where is black, is white, and the numbers in between correspond to different shades of gray.
Clara does not know whether the message has some hidden meaning, but it definitely looks like "white noise": each pixel can be considered to have a random value which is independent from other pixels and uniformly distributed among the possible colors.
Clara's job is to answer questions by robot Carl. Each question is formulated as a small black-and-white rectangle. The answer is the coordinates of that rectangle in the original message.
However, before answering questions, Clara has to delete the message. Unfortunately, her memory is limited to a mere kibibytes, so the message may not fit there...
How should Clara act to nevertheless answer all the questions correctly?