SA-IS后缀数组

//t的范围问题要注意 

#include 
#include 
#include 

using namespace std;

int main()
{
    int T;

    cin >> T;

    while(T--){
        int n;
        char c, f;

        cin >> n;

        getchar();

        f = getchar();

        int t = 0, flag = 0;

        for(int i=1; i= 0){
                    cout << "<";
                    t--;
                }
                flag = 1;
                t = 0;
            }
            else if(f > c){
                while(t >= 0) {
                    cout << ">";
                    t--;
                }
                t = 0;
                flag = 1;
            }
            else{
                t++;
            }
            f = c;
            //    cout <";
        cout << endl;
    }

    return 0;
}

 

你可能感兴趣的:(SA-IS后缀数组)