摘要:
map记录一波到过的点,不过应该用哈希表更快 class Solution { public: bool isPathCrossing(string path) { map<pair<int, int>, int> mmp; int x=0,y=0; mmp[make_pair(0,0)] =1; 阅读全文
posted @ 2020-06-28 14:52
CrosseaLL
阅读(149)
评论(0)
推荐(0)
摘要:
直接暴力做法,排序之后去掉最大最小就行 线性做法应该就直接记录最大最小,但是没必要 class Solution { public: double average(vector<int>& a) { sort(a.begin(), a.end()); double ans = 0; for(auto 阅读全文
posted @ 2020-06-28 10:16
CrosseaLL
阅读(112)
评论(0)
推荐(0)

浙公网安备 33010602011771号