題目鏈接:點擊打開鏈接
#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define N 500005 #define ll int ll n; ll c[N], maxn; inline ll lowbit(ll x){return x&(-x);} void change(ll pos, ll val){ while(pos)c[pos]=max(c[pos],val), pos-=lowbit(pos); } ll maxx(ll pos){ ll ans = -1; while(pos<=maxn)ans = max(ans,c[pos]),pos+=lowbit(pos); return ans; } struct node{ ll b[3],num; }w[N]; bool cmp0(node x, node y){return x.b[0]y.b[1];} int main(){ ll i,j; while(cin>>n) { for(i=0;iw[j].b[2]) ans++; for(j = i; j < n && w[i].b[1] == w[j].b[1]; j++) change(w[j].num, w[j].b[2]); i = j; } cout<
cocos2d-x關於獲取隨機數的問題,cocos2d-x隨
[cpp] /*  
【vc】1_Windows程序內部運行機制,1_window
LeetCode 99:Recover Binary Sea
noip201506 Message 信息傳遞,noip20
區間搜索問題就是給定一系列區間,和一個待測區間,求與