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;
    }
  • 相关阅读:
    汇编指令(它不区分大小写)
    汇编
    LINUX命令
    LInux 终端命令
    回文串的Manacher算法
    hdu3336 Counting the string kmp的next数组的应用
    hdu2203kmp匹配
    hdu2087kmp模板练习
    hdu1171kmp果题
    hdu1686kmp果题
  • 原文地址:https://www.cnblogs.com/dacc123/p/8228523.html
Copyright © 2011-2022 走看看