There is really only one "move" in the game. Alice needs to decide who should go first. After that, both players are playing mechanically.
To decide who goes first, Alice finds the least X such that no subset of the available numbers adds up to X. Play will end on turn X, and Alice wants to be the one whose turn that is. So, if X is odd, Alice plays first; otherwise she lets Bob play first.
To easily determine X, Alice uses a Sieve. You're probably familiar with the Sieve of Eratosthenes, used to find primes. Same idea, but with different rules for a different purpose.
Alice writes down the numbers from 0 to the sum of all the numbers on the table, and crosses off 0. Then she takes numbers from the table, one at a time, without replacement. When she takes off the number Y, she crosses off every number that is Y plus some previously-crossed off number. When she has done this for every number on the table, the smallest un-crossed-off number is X.
Notice that this works even if the numbers on the table are not all distinct.
It even works if some of them are negative or zero, except that then Alice's initial list runs from the sum of the negative numbers thru the sum of the positive numbers, and X is the least positive un-crossed-off number.
Improved solution
Assume the numbers on the table are distinct positive integers.
If there were no missing numbers, any sum up to $S(N) = N(N+1)/2$ could easily be gotten, and X would be $S(N) = 1$.
But there are missing numbers. Let's start with an empty table, add numbers to it in increasing order, and after placing each number $n$ compute $S(n)$ = sum of all numbers on the table up to $n$. The question is, is it still true that a player could get any sum up to $S(n)$ from these numbers, assuming it was true for $S(n-1)$ before placing $n$.
Well, if $n \le S(n-1)+1$, then the answer is clearly yes. You could already get any sum up to $S(n-1)$ without using $n$. To get a sum $s$ where $S(n-1) \lt s \le S(n)$, combine $n$ with a combination summing to $s - n$ from the smaller numbers.
Conversely, if $n \gt S(n-1)+1$, then the answer is no. The sum $S(n-1)+1$ is unachievable without using $n$, because it exceeds the sum of the other numbers, and is also unachievable using $n$, because $n$ by itself is already too large.
And that leads to an obvious $O(N)$ algorithm to find X
X = 1
for n from 1 to N
break if n > X
X += n unless n is one of the missing numbers
end
return X
(I assume it's obvious how to do unless n is one of the missing numbers
in constant time, assuming they are given to us in ascending order.)
But if $K$ is much smaller than $N$ we can do better. Suppose we're given the missing numbers in ascending order. Then
MSUM = 0
for each missing number m
MSUM += m
X = m * (m + 1)/2 - MSUM + 1
return X if m >= X
end
return N * (N + 1)/2 - MSUM + 1
This runs in time $O(K)$.
Best Answer
I'll prove that the maximum $M\geq 2mn-m-n$.
A way to compute the sum is putting a stick that joins every pair of consecutive squares such that one of them has mine and the other hasn't. The number of sticks is equal to the sum of the numbers.
In a checkered board there are no diagonal sticks, but there is every possible vertical and horizontal stick. In each row, there are $m-1$ sticks, and in each column there are $n-1$ sticks. This makes
$$m(n-1)+n(m-1)=2mn-m-n$$
EDIT: This is not the maximum, as I thought. Suppose that there is an odd number $n$ of rows. Fill odd rows with mines and leave blank the even ones. If there is more than one column, the blanks in the border are filled with $4$'s and the rest with $6$'s. This makes $$6(m-2)\frac{n-1}2+2\cdot4\cdot\frac{n-1}2=3mn-3m-2n+2$$ which is greater than the other bound except for very small values of $m$ and $n$ (one-row or one-column boards and such).