zoukankan      html  css  js  c++  java
  • CodeForce 832A Sasha and Sticks

    A. Sasha and Sticks
    time limit per test2 seconds
    memory limit per test256 megabytes
    inputstandard input
    outputstandard output
    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.

    Input
    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.

    Output
    If Sasha wins, print “YES” (without quotes), otherwise print “NO” (without quotes).

    You can print each letter in arbitrary case (upper of lower).

    Examples
    input
    1 1
    output
    YES
    input
    10 4
    output
    NO

    #include <iostream>
    #include <math.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <string>
    #include <map>
    #include <stack>
    #include <queue>
    
    using namespace std;
    typedef long long int LL;
    LL k,n;
    int main()
    {
        scanf("%lld%lld",&k,&n);
        LL ans=k/n;
        if(ans&1)
            printf("YES
    ");
        else
            printf("NO
    ");
        return 0;
    }
  • 相关阅读:
    青云黄允松:2016年是云计算市场最关键的一年
    知道创宇CTO杨冀龙:网络安全人才决定行业格局
    su 与 su
    如何进入单用户模式(CentOS6.9)
    在虚拟机中还原GHO镜像系统
    安装CentOS 7 文字版
    把typora改为微软雅黑+Consolas
    使用python操作文件实现购物车程序
    使用python操作json文本文件
    资源下载网址集合
  • 原文地址:https://www.cnblogs.com/dacc123/p/8228523.html
Copyright © 2011-2022 走看看