//  [7/23/2014 Sjm]

/*

对于此题,举出数据找规律,即可AC。。。

不过悲催的WA了好多次,后来发现竟把"YES"打印成"Yes"了。。。。

注释掉的代码是用来找规律的。。。

*/

 1 #include <iostream>
 2 #include <cstdlib>
 3 #include <cstdio>
 4 using namespace std;
 5 int k, p;
 6 /*
 7 int myget(int x, int y)
 8 {
 9     int sum = 1;
10     for (int i = 0; i < y; ++i) {
11         sum *= x;
12     }
13     return sum;
14 }
15
16 void Panduan(int p)
17 {
18     for (int k = 1; k <= 10; ++k) {
19         int sum = 0;
20         for (int i = 1; i < p; ++i) {
21             sum += myget(i, k);
22         }
23         printf("%d ", sum%p);
24     }
25 }
26 */
27 int main()
28 {
29     /*
30     while (cin >> p) {
31         Panduan(p);
32         cout << endl;
33     }
34     */
35
36     //freopen("input.txt", "r", stdin);
37     //freopen("output.txt", "w", stdout);
38     while (~scanf("%d %d", &k, &p)) {
39         int tep = k / (p - 1);
40         if (0 == tep % 2) {
41             printf("NO\n");
42         }
43         else {
44             printf("YES\n");
45         }
46     }
47     return 0;
48 }

转载于:https://www.cnblogs.com/shijianming/p/4140822.html

数学 之 hdu 4861相关推荐

  1. HDU 4861 Couple doubi

    /* HDU 4861 Couple doubi http://acm.hdu.edu.cn/showproblem.php?pid=4861打表找规律**/ #include <cstdio& ...

  2. 【数学】HDU 5761 Rower Bo

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 题目大意: 船在(0,a),船速v1,水速v2沿x轴正向,船头始终指向(0,0),问到达(0, ...

  3. 数学 之 hdu 4710 Balls Rearrangement

    // [7/31/2014 Sjm] /* 看到此题直接先打表找规律(数学很糟糕,不会用公式推,只好打表找规律) 发现循环周期 T = A和B的最小公倍数 于是依靠区间 [min(a, b), T] ...

  4. 2014多校第一场A题 || HDU 4861 Couple doubi

    题目链接 题意 : 有K个球,给你一个数P,可以求出K个值,(i=1,2,...,k) : 1^i+2^i+...+(p-1)^i (mod p).然后女朋友先取,再xp取,都希望赢,如果女朋友能赢输 ...

  5. 数学--数论--HDU - 6395 Let us define a sequence as below 分段矩阵快速幂

    Your job is simple, for each task, you should output Fn module 109+7. Input The first line has only ...

  6. 数学--数论--HDU 12151七夕节 Plus (因子和线性筛)

    Problem Description 七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!" ...

  7. 数学--数论--HDU - 6322 打表找规律

    In number theory, Euler's totient function φ(n) counts the positive integers up to a given integer n ...

  8. 数学--数论-- HDU 2601 An easy problem(约束和)

    Problem Description When Teddy was a child , he was always thinking about some simple math problems ...

  9. 数学--数论--HDU 6128 Inverse of sum (公式推导论)

    Description 给nn个小于pp的非负整数a1,-,na1,-,n,问有多少对(i,j)(1≤i<j≤n)(i,j)(1≤i<j≤n)模pp在意义下满足1ai+aj≡1ai+1aj ...

最新文章

  1. WCF创建到使用到发布
  2. Spark Metrics配置详解
  3. mybatis 做 insert操作的时候返回插入的那条数据的id
  4. java炸弹人素材_炸弹人图片_炸弹人模板_炸弹人设计素材下载
  5. 第二阶段个人博客总结7
  6. java 静态导入_Java中静态导入的使用
  7. c语言商品管理系统文件,c语言商品管理系统(文件应用).doc
  8. C/C++语言课程设计任务书
  9. JAVA输出100以内素数
  10. 【vue 四级联动】
  11. el-table render-header 实现多级 表头
  12. 电信专业人才选拔条件
  13. Retina屏图片适配
  14. Idea、pycharm、Phpstorm鼠标滑动设置字体大小方法
  15. Python如何批量把图片地址输入到浏览器上
  16. 2022年全球市场颈椎按摩仪总体规模、主要生产商、主要地区、产品和应用细分研究报告
  17. 简历制作 | 保研 | 考研复试
  18. 百趣代谢组学文献分享 | 建立基于代谢组学的ICU脓毒症患者预后预测模型
  19. 解释变量提升(预解析)
  20. 深度学习 效果不好怎么办

热门文章

  1. PAT——1027. 打印沙漏
  2. 数据库 数据库SQL语句五
  3. poj 1715 Hexadecimal Numbers 排列组合
  4. c#中Dictionary、ArrayList、Hashtable和数组 Array 的区别(转)
  5. html5 本地保存大数据库,HTML5本地储存 - jellydd的个人空间 - OSCHINA - 中文开源技术交流社区...
  6. x-shell 通过堡垒机连接 ssh多个机器 自动化脚本
  7. vue实现监听滚动条
  8. Error: Cannot find module 'webpack-cli'--解决方案
  9. Android textview 获取url,获取电话号码
  10. hapi和typescript构建项目(正在更新中)