![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
题
文章平均质量分 55
bbhnnvcf
这个作者很懒,什么都没留下…
展开
-
【ccf csp】202006-2 稀疏向量 100
思路 此题需要优化,要利用输入的两个向量的index是逐增的,而要加内积只有两个向量index相同的情况,故在v上设指针k。比如u的index=4时,k指向v的index1,故k++,直到k指向的v的index>4为止…再看k指向的index等于4还是大于4。若等于4,加内积;若大于4,不动,让i++。 // An highlighted block #include<bits/stdc++.h> using namespace std; int n,a,b; long long su..原创 2021-04-02 20:56:08 · 97 阅读 · 0 评论 -
To fill or not to fill 加油站贪心问题
题目描述 With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time to time. Different gas station may give different price. You are asked t原创 2021-03-29 10:44:12 · 120 阅读 · 0 评论