解题报告
两人轮流取球,大的人赢,,,
贴官方题解,,,反正我看不懂。,,先留着理解

找规律找到的,,,sad,,,
非常easy找到循环节为p-1,每个循环节中有一个非零的球。所以仅仅要推断有多少完整循环节。在推断奇偶,。,
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath> using namespace std; int main()
{
int k,p,i,j;
while(scanf("%d%d",&k,&p)!=EOF){
int q=k/(p-1);
if(q%2==0)
printf("NO\n");
else printf("YES\n");
}
return 0;
}

Couple doubi

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)

Total Submission(s): 145    Accepted Submission(s): 122

Problem Description
DouBiXp has a girlfriend named DouBiNan.One day they felt very boring and decided to play some games. The rule of this game is as following. There are k balls on the desk. Every ball has a value and the value of ith (i=1,2,...,k) ball is 1^i+2^i+...+(p-1)^i
(mod p). Number p is a prime number that is chosen by DouBiXp and his girlfriend. And then they take balls in turn and DouBiNan first. After all the balls are token, they compare the sum of values with the other ,and the person who get larger sum will win
the game. You should print “YES” if DouBiNan will win the game. Otherwise you should print “NO”.
 
Input
Multiply Test Cases. 

In the first line there are two Integers k and p(1<k,p<2^31).
 
Output
For each line, output an integer, as described above.
 
Sample Input
2 3
20 3
 
Sample Output
YES
NO
 
Source

2014 Multi-University Training Contest 1/HDU4861_Couple doubi(数论/法)的更多相关文章

  1. 2019 Multi-University Training Contest 1 - 1011 - Function - 数论

    http://acm.hdu.edu.cn/showproblem.php?pid=6588 新学到了一个求n以内与m的gcd的和的快速求法.也就是下面的S1. ①求: $ \sum\limits_{ ...

  2. HDU4888 Redraw Beautiful Drawings(2014 Multi-University Training Contest 3)

    Redraw Beautiful Drawings Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Jav ...

  3. hdu 4946 2014 Multi-University Training Contest 8

    Area of Mushroom Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) ...

  4. 2014 Multi-University Training Contest 9#11

    2014 Multi-University Training Contest 9#11 Killing MonstersTime Limit: 2000/1000 MS (Java/Others)   ...

  5. 2014 Multi-University Training Contest 9#6

    2014 Multi-University Training Contest 9#6 Fast Matrix CalculationTime Limit: 2000/1000 MS (Java/Oth ...

  6. 2014 Multi-University Training Contest 1/HDU4864_Task(贪心)

    解题报告 题意,有n个机器.m个任务. 每一个机器至多能完毕一个任务.对于每一个机器,有一个最大执行时间Ti和等级Li,对于每一个任务,也有一个执行时间Tj和等级Lj.仅仅有当Ti>=Tj且Li ...

  7. hdu 4937 2014 Multi-University Training Contest 7 1003

    Lucky Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) T ...

  8. hdu 4941 2014 Multi-University Training Contest 7 1007

    Magical Forest Time Limit: 24000/12000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Other ...

  9. hdu 4939 2014 Multi-University Training Contest 7 1005

    Stupid Tower Defense Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/ ...

随机推荐

  1. HttpClient使用具体解释

    Http协议的重要性相信不用我多说了,HttpClient相比传统JDK自带的URLConnection,添加�了易用性和灵活性(详细差别,日后我们再讨论),它不仅是client发送Http请求变得e ...

  2. springmvc+mongodb+maven 项目测试代码

    你看我有一篇文章配置,或许还会有.mongodb性能测试结果.一个"快"字 源代码包,请留下邮箱 代码结构图 watermark/2/text/aHR0cDovL2Jsb2cuY3 ...

  3. 设计师给了px显着的单位,Android要设置多少开发商dip、dp、sp?

    此链接    http://blog.csdn.net/xiaodongrush/article/details/29560431 1. 要开发一款Android APP,设计师和开发要约定哪些事情? ...

  4. sublime配置攻略

    大家好,今天给大家分享的编辑器:sublime text2     我用过非常多编辑器, EditPlus.EmEditor.Notepad++.Notepad2.UltraEdit.Editra.V ...

  5. HIPO图

    HIPO图(Hierarchy Plus Input/Processing/Output)是表示软件结构的一种图形工具.以模块分解的层次性以及模块内部输入.处理.输出三大基本部分为基础建立的.它由两部 ...

  6. android传感器;摇抽奖功能

    package com.kane.sensortest; import java.util.Random; import android.hardware.Sensor; import android ...

  7. Agile/CMMI/Scrum

    Agile/CMMI/Scrum 一.背景介绍 在朋友(aehyok)的建议下,初步去了解Visual Studio Online,简称VS Online(即原来的 Team Foundation S ...

  8. 【Android进阶】关于PagerAdapter的使用方法的总结

    PagerAdapter简介 PagerAdapter是android.support.v4包中的类,它的子类有FragmentPagerAdapter, FragmentStatePagerAdap ...

  9. web项目启动,运行方法

    1.显示器(Listener) web文件加入 <listener>      <listener-class>cn.ro.common.InitListener</li ...

  10. 什么是PV,UV。

    PV浏览(Page View).该网页访问量,每次页面打开PV统计+1,也刷新. IP接入号码指独立IP接入号码,计算基于独立IP在计算的时间段来计算访问我们的网站1二级IP接入号码. 是否这个计算在 ...