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;
    }
  • 相关阅读:
    SSO 单点登录
    CPU运行原理及对线程的影响01
    表单设计器
    Session 身份验证
    cookie 身份验证及跨域
    WebService 身份验证01_SoapHeader及 iis windows 集成身份验证
    WebService 代理类型
    WebService
    网络协议的理解 http、udp、tcp 等
    Container
  • 原文地址:https://www.cnblogs.com/dacc123/p/8228523.html
Copyright © 2011-2022 走看看