单点时限: 1.0 sec
内存限制: 512 MB
“Largest Rectangle in Histogram” problem is a classic problem. You are given an array of integers where each element represents the height of a bar in a histogram. A histogram is a graphical display of data using bars of different heights. The bars are placed in the exact same sequence as given in the array, and each of them has width 1. You need to find the area of the largest rectangle in the histogram.
But now Alice and Bob want to play a game on a histogram.They take alternating turns, and Alice is moving first.
Initially all cells are empty.During each turn, the player chooses three numbers:
You have to determine who wins if they both play optimally.
There are multiple test cases in this problem.(
In each test case,the first line contains one integer n denoting the width of histogram(
The second line contains n space-separated positive integers
For each test case print Emo:?
if Alice can win and lets see who is real evil genius
if Bob can win.
2 1 1 1 4 1 5 1 9 3 15 16 17 3 1000000 1 2
lets see who is real evil genius Emo:? Emo:? Emo:? Emo:? lets see who is real evil genius