HDU 4861(多校)1001 Couple doubi】的更多相关文章

Couple doubi Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4861 Description DouBiXp has a girlfriend named DouBiNan.One day they felt very boring and decided to play some games. The rule of th…
题目链接:hdu 4861 Couple doubi 题目大意:两个人进行游戏,桌上有k个球,第i个球的值为1i+2i+⋯+(p−1)i%p,两个人轮流取,假设DouBiNan的值大的话就输出YES,否则输出NO. 解题思路: 首先是DouBiNan先取,所以肯定优先选取剩余中值最大的,于是不存在说DouBiNan值小的情况,仅仅有大于和小于. 然后,对于val(i)=1i+2i+⋯+(p−1)i%p来说,仅仅有当i=ϕ(p)=p−1(p为素数)时,val(i)=p−1,其它情况下val(i)=…
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)…
题目链接 题意 : 有K个球,给你一个数P,可以求出K个值,(i=1,2,...,k) : 1^i+2^i+...+(p-1)^i (mod p).然后女朋友先取,再xp取,都希望赢,如果女朋友能赢输出YES,否则输出NO 思路 :这个题,在纸上算算差不多就出来结果了,因为要赢,所以一开始必定拿大的,根据规律可以发现最后的那个取余结果不是0就是某个数,所以就看那个数有奇数个还是偶数个即可. 官方题解: #include <stdio.h> #include <string.h> #…
Couple doubi 题目链接: http://acm.hust.edu.cn/vjudge/contest/121334#problem/D 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 th…
题目链接 可以瞎搞一下,找找规律 题意:两个人进行游戏,桌上有k个球,第i个球的值为1i+2i+⋯+(p−1)i%p,两个人轮流取,如果DouBiNan的值大的话就输出YES,否则输出NO. 分析:解题报告 #include <cstdio> #include <iostream> using namespace std; int main() { int k, p; while(cin>>k>>p) { )&) cout<<"…
http://acm.hdu.edu.cn/showproblem.php?pid=4861 两个人进行游戏,桌上有k个球,第i个球的值为1^i+2^i+⋯+(p−1)^i%p,两个人轮流取,如果DouBiNan的值大的话就输出YES,否则输出NO. #include<iostream> #include<cstdio> using namespace std; int main() { int k,p,l; while(~scanf("%d%d",&k…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5753 Sample Input Sample Output 6.000000 52.833333 分析:??? #include<stdio.h> #include<string.h> #include<math.h> #include<queue> #include<algorithm> #include<time.h> using n…
First One Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 672    Accepted Submission(s): 193 Problem Description soda has an integer array a1,a2,-,an. Let S(i,j) be the sum of ai,ai+1,-,aj. N…
http://acm.hdu.edu.cn/showproblem.php?pid=6045 题解:遍历一遍,求出两个人答案中相同的个数,用wa表示.然后我从大的数入手,当wa的数都尽可能在两个人答案的相同部分时,另一个人的答案中对的个数最小:当wa的数尽可能在两者答案不同的部分的时候,另一个人的答案对的个数最多. ac代码: #include <cstdio> #include <iostream> #include <queue> using namespace s…