hdu 2149Public Sale(博弈论 巴什博奕)

hdu 2149题目链接

题意&思路:巴什博奕,点m是n点。。。然后往前画即可。。。

/*************************************************************************
	> File Name: code/hdu/2149.cpp
	> Author: 111qqz
	> Email: rkz2013@126.com 
	> Created Time: 2015年09月22日 星期二 20时18分02秒
 ************************************************************************/
 1#include<iostream>
 2#include<iomanip>
 3#include<cstdio>
 4#include<algorithm>
 5#include<cmath>
 6#include<cstring>
 7#include<string>
 8#include<map>
 9#include<set>
10#include<queue>
11#include<vector>
12#include<stack>
13#include<cctype>
14#define y1 hust111qqz
15#define yn hez111qqz
16#define j1 cute111qqz
17#define ms(a,x) memset(a,x,sizeof(a))
18#define lr dying111qqz
19using namespace std;
20#define For(i, n) for (int i=0;i<int(n);++i)  
21typedef long long LL;
22typedef double DB;
23const int inf = 0x3f3f3f3f;
24int n,m;
25int main()
26{
27  #ifndef  ONLINE_JUDGE 
28   freopen("in.txt","r",stdin);
29  #endif
30    while (scanf("%d %d",&m,&n)!=EOF) 
31    {
32	if (m<n+1)
33	{
34	    printf("%d",m);
35	    for ( int i = m+1 ; i <= n; i++)
36		printf(" %d",i);
37	    printf("\n");
38	    continue;
39	}
40	int tmp = m%(n+1);
41	if (tmp>0)
42	{
43	    printf("%d\n",tmp);
44	}
45	else
46	{
47	    puts("none");
48	}
    }
1 #ifndef ONLINE_JUDGE  
2  fclose(stdin);
3  #endif
4	return 0;
5}