Prob_Solve 板


LINE

※ 引述《Leon (Achilles)》之铭言: : : Step A (Find the rank of the median of medians): : : (7 races) Divide the cars into 7 groups and get the order within each group. : : (1 race) Take the 7 medians and get the order. Find the median of medians : : (denote as o). In following example, it is 34. : 下面这一步, upper-right and lower-left 共有 18 elements, : 你怎麽用 2 races 就和 pivort 比出来? : : (2 races) Find the rank of the median of medians. Take 6 elements from : : lower-left corner and upper-right corner and race against the o. : : After 2 rounds, we know the rank of this median of medians within : : in the whole set. : : The best case is that o is the global median (25th fastest). : : The worst case is that o is the 16th or 34th fastest. OK, here is my reply. Sorry for the delay, I have been busy on something. The reason I can't understand your statement in the last few lines of Step A is: You claim you can use 2 races to get the 'order' of median of median. (I don't like the word 'rank'). Based on your previous artiule, it's .. 推 Favonia:这网站描述的显然不是最佳,因为 Round One 第3步两次足矣 02/13 04:58 → RockLee:不是应该三次吗? Ex. (group 1[5~7], group 5[1~3]), 02/13 07:49 → RockLee:(group2[5~7], group6[1~3]), (group3[5~7], group7[1~3]) 02/13 07:50 推 pika0923:group 1[5~7] 先跟6比 再跟5或7其中之一比 两次 02/13 08:49 → RockLee:了解 所以照网站描述的方法 Round Two 应该也只需要两次 02/13 12:36 → RockLee:总共 16 次即可保证找出 25th 还有办法更少吗? 02/13 12:37 The original statement from pika0923 is not going to work. ( However, he propose a good method in the later article. ) Now I use the notation in pika0923's articule, It's very clear and good written. We should give him some credit. First we separate the cars into 7 groups, and sort them. Then we have Group A, B, .. etc, with their order inside the same group. We run an additional sorting on median of each group, get the 'median' of median, assume it's D4. It's possible to get the 'order' of the D4 faster. The relations between D4 and upper-left and lower-right are known. We need to figure out upper-right and lower-left. The trick is, you compare D4 with the 'median' of the rest. Say, A[6], B[6], C[6] and E[2], F[2], G[2]. With one comparsion, you not only get the relation between D[4] and the element and also the one connected to it in the same group. For example, if C[6] < D[4] ( faster ), we also know C[5] < C[6] < D[4]. Thus, no reason to compare C[5] anymore. The same arguement holds the other way around. Basically, in your description : : (2 races) Find the rank of the median of medians. Take 6 elements from : : lower-left corner and upper-right corner and race against the o. It's not trivial at all. You need to compare it with 'median' of the rest to get this step. I suggests you to read the article by pika0923. His example is very easy to read and seems to be right. I am also interested in the "Decision Tree" notation. Do you want to say more about this? --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 142.136.127.172
1F:推 RockLee:如何在Step A的最後用2 races确认median of medians的rank 02/16 18:51
2F:→ RockLee:pika0923一开始在推文中的回覆跟後来文章写的方法是一样的 02/16 18:52
3F:→ RockLee:只是所用的符号有差: 02/16 18:52
4F:→ RockLee:group 1[5~7]先跟6比 => A[5]~A[7]中, D[4]先跟A[6]比 02/16 18:52
5F:→ RockLee:再跟5或7其中之一比 => 再跟A[5]或A[7]其中之一比 02/16 18:53
6F:→ RockLee:跟我在推文中解释的也是一样的意思: 02/16 18:53
7F:→ RockLee:方法是先和 medians of upper-right and lower-left 比 02/16 18:53
8F:→ RockLee:例如 34 跟 14 比过之後就知道不需要跟 13 比了 02/16 18:54
9F:→ RockLee:不好意思我的方法确实写的不够详细 不该假设大家都看过并 02/16 18:54
10F:→ RockLee:了解pika0923一开始的推文 pika0923後来的文章确实更好懂 02/16 18:54
11F:→ Leon:' group 1[5~7]先跟6比 ' that's really confusing 02/17 02:45
12F:→ Leon:if I read this, I will assume it's compare A[4-7] with..? 02/17 02:46
13F:→ Leon:but after the discussion, I am happy we clearify this 02/17 02:47







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:Gossiping站内搜寻

TOP