Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
51503 AK2022071327 最优子序列 C++ 运行出错 0 0 MS 252 KB 666 2022-07-13 11:47:40

Tests(0/20):


#include <iostream> #include <fstream> #include <string> using namespace std; int n,k,type,ans; string s,ss; int main(){ freopen ( "seq.in","r",stdin ); cin >> n >> k >> type >> s; //find_longest_sub_string(s,ss,ans); for ( int i=0; i<s.size(); i++ ){ int j=0; while ( 1 ){ if ( (j>0&&s[i]==ss[j-1])||(j>i) ){ cout << "\n j=" << j << "\n s[i]=" << s[i] << " ss[j-1]=" << ss[j-1]; break; } ss[j]=s[i]; j++; ans++; } } //print_answer(); freopen ( "seq.out","w",stdin ); cout << endl << ans; if ( type==1 ){ cout << endl << ss; } else if ( type==2 ){ //cout << ss; } return 0; }


测评信息: