题目链接:http://codeforces.com/contest/832/problem/A
题意:有n个棍子,两个人轮流取这些棍子,每个人每次只能去恰好k个棍子(不足k个则不能取),问先手取的棍子数目是否比后手多?
思路:水题。
#define _CRT_SECURE_NO_DEPRECATE #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<string> #include<queue> #include<vector> #include<time.h> #include<cmath> using namespace std; typedef long long int LL; const int MAXN = 3e5 + 24; const int INF = 0x3f3f3f3f; const int mod = 1e9 + 7; int main(){ //#ifdef kirito // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); //#endif LL n, k; while (~scanf("%I64d%I64d",&n,&k)){ LL res = n / k; printf(res % 2 ? "YES " : "NO "); } return 0; }