传送门 后缀排序模板题. 终于会后缀数组了(然而只会倍增并不会DC3DC3DC3). 在这里列举几个数组的意思: sai:sa_i:sai:当前排名第iii的后缀的起始下标. rkirk_irki当前下标为iii的后缀对应的排名. sa2isa2_isa2i当前排名为iii的第二关键字对应的下标. 代码: #include<bits/stdc++.h> #define ri register int using namespace std; const int N=1e6+5; int…
1003 - Drunk PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB One of my friends is always drunk. So, sometimes I get a bit confused whether he is drunk or not. So, one day I was talking to him, about his drinks! He began to…