考虑如下数据:
#define a 100个连续的a //(我知道到不了100个,但是很接近,懒得算具体多少了) #define 100个连续的a b #define b 100个连续的b #define 100个连续的b c ... #define 100个连续的y z a;a;a;a...a;a(50个a) a;a;a;a...a;a(50个a) ...(49行)
这样的话,后49行每行复杂度为 O(50×100×51×log)O(50\times100\times51\times\log)O(50×100×51×log),总复杂度 O(503×100×log)O(50^3\times 100\times \log)O(503×100×log),即 O(12500000×log)O(12500000\times \log)O(12500000×log)。
是不是寄了(