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