codeforces 832A ——Sasha and Sticks
来源:互联网 发布:长沙哪里有学美工的 编辑:程序博客网 时间:2024/05/21 21:45
It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day he invents some game and plays in it alone or with friends.
Today he invented one simple game to play with Lena, with whom he shares a desk. The rules are simple. Sasha draws n sticks in a row. After that the players take turns crossing out exactly k sticks from left or right in each turn. Sasha moves first, because he is the inventor of the game. If there are less than k sticks on the paper before some turn, the game ends. Sasha wins if he makes strictly more moves than Lena. Sasha wants to know the result of the game before playing, you are to help him.
The first line contains two integers n and k (1 ≤ n, k ≤ 1018, k ≤ n) — the number of sticks drawn by Sasha and the number k — the number of sticks to be crossed out on each turn.
If Sasha wins, print "YES" (without quotes), otherwise print "NO" (without quotes).
You can print each letter in arbitrary case (upper of lower).
1 1
YES
10 4
NO
In the first example Sasha crosses out 1 stick, and then there are no sticks. So Lena can't make a move, and Sasha wins.
In the second example Sasha crosses out 4 sticks, then Lena crosses out 4 sticks, and after that there are only 2 sticks left. Sasha can't make a move. The players make equal number of moves, so Sasha doesn't win.
#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<queue>#include<algorithm>using namespace std;typedef long long int ll;int main(){ ll n,k; scanf("%I64d%I64d",&n,&k); ll a=n/k; if(a%2==0) printf("NO\n"); else printf("YES\n"); return 0;}
- codeforces 832A ——Sasha and Sticks
- Sasha and Sticks (Codeforces 832A)
- codeforces 832A Sasha and Sticks
- Codeforces Round #425 A. Sasha and Sticks
- Sasha and Sticks CodeForces
- A. Sasha and Sticks
- CodeForce 832A Sasha and Sticks
- Codeforces Round #425 (Div. 2)A. Sasha and Sticks
- Codeforces Round #425 (Div. 2) A.Sasha and Sticks
- Codeforces Round #425 (Div. 2) A. Sasha and Sticks
- Codeforces Round #425 (Div. 2) A. Sasha and Sticks
- Codeforces832A Sasha and Sticks
- cf round425A. Sasha and Sticks
- codeforces——A. Counting Sticks
- A. MUH and Sticks(Codeforces Round #269)
- codeforces 471A MUH and Sticks
- Codeforces 718C C. Sasha and Array
- codeforces 718 C.Sasha and Array
- ExtJs+Hibernate+SpringMVC 批量删除
- json字符串的逐层解析
- 守护进程详解
- RabbitMQ概述和安装
- ACM零起点2017-7-25(sort用重载运算符对结构体排序)
- codeforces 832A ——Sasha and Sticks
- ios用dsym文件和crash文件解析crash
- 重新学c(三)
- 仿小米商城-选择商品功能-出现对号
- Java菜鸟学习日记17
- 在JSP页面中调用Spring容器注入的Bean的2种方法
- MEF学习
- Activation Function
- [牛客网]错题整理(6)