CodeFoeces-448B

题目

原题链接:B. Suffix Structures

题意

给出字串a和b。若a中有按顺序排列的b则输出“automaton”。若有未按顺序排列的但a和b长度相同则输出“array”,但若a长度>b长度则输出“both”。其余情况输出“need tree”。
参考了其他作者的题解翻译。题意没有摸索清楚。

代码

#include
using namespace std;
int main() {
    string a,b;
    cin>>a>>b;
    for(int i=0,j=0,tt=b.length();ib.length()) printf("both\n");
        else if(a.length()==b.length()) printf("array\n");
    }else{
        printf("need tree\n");
    }
    return 0;
}

你可能感兴趣的:(CodeFoeces-448B)