摘要:
C. 蚂蚁工厂 二分+线段树查询和直接在线段树上查询的做法虽然都是\(O(nlog^2n)\),但是由于后者跑不满(1+2+...+log(n)),在3s的时间限制下可以通过500000的数据 #include <bits/stdc++.h> using namespace std; int a[5 阅读全文
摘要:
B. Cost of the Array \(n\ne k\)时答案不是1就是2,看了半小时才看出来,唉…… #include <bits/stdc++.h> using namespace std; int a[200005],h[200005]; long long s[200005]; int 阅读全文
摘要:
了解了goto语句的用法。传言goto被视为“洪水猛兽”,但在OI中它是否真的没有可取之处呢 #include <bits/stdc++.h> using namespace std; int a[200005],b[200005]; long long s[200005]; int n,m; in 阅读全文