2014 Multi-University Training Contest 1/HDU4861_Couple doubi(数论/法)
解题报告
两人轮流取球,大的人赢,,,
贴官方题解,,,反正我看不懂。,,先留着理解

找规律找到的,,,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;
- }
- #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
(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).
2 3 20 3
YES NO
2014 Multi-University Training Contest 1/HDU4861_Couple doubi(数论/法)的更多相关文章
- 2019 Multi-University Training Contest 1 - 1011 - Function - 数论
http://acm.hdu.edu.cn/showproblem.php?pid=6588 新学到了一个求n以内与m的gcd的和的快速求法.也就是下面的S1. ①求: $ \sum\limits_{ ...
- 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 ...
- 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) ...
- 2014 Multi-University Training Contest 9#11
2014 Multi-University Training Contest 9#11 Killing MonstersTime Limit: 2000/1000 MS (Java/Others) ...
- 2014 Multi-University Training Contest 9#6
2014 Multi-University Training Contest 9#6 Fast Matrix CalculationTime Limit: 2000/1000 MS (Java/Oth ...
- 2014 Multi-University Training Contest 1/HDU4864_Task(贪心)
解题报告 题意,有n个机器.m个任务. 每一个机器至多能完毕一个任务.对于每一个机器,有一个最大执行时间Ti和等级Li,对于每一个任务,也有一个执行时间Tj和等级Lj.仅仅有当Ti>=Tj且Li ...
- 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 ...
- 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 ...
- 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/ ...
随机推荐
- oracle查询和编写数据字典
在项目交付时假设须要编写数据字典,能够採用以下的方法.首先执行以下的sql语句 SELECT A.TABLE_NAME AS 表名, A.COLUMN_NAME AS 字段名, DECODE(A.CH ...
- Blend4精选案例图解教程(一):丰富的形状(Shape)资源
原文:Blend4精选案例图解教程(一):丰富的形状(Shape)资源 Blend4资源面板中内置了丰富的形状素材,为我们在构建程序时提供极大的方便.系统默认内置18种常用形状,通过其属性设置可以自定 ...
- android下调试声卡驱动之概述
在Android中音频系统使用的是ALSA系统架构.ASoC--ALSA System on Chip .是建立在标准ALSA驱动层上,为了更好地支持 嵌入式处理器和移动设备中的音频Codec的一套软 ...
- Mybatis深入之事务管理
Mybatis之事务管理 简单介绍 Mybatis的事务管理分为两种JdbcTransaction.ManagedTransaction. 当中JdbcTransaction仅仅是对数据库连接Conn ...
- HDU 2845 Beans (动态调节)
Beans Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Subm ...
- [ACM] poj 3468 A Simple Problem with Integers(段树,为段更新,懒惰的标志)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 55273 ...
- Principle使用教程
本次分享主要有以下几点内容: 1.初识界面2.两个关键操作3.案例一:滑动4.案例二:点击跳转 5.案例三:跟随动画(抽屉效果) 1初识界面Principle的界面与Sketch基本一致,如下图: a ...
- VS2015企业版本(安装包+key)
VS2015中文企业版: http://pan.baidu.com/s/1eQtWvNs VS2015英文企业版: http://pan.baidu.com/s/1i3gZaVN —————————— ...
- Codeforces Round #234 (Div. 2) B. Inna and New Matrix of Candies
B. Inna and New Matrix of Candies time limit per test 1 second memory limit per test 256 megabytes i ...
- HDU 1711 Number Sequence(算法验证)
该怎么做.每一个人的人生都应该自己掌握.你给不了别人一切.你也不懂别人的忧伤. 微笑不代表快乐.哭泣不一定悲伤 不努力怎么让关心你的人幸福.不努力怎么让看不起你的人绝望. 我用生命在奋斗--lx_Zz ...