2014---多校训练一(A Couple doubi)
Couple doubi
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1087 Accepted Submission(s): 762
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”.
In the first line there are two Integers k and p(1<k,p<2^31).
20 3
NO

#include<stdio.h>
void main(){
int k,p;
while(~scanf("%d%d",&k,&p))
k/=(p-),puts(k&)?"YES":"NO");
}
2014---多校训练一(A Couple doubi)的更多相关文章
- hdu 4911 Inversion(归并排序求逆序对数)2014多校训练第5场
Inversion Time Limit: 20 ...
- hdu 4970 Killing Monsters(数组的巧妙运用) 2014多校训练第9场
pid=4970">Killing Monsters ...
- 2014暑假ACM训练总结
2014暑假ACM训练总结报告 匆匆之中,一个暑假又过去了,在学校训练的这段日子真的是感觉日子过得好快啊! 时光如箭,日月如梭! 匆忙的学习之中一个暑假就这样结束了,现在就来写一些总结吧,供自己以后阅 ...
- HDU6578 2019HDU多校训练赛第一场 1001 (dp)
HDU6578 2019HDU多校训练赛第一场 1001 (dp) 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6578 题意: 你有n个空需要去填,有 ...
- HDU6579 2019HDU多校训练赛第一场1002 (线性基)
HDU6579 2019HDU多校训练赛第一场1002 (线性基) 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6579 题意: 两种操作 1.在序列末 ...
- HDU6621 K-th Closest Distance HDU2019多校训练第四场 1008(主席树+二分)
HDU6621 K-th Closest Distance HDU2019多校训练第四场 1008(主席树+二分) 传送门:http://acm.hdu.edu.cn/showproblem.php? ...
- HDU 4869 Turn the pokers (2014多校联合训练第一场1009) 解题报告(维护区间 + 组合数)
Turn the pokers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- HDU 4902 Nice boat 2014杭电多校训练赛第四场F题(线段树区间更新)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4902 解题报告:输入一个序列,然后有q次操作,操作有两种,第一种是把区间 (l,r) 变成x,第二种是 ...
- 2014多校第一场A题 || HDU 4861 Couple doubi
题目链接 题意 : 有K个球,给你一个数P,可以求出K个值,(i=1,2,...,k) : 1^i+2^i+...+(p-1)^i (mod p).然后女朋友先取,再xp取,都希望赢,如果女朋友能赢输 ...
随机推荐
- MySql中使用日期函数获取昨天的数据
.body-classic{ color:#444; font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Rom ...
- [UVa1213]Sum of Different Primes(递推,01背包)
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...
- [c/c++]linux下使用c/c++操作mysql
首先需要安装相应的库文件,直接apt-get就可以. sudo apt-get install libmysqlclient-dev 编译的时候,需要额外链接到这个库.如果是apt-get安装的话,那 ...
- Python入门-多行语句
1. Python语句中一般以新行作为为语句的结束符. 但是我们可以使用斜杠( \)将一行的语句分为多行显示. 2. 语句中包含[], {} 或 () 括号就不需要使用多行连接符. days = [' ...
- 移动端图表插件jChart.js的修改
bug1: 折线图,设置datasetGesture : true时,Y轴的刻度值居然会变.会变也就算了,居然没地方设置不能变. bug2: 折线图,设置tap.point事件,和datasetGes ...
- nyoj325 zb的生日(DFS)
zb的生日 时间限制:3000 ms | 内存限制:65535 KB 难度:2 描述 今天是阴历七月初五,acm队员zb的生日.zb正在和C小加.never在武汉集训.他想给这两位兄弟买点什么 ...
- Scrum Meeting---Eight(2015-11-3)
今日已完成任务和明日要做的任务 姓名 今日已完成任务 今日时间 明日计划完成任务 估计用时 董元财 数据库与客户端通讯 5h 服务器与客户端通讯测试 4h 胡亚坤 好友添加 2h 好友添加 2h 刘猛 ...
- poj1584A Round Peg in a Ground Hole
链接 题意甚是难懂!这是第二遍做这道题了,依旧无法理解题意,搜了下题意... 首先需要判断是不是为凸多边形.(从一个顶点走一遍即可,要注意顺逆时针,题目中没有指明) 其次看一下圆是不是能够放入多边形内 ...
- poj1696Space Ant(逆时针螺旋形)
链接 贪心做法,没次找最外面的点,也就是相对前面那条线偏转角度最小的点,除第一个点需要找到最下面的点即Y坐标最小,其余的每次进行极角排序. #include <iostream> #inc ...
- Python SSH登陆--pexpect,pxssh
from pexpect import pxssh host = '192.168.80.139'user = 'allen'password = 'allen'command = 'df -h' d ...