Hidden Hierarchy 题目链接 题目描述 You are working on the user interface for a simple text-based file explorer. One of your tasks is to build a navigation pane displaying the directory hierarchy. As usual, the filesystem consists of directories which may con…
Problem E. Easy ProblemsetInput file: easy.in Output file: easy.outPerhaps one of the hardest problems of any ACM ICPC contest is to create a problemset with a reasonable number of easy problems. On Not Easy European Regional Contest this problem is so…
题意:有一组数,问子数组和最大不超过\(t\)的最多元素个数. 题解:用数组模拟队列,不断的往里面放,队列中的元素之和大于\(t\),就不断地从队头弹出直到满足条件,维护一个最大值即可. 代码: int n,t; int a[N]; int q[N]; int hh,tt=-1; int main() { //ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); n=read(),t=read(); for(int i=1;i<=n;++i) a…
题意:给定 n 个区间,让你进行合并,问你最后的区间是,如果是空集,输出 false 如果区间是是 [-32768,32767] ,则是true. 析:进行区间合并,要注意,如果是 x >= 0 && x <= 32767 那么输出是 x >= 0,在这地方,真是错死了......后来看了数据才知道有这个,其他的就是进行区间合并,如果第 i 个和第 j 个区间合并时,假设 x >= a && x <= b || x >= c &…