ARTS 第 柒 期

目录

内容纲要

Algorithm

题目:
https://leetcode.cn/contest/weekly-contest-400/problems/count-days-without-meetings/

题解:
区间合并,时间复杂度 O(n)

class Solution {
public:
    int countDays(int days, vector<vector<int>>& meetings) {
        sort(meetings.begin(), meetings.end());
        int ans = 0;
        int R = 0;
        for (auto &m: meetings) {
            if (m[0] > R) ans += m[0] - R - 1; // 中间区间
            R = max(R, m[1]);
        }
        ans += days - R; //加上右侧剩余区间
        return ans;
    }
};

Review

bazel cpp 使用例子
https://bazel.googlesource.com/bazel/+/staging/site/docs/cpp-use-cases.md?pli=1#

nuro 做实验发现 机器学习 ”scaling laws” 在自动驾驶中的感知和行为决策依然成立
https://medium.com/nuro/at-nuro-we-conduct-an-ai-first-approach-by-using-ml-everywhere-5faf4657fff3

Tip

tip1: 查看 进程虚拟内存布局:
linux:

cat /proc/pid/map

mac:

vmmap pid

tip2:
bazel 全局通配和具体文件一起作为源文件的方法举例:

    hdrs = glob(
        ["include/**/*.h"],
        exclude = ["doc/**"],
    ) + [
        ":port_h",
        ":port_config_h",
    ],

Share

1.一个鸡蛋从内部打破是生命,从外部打破是食物,人亦是如此,从内部打破,是重生,从外部打破,则成为别人的猎物。
2.“人是通过意义来保护自己的生存”,重要的是要弄清楚自己信的是什么,并活出那个信仰。
3.尊重人性,不要对人性抱太高期望,不要站在道德制高点指责他人,有时道德是弱者的武器。

打赏作者