2017年5月15日

deque双端队列用法

摘要: #include #include #include #include using namespace std; deque dq; int main() { dq.push_front(102);///插入头部 dq.push_back(101);///插入尾部 sort(dq.begin(),dq.end()); deque::iterator it ... 阅读全文

posted @ 2017-05-15 15:58 hnust_accqx 阅读(290) 评论(0) 推荐(0)

2017-5-14 湘潭市赛 Strange Optimization

摘要: Strange Optimization Accepted : 35 Submit : 197 Time Limit : 1000 MS Memory Limit : 65536 KB Strange Optimization Bobo is facing a strange optimization problem. Given n,m, he is... 阅读全文

posted @ 2017-05-15 14:40 hnust_accqx 阅读(519) 评论(0) 推荐(0)

2017-5-14 湘潭市赛 Highway 先获得直径S,T。则一开始S,T相连,然后其他的点如果离S更远那么连在S,否则T;

摘要: Highway Accepted : 33 Submit : 137 Time Limit : 4000 MS Memory Limit : 65536 KB Highway In ICPCCamp there were n towns conveniently numbered with 1,2,…,n connected with (n−1) ro... 阅读全文

posted @ 2017-05-15 14:01 hnust_accqx 阅读(310) 评论(0) 推荐(0)

2017-5-14 湘潭市赛 Partial Sum 给n个数,每次操作选择一个L,一个R,表示区间左右端点,该操作产生的贡献为[L+1,R]的和的绝对值-C。 0<=L<R<=n; 如果选过L,R这两个位置,那么以后选择的L,R都不可以再选择这两个位置。最多操作m次,求可以获得的 最大贡献和。

摘要: Partial Sum Accepted : 30 Submit : 119 Time Limit : 3000 MS Memory Limit : 65536 KB Partial Sum Bobo has a integer sequence a1,a2,…,an of length n. Each time, he selects two end... 阅读全文

posted @ 2017-05-15 13:38 hnust_accqx 阅读(3196) 评论(0) 推荐(0)

随机生成数,摘自算法竞赛入门经典P120-P123测试STL。

摘要: //#include #include #include #include #include///调用time的头文件。 #include #include #include///调用rand的头文件。 #include///assert的头文件。 #define LL long long using namespace std; void fill_random_int(vector&v,i... 阅读全文

posted @ 2017-05-15 12:59 hnust_accqx 阅读(290) 评论(0) 推荐(0)

导航