Language: C++

#include<iostream>
#include<string>
#include<algorithm>
usig namespace std;
static const int N=1000;
int lcs(string X,string Y){
  int c[N+1][N+1];
  int m=X.size();
  int n=Y.size();
  int maxl=0;
  X=' '+X;
  Y=' '+Y;
  for(int i=1;i<=m;i++)c[i][0]=0;
  for(int j=1;j<=n;j++)c[0][j]=0;

  for(int i=1;i<=m;i++){
    for(int j=1;j<=n;j++){
      if(X[i]==Y[j]){
        c[i][j]=c[i-1][j-1]+1;
        }else{
        c[i][j]=max(c[i-1][j],c[i][j-1]);
        }  
      maxl=max(maxl,c[i][j]);
     }
   }
  return maxl;
}

int main(){
 
string s1,s2;
int n;cin >> n;
for(int i=0;i<n;i++){
cin >> s1 >> s2;
cout << lcs(s1,s2) << endl;
}
return 0;
 
}

Compiler output:
a.cc:4:1: error: 'usig' does not name a type
    4 | usig namespace std;
      | ^~~~
a.cc:6:9: error: 'string' was not declared in this scope
    6 | int lcs(string X,string Y){
      |         ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:18: error: 'string' was not declared in this scope
    6 | int lcs(string X,string Y){
      |                  ^~~~~~
a.cc:6:18: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:26: error: expression list treated as compound expression in initializer [-fpermissive]
    6 | int lcs(string X,string Y){
      |                          ^
a.cc: In function 'int main()':
a.cc:31:1: error: 'string' was not declared in this scope
   31 | string s1,s2;
      | ^~~~~~
a.cc:31:1: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:32:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   32 | int n;cin >> n;
      |       ^~~
      |       std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:34:8: error: 's1' was not declared in this scope
   34 | cin >> s1 >> s2;
      |        ^~
a.cc:34:14: error: 's2' was not declared in this scope
   34 | cin >> s1 >> s2;
      |              ^~
a.cc:35:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   35 | cout << lcs(s1,s2) << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:35:12: error: 'lcs' cannot be used as a function
   35 | cout << lcs(s1,s2) << endl;
      |         ~~~^~~~~~~
a.cc:35:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   35 | cout << lcs(s1,s2) << endl;
      |                       ^~~~
      |                       std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~