fork(1) download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. class RepeatStringEasy
  4. {
  5. public:
  6. int maximalLength(string a)
  7. {
  8. int ans=0,i,j,k,lcs[60][60];
  9. string s1,s2;
  10. for(k=0;k+1<a.size();k++)
  11. {
  12. s1="$"+a.substr(0,k+1);
  13. s2="#"+a.substr(k+1);
  14. for(i=0;i<60;i++) lcs[0][i]=lcs[i][0]=0;
  15. for(i=1;i<s1.size();i++)
  16. {
  17. for(j=1;j<s2.size();j++)
  18. {
  19. if(s1[i]==s2[j]) lcs[i][j]=lcs[i-1][j-1]+1;
  20. else lcs[i][j]=max(lcs[i-1][j],lcs[i][j-1]);
  21. }
  22. }
  23. ans=max(ans,2*lcs[s1.size()-1][s2.size()-1]);
  24. }
  25. return ans;
  26. }
  27. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i586-linux-gnu/5/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty