码迷,mamicode.com
首页 >  
搜索关键字:poj2886    ( 8个结果
POJ_2886 Who Gets the Most Candies? 【二分+树状数组】
一、题目 POJ2886 二、分析 这个题目吧,开始没读懂,做的时候也没懂,WA的时候懂了。假设是第p个出圈的人有一个对应的因子个数$F(p)$,那么,题目求的就是这个$F(p)$最大的对应的人。 1.首先要对所有$F(p)$值进行预处理打表。因为多次询问。 2.每次都会有一个人出圈,那么为了能够每 ...
分类:编程语言   时间:2019-03-15 14:40:18    阅读次数:169
[POJ2886]Who Gets the Most Candies?
题目:Who Gets the Most Candies? 链接:http://poj.org/problem?id=2886 分析: 1)这是一个约瑟夫环,关键在于如何定位下一个位置。如同楼层没有0层一样,针对card需要分正负讨论,计算出在新环中下一个离开的位置k。 2)求出k在原环中的位置。采 ...
分类:其他好文   时间:2019-02-02 10:22:07    阅读次数:197
poj2886 Who Gets the Most Candies?
思路: 先打反素数表,即可确定因子最多的那个数。然后模拟踢人的过程确定对应的人名。模拟的过程使用线段树优化加速。 实现: ...
分类:其他好文   时间:2018-02-22 23:08:23    阅读次数:251
[POJ 2886] Who Gets the Most Candies?
Description N children are sitting in a circle to play a game. The children are numbered from 1 to N in clockwise order. Each of them has a card with ...
分类:其他好文   时间:2017-09-03 23:36:53    阅读次数:172
(线段树,反素数)poj2886-Who Gets the Most Candies?
N children are sitting in a circle to play a game. The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero i ...
分类:其他好文   时间:2017-02-17 17:01:46    阅读次数:297
poj2886--Who Gets the Most Candies?(线段树+反素数)
题目链接点击打开链接 题目大意:给出n个人的姓名和手里的一个号码,n个人排成一圈,号码有正有负,代表着正向还是反向移动k个位置,比赛从第k个人开始,把被选到的人踢出,问按踢出的顺序中因子数最多的是谁? 建立线段树,把n个人被踢的顺序找到,然后求出n个人中因子数最多的(最小的数)是谁,这里要用到反素数,详看链接点击打开链接 #include #include #include using...
分类:其他好文   时间:2015-07-11 12:15:23    阅读次数:105
【POJ2886】【线段树】Who Gets the Most Candies?
DescriptionN children are sitting in a circle to play a game.The children are numbered from 1 to N in clockwise order. Each of them has a card with a ...
分类:其他好文   时间:2015-03-14 10:59:21    阅读次数:169
POJ2886 Who Gets the Most Candies? 【线段树】+【单点更新】+【模拟】+【反素数】
Who Gets the Most Candies? Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 9416   Accepted: 2868 Case Time Limit: 2000MS Description N children are s...
分类:其他好文   时间:2014-07-09 12:46:35    阅读次数:234
8条  
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!