题解的做法是 O(C2613D) 吧(?),算出来是 1e10,显然爆搜过不去吧。
数据生成器:
#include<bits/stdc++.h>
using namespace std;
string s[1010];
int main()
{
srand((unsigned)time(NULL));
cout<<114514<<endl<<13<<' '<<26<<endl<<1000<<endl;
for(int i=1; i<=1000; ++i)
{
for(int j=1; j<=10; ++j) s[i]+=(char)('A'+rand()%26);
}
sort(s+1,s+1000+1);
for(int i=1; i<=1000; ++i) cout<<s[i]<<endl;
return 0;
}
实测第一篇题解直接 RE 第二篇跑了 100s。
不过我还是感觉我读错数据范围了,求看看是否真的读错了。