找规律 hdu4861 Couple doubi

对于这种数据非常大的,如果一下子推不出公式,基本上都是找规律


我们可以按照题意,将k个球的权值全部算出来,然后排序,然后分奇偶性累加在一起进行比较


然后大量的测试输出我们就很容易的可以找到规律了

#include<cstdio>
#include<cmath>
#include<cstring>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>

using namespace std;
typedef long long LL;

const int MX = 1000 + 5;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;

LL k, p;
int main() {
    while(~scanf("%I64d%I64d", &k, &p)) {
        LL w = k / (p - 1);
        printf("%s\n", w % 2 ? "YES" : "NO");
    }
    return 0;
}



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值