树上背包记得以 为上界。
多做数数题,不要看到就跳。
NOIP T3, T4 不要完全不看,至少看一眼,知道题目在讲什么。
还有,千万不要
// freopen。
CSP-S/NOIP 要是有时间,记得玩玩抽象,争取上迷惑行为大赏。避免我忘了,写在这里:
I love Anastasya Feodorovna Snezhnaya & Eldreda Sunbringer!
luogu uid: 768951考前记得复习算法模板:
带修莫队,回滚莫队,FHQ / Splay,KMP,重剖,长剖,文艺,主席树,CDQ,马拉车,exCRT,扫描线,差分约束,点双,边双。
主席树空间:
最后,CSP/NOIP 2026 RP++!
一个健壮的 pair<int, int> 哈希:
struct pair_hash {
static uint64_t splitmix64(uint64_t x) {
x += 0x9e3779b97f4a7c15ULL;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9ULL;
x = (x ^ (x >> 27)) * 0x94d049bb133111ebULL;
return x ^ (x >> 31);
}
size_t operator()(const pair<int, int>& p) const {
static const uint64_t FIXED_RANDOM =
chrono::steady_clock::now().time_since_epoch().count();
uint64_t x = ((uint64_t)(uint32_t)p.first << 32) |
(uint32_t)p.second;
return splitmix64(x + FIXED_RANDOM);
}
};考场写法:
struct pair_hash {
size_t operator()(const pair<int, int>& p) const {
return ((uint64_t)p.first << 32) ^ (uint32_t)p.second;
}
};