标签:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 4813 Accepted Submission(s): 2894
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<stdlib.h> #include<queue> #include<stack> #include<algorithm> #include<ctype.h> #define LL __int64 using namespace std; const int MAXN=200000+50; const int MAX=50000+50; const int INF=0x3f3f3f3f; const double EPS=1e-9; int dir4[][2]={{0,1},{1,0},{0,-1},{-1,0}}; int dir8[][2]={{0,1},{1,1},{1,0},{1,-1},{0,-1},{-1,-1},{-1,0},{-1,1}}; int dir_8[][2]={{-2,1},{-1,2},{1,2},{2,1},{2,-1},{1,-2},{-1,-2},{-2,-1}}; int main() { int n,m; while(scanf("%d %d",&m,&n)!=EOF) { if(m<=n) { for(int i=m;i<=n;i++) { if(i==m) printf("%d",i); else printf(" %d",i); } printf("\n"); continue; } else if(m%(n+1)!=0) { int flag=0; for(int i=1;i<=n;i++) { if((m-i)%(n+1)==0) { if(flag==0) printf("%d",i); else printf(" %d",i); flag++; } } printf("\n"); } else printf("none\n"); } }
HDU 2149 Public Sale (巴什博弈+输出方案)
标签:
原文地址:http://www.cnblogs.com/clliff/p/4260208.html