dongzhen @ 2024-08-02 11:15:23
二分的思路好难想,树状数组又好想又简洁,题解一个都没有,树状数组转移一样是
for(int i=1;i<=n;++i){w[read()]=i;}
for(int i=1;i<=n;++i){
date[i]=read();
dp[i]=t.query(w[date[i]])+1;
t.update(w[date[i]],dp[i]);
ans=max(ans,dp[i]);
}
状态定义也可以直接由
by wukaichen888 @ 2024-08-02 11:20:12
你说得对
by XuYueming @ 2024-08-02 11:20:18
@dongzhen tlqtj
by Po7ed @ 2024-08-02 11:26:24
我就这么用的
by dongzhen @ 2024-08-02 14:21:22
@XuYueming ,对不起,下次不发代码了,只是想说一下感想而已
by chenzeen @ 2024-08-02 14:30:02
结果这题绿->黄
by _czy @ 2024-08-08 09:21:13
因为在本题
by heike305 @ 2024-08-09 16:06:26
@dongzhen 建议写篇题解,私信管理给你强制加上去
by dongzhen @ 2024-08-09 16:19:11
@_czy 如果这样,二分算法也是