HDU - 2149 - Public Sale (巴什博弈)


题目传送:Public Sale


思路:巴什博弈


AC代码:

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <cctype>
#define LL long long
#define INF 0x7fffffff
using namespace std;

int n, m;

int main() {
	while(scanf("%d %d", &m, &n) != EOF) {
		if(n >= m) {
			for(int i = m; i < n; i ++) {
				printf("%d ", i);
			}
			printf("%d\n", n);
		}
		else {
			if(m % (n + 1) == 0) {
				printf("none\n");
			}
			else {
				printf("%d\n", m % (n + 1));
			}
		}
	}
	return 0;
}














你可能感兴趣的:(ACM,HDU,博弈)