Codeforces有质量水题集锦 - Gemini Boy - ACM之路~

Codeforces有质量水题集锦

Gemini posted @ 2013年6月10日 15:01 in 题解 with tags codeforces , 1180 阅读

Codeforces 280B: Maximum Xor Secondary

链接:http://codeforces.com/problemset/problem/280/B

题意:给定一个序列,求对于任意L,R,在LR之间最大值与严格次大值异或值最大是多少。

做法:维护一个优先序列,可以证明每个元素最多只会进队一次出队一次,所以复杂度是O(n)的。

代码君:http://codeforces.com/contest/280/submission/3852565

 

 

Codeforces 280C: Game on Tree

链接:http://codeforces.com/contest/280/problem/C

题意:给一棵树,每次随机的删除一个结点和这个结点的子树,问删除整个树期望要删多少次

做法:每个结点的depth的倒数和即为最终结果,(不会证明)

代码君:http://codeforces.com/contest/280/submission/3852624

 


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee