Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Hash,不用后缀数组,235MS不犹豫对原串,计算从每个位置开始的连续sqrt(N)个字符组成的串的hash值。 在比较字符串的时候,快速跳过相同的前缀。 int greater(int i,int j){ while (i+L<=N && j+L<=N && hA[i]==hB[j])i+=L,j+=L; while (A[i] || B[j]){ if (A[i]<B[j])return 0; if (A[i]>B[j])return 1; i++;j++; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator