Light Bulbs
시간 제한4초메모리 제한1024 MB
N x N 격자에서 각 램프의 방향이 가로인지 세로인지 알려지지 않은 상태에서, 켜진 칸 수를 묻는 실험을 2000번 이하로 수행해 방 전체를 밝히는 최소 램프 수를 찾는다.
문제
Shortly after founding his lightbulb company in Eindhoven in 1891, Frederik Philips made a great discovery: lightbulbs that light up an infinite ray in the horizontal or vertical direction. With this new discovery, he wants to revolutionize the interior design of modern homes.
He plans an elaborate installation with his son, Gerard. They install lamps in an grid in a room. They want to light up the whole room with as few lamps turned on as possible to save electricity. Each lamp is either vertical, meaning it lights up all squares in its column, or horizontal, meaning it lights up all squares in its row.
The illustration below shows an example of a vertical (left) and a horizontal (right) lamp.

Unfortunately, they did not pay attention when installing the lamps and do not remember which lamps light up horizontally or vertically. Instead, they conduct some experiments to figure out which lamps to use to light up the whole room. Gerard stays in the room with the lamps, while Frederik operates the switches from another room.
In each experiment, Frederik turns each lamp on or off and Gerard reports how many squares are lit up in total; a square that is lit up by two or more separate lamps is only counted once. It does not matter how many lamps are turned on during the experiments, but they are in a rush and ideally want to conduct as few experiments as possible.
Help them find an arrangement of lamps that lights up the whole room and uses the fewest lamps. They can conduct at most experiments. However, you will get a higher score if they use fewer experiments.
제한
- .
- You can issue at most experiments (printing the final answer does not count as an experiment). If you exceed this, you will get the verdict "Wrong Answer".
예제
이 문제는 공개된 예제가 없습니다.