败犬日报 2025-08-19
1. 为什么原子变量既不能 copy 也不能 move
因为这实际上是,在一个地方读,然后在另一个地方写,做不到原子地做这两件事。
2. leetcode 似乎可以 hack 运行时间
写文件把运行时间修改了,好多时间 100 的都有这个。
cpp
const auto _ = std::cin.tie(nullptr)->sync_with_stdio(false);
#define LC_HACK
#ifdef LC_HACK
const auto __ = []() {
struct ___ {
static void _() { std::ofstream("display_runtime.txt") << 0 << '\n'; }
};
std::atexit(&___::_);
return 0;
}();
#endif