http://acm.hdu.edu.cn/showproblem.php?pid=4861

两个人进行游戏,桌上有k个球,第i个球的值为1^i+2^i+⋯+(p−1)^i%p,两个人轮流取,如果DouBiNan的值大的话就输出YES,否则输出NO。

hdu 4861

#include<iostream>
#include<cstdio>
using namespace std;

int main()
{
    int k,p,l;
    while(~scanf("%d%d",&k,&p)){
        l=k/(p-1);
        if (l%2==0) puts("NO");
        else puts("YES");
    }

    return 0;
}


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2021-08-04
  • 2021-06-25
相关资源
相似解决方案