原文:HDU 4747 Mex(線段樹)(2013 ACM/ICPC Asia Regional Hangzhou Online)

Problem Description Mex is a function on a set of integers, which is universally used for impartial game theorem. For a non negative integer set S, mex S is defined as the least non negative integer ...

2013-09-15 21:56 16 1218 推薦指數:

查看詳情

HDU 4747 Mex線段

題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=4747 題意:有一組序列a[i](1<=i<=N), 讓你求所有的mex(l,r), mex(l,r)表示區間[l,r]中最小的未在序列中出現的非負整數。 思路:冥思苦想半天 ...

Thu Sep 19 04:17:00 CST 2013 0 4923
hdu 4747 Mex

思路:分析知道sum(1,i) (1<=i<=n) 具有單調性。每次求出1-i之間的所有可能值, 注意每次增加一個數時對結果的影響,用mp數組維護下就可以!! 代碼如下: ...

Tue Sep 17 04:33:00 CST 2013 6 1825
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM