链接:

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. Mysql 5.8安装报错

    1 mysql安装过程中报下面这个错 解决方法:只要将目录改成反斜杠即可. 2 修改密码错误:ERROR 1064 (42000): You have an error in your SQL syn ...

  2. Spring,Hibernate 集成解决多hbm.xml文件繁多的方案

    开发一个大一点的项目有很多的hbm.xml文件,有时候上百个也不稀奇,如果用 <property name="mappingLocations"> <list&g ...

  3. git cherry-pick基本使用

    git cherry-pick可以选择某一分支中的一个或几个commit来进行操作--commit 使用场景: 稳定版本分支1与开发版本分支2,不能直接把两个分支合并,否则会导致版本混乱,要将分支2中 ...

  4. 第八章 高级搜索树 (a1)伸展树:逐层伸展

  5. java的字典排序

    按照教程上的代码还是报错 应该是字典排序的问题,不能是Arrays.sort()

  6. TZOJ 1840 Jack Straws(线段相交+并查集)

    描述 In the game of Jack Straws, a number of plastic or wooden "straws" are dumped on the ta ...

  7. js switch case注意事项

    今天写switch的时候发现没有达到预期效果,参照w3school的写法发现语法一致 想了一下,js是弱类型语言,是不是不支持number?试了一下将数字改为字符串,果然可以了 或者可以这样写:swi ...

  8. iOS 11 scroll滚动偏移,tableview偏移44,获取view的宽和高

    1. tableview 的头部 有44的偏移量 1>.设置 tableview的 属性 tableView.scrollIndicatorInsets = UIEdgeInsets.zero ...

  9. TextView UI美化-------自适应字体控件

    http://www.cnblogs.com/psuwgipgf/p/4874158.html 一. TextView字体随大小变化自适应TextView 实现依靠于第三方类库 第三方类来源: htt ...

  10. java里的静态成员变量是放在了堆内存还是栈内存

    转自http://bbs.csdn.NET/topics/370001490 堆区: 1.存储的全部是对象,每个对象都包含一个与之对应的class的信息.(class的目的是得到操作指令) 2.jvm ...