标签:des style blog java color strong
4 2 3 2 3 5
1 none 3 4 5
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <string> #include <algorithm> #include <queue> using namespace std; const int maxn = 1100*2+10; int n,m; int SG[maxn]; int main(){ while(~scanf("%d%d",&m,&n)){ for(int i = m; i <= m+n-1; i++){ SG[i] = 1; } for(int i = m-1; i >= 1; i--){ int k = 0; for(int j = 1; j <= n; j++){ if(SG[i+j]==1){ k = 1; break; } } if(k==0) SG[i] = 1; else SG[i] = 0; // cout<<i<<" "<<SG[i]<<endl; } bool flag = 0; for(int i = 1; i <= n; i++){ if(SG[i]){ flag = 1; break; } } if(!flag){ cout<<"none"<<endl; continue; } flag = 0; for(int i = 1; i <= n; i++){ if(SG[i]){ if(flag) cout<<" "; cout<<i; flag = 1; } } cout<<endl; } return 0; }
HDU2149-Public Sale,布布扣,bubuko.com
标签:des style blog java color strong
原文地址:http://blog.csdn.net/mowayao/article/details/37053029