链接:

http://codeforces.com/problemset/problem/570/B

http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87813#problem/I

代码:

#include<stdio.h>
#include<string.h> #define N 1100 int main()
{
int n, m;
while(scanf("%d%d", &n, &m)!=EOF)
{
if(n==) ///只有1,他只能输了
{
printf("1\n");
continue;
}
if(m>n/)
printf("%d\n", m-);
else
printf("%d\n", m+);
}
return ;
}

(博弈)Simple Game --codeforces--570B的更多相关文章

  1. A Simple Task CodeForces - 11D

    A Simple Task CodeForces - 11D 题意:输出一个无向图的简单环数量.简单环指无重复边的环.保证图无重边自环. ans[i][j]表示"包含i中的点,以i中第一个点 ...

  2. CodeForces 570B Simple Game 概率

    原题: http://codeforces.com/contest/570/problem/B 题目: Simple Game time limit per test1 second memory l ...

  3. B - Simple Game

    B - Simple Game Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Su ...

  4. ACM训练赛:第20次

    这次的题思维都很强,等之后的考试结束会集中精力重新训练一些思维题. A - A simple question CodeForces - 520B 思路: 直接看的话,很容易发现如果 \(n > ...

  5. Codeforces Round #316 (Div. 2B) 570B Simple Game 贪心

    题目:Click here #include <bits/stdc++.h> using namespace std; typedef long long ll; const int IN ...

  6. 计数排序 + 线段树优化 --- Codeforces 558E : A Simple Task

    E. A Simple Task Problem's Link: http://codeforces.com/problemset/problem/558/E Mean: 给定一个字符串,有q次操作, ...

  7. HDU 5795 A Simple Nim (博弈 打表找规律)

    A Simple Nim 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5795 Description Two players take turns ...

  8. Codeforces 455B A Lot of Games(字典树+博弈)

    题目连接: Codeforces 455B A Lot of Games 题目大意:给定n.表示字符串集合. 给定k,表示进行了k次游戏,然后是n个字符串.每局開始.字符串为空串,然后两人轮流在末尾追 ...

  9. Codeforces 626E Simple Skewness(暴力枚举+二分)

    E. Simple Skewness time limit per test:3 seconds memory limit per test:256 megabytes input:standard ...

  10. Codeforces 558E A Simple Task (计数排序&&线段树优化)

    题目链接:http://codeforces.com/contest/558/problem/E E. A Simple Task time limit per test5 seconds memor ...

随机推荐

  1. Python使用Threading模块创建线程

    使用Threading模块创建线程,直接从threading.Thread继承,然后重写__init__方法和run方法: #!/usr/bin/python # -*- coding: UTF-8 ...

  2. scala -- 递归 实现 斐波那契函数

    求一个起始为0,1,1,2,3的斐波那契序列 def main(args: Array[String]): Unit = { def fib(n: Int): Int = { if (n == 1) ...

  3. 登陆sharepoint的主页,提示:文件存在(异常来自 HRESULT:0x80070050)

    用sharepoint搭建了Project2007的服务器之后,由于我们公司管理域的服务器崩溃了,必须重新再加一次域,而域和服务器是关联的,即使域的名字一样,但该名字所对应的ID是不一样的,会导致一些 ...

  4. pyplot图像组件

    pyplot图像组件 ax子对象的组件内容 Title 图表标题 plt.title() Axis 坐标范围,x轴,y轴 plt.axis() label 坐标轴标注 plt.xlabel() plt ...

  5. hadoop 官方配置文件解析

    比如我的版本是2.8.4 官网文档是: http://hadoop.apache.org/docs/r2.8.4/ 基本配置文件:包括一般的端口 hdfs-default.xml dfs.nameno ...

  6. EasyUI 修改

    <script type="text/javascript"> <!-- js --> /*=============================修改对 ...

  7. 通过NBU还原数据库提示LINKING异常,无法恢复数据

    错误提示: 解决方法:

  8. 自己整理lnmp安装

    1. 操作系统   CentOS release 6.5(final)   2. 安装mysql   # yum install mysql-server   #vi /etc/my.cnf +def ...

  9. php多进程 防止出现僵尸进程

    对于用PHP进行多进程并发编程,不可避免要遇到僵尸进程的问题. 僵尸进程是指的父进程已经退出,而该进程dead之后没有进程接受,就成为僵尸进程(zombie)进程.任何进程在退出前(使用exit退出) ...

  10. 表单数据转换成json格式数据

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...