zoukankan      html  css  js  c++  java
  • hdoj 2149 Public Sale

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2149

    解题思路:典型的巴什博弈(巴什博弈:http://www.cnblogs.com/linqiuwei/p/3227146.html

     1 ///////////////////////////////////////////////////////////////////////////
     2 //problem_id: hdoj 2149
     3 //user_id: SCNU20102200088
     4 ///////////////////////////////////////////////////////////////////////////
     5 
     6 #include <algorithm>
     7 #include <iostream>
     8 #include <iterator>
     9 #include <iomanip>
    10 #include <cstring>
    11 #include <cstdlib>
    12 #include <string>
    13 #include <vector>
    14 #include <cstdio>
    15 #include <cctype>
    16 #include <cmath>
    17 #include <queue>
    18 #include <stack>
    19 #include <list>
    20 #include <set>
    21 #include <map>
    22 using namespace std;
    23 
    24 ///////////////////////////////////////////////////////////////////////////
    25 typedef long long LL;
    26 const double EPS=1e-8;
    27 const double PI=acos(-1.0);
    28 
    29 const int x4[]={-1,0,1,0};
    30 const int y4[]={0,1,0,-1};
    31 const int x8[]={-1,-1,0,1,1,1,0,-1};
    32 const int y8[]={0,1,1,1,0,-1,-1,-1};
    33 
    34 typedef int T;
    35 T max(T a,T b){ return a>b? a:b; }
    36 T min(T a,T b){ return a<b? a:b; }
    37 ///////////////////////////////////////////////////////////////////////////
    38 
    39 ///////////////////////////////////////////////////////////////////////////
    40 //Add Code:
    41 ///////////////////////////////////////////////////////////////////////////
    42 
    43 int main(){
    44     ///////////////////////////////////////////////////////////////////////
    45     //Add Code:
    46     int n,m,i;
    47     while(scanf("%d%d",&n,&m)!=EOF){
    48         if(n%(m+1)==0) printf("none
    ");
    49         else{
    50             if(n>m) printf("%d
    ",n%(m+1));
    51             else{
    52                 printf("%d",n);
    53                 for(i=n+1;i<=m;i++) printf(" %d",i);
    54                 printf("
    ");
    55             }
    56         }
    57     }
    58     ///////////////////////////////////////////////////////////////////////
    59     return 0;
    60 }
    61 
    62 ///////////////////////////////////////////////////////////////////////////
    63 /*
    64 Testcase:
    65 Input:
    66 4 2
    67 3 2
    68 3 5
    69 Output:
    70 1
    71 none
    72 3 4 5
    73 */
    74 ///////////////////////////////////////////////////////////////////////////
  • 相关阅读:
    java高并发
    阿里网盘挂载到本地主机
    frp突破内网ip限制教程
    docker学习总结(流水线、redis集群、网络待)
    git\svn提交记录规范
    【寻径06】如何突破学习瓶颈学习笔记
    leetcode 每日一题解题859. 亲密字符串
    字符串格式的json字符串转换为json格式的字符串
    如何使用github发布自己的静态项目
    软考第一课总结考前介绍(1)
  • 原文地址:https://www.cnblogs.com/linqiuwei/p/3286251.html
Copyright © 2011-2022 走看看