摘要:
题意:给n个数,求最长不同连续子序列。n<=1e6。 解题过程: 1.记录数据存于数组 2.用左右指针l和r指向这段连续区间 3.右指针往右走,如果遇到没有存在于set集合的数就插入集合 否则左指针往右走,逐渐删去set里的数据,不断更新答案,一直保留最大值。 #include<stdio.h> # 阅读全文
摘要:
You have a long fence which consists of nn sections. Unfortunately, it is not painted, so you decided to hire qq painters to paint it. ii-th painter w 阅读全文