Language: C++

l#include <bits/stdc++.h>
using namespace std;
#define Rep(i, n) for ( int i = 0; i < (n); i++ )  
typedef pair<int, int> Pii;

#define fr first
#define sc second

clock_t start;
double calcTime2(){
  clock_t end = clock();     // 終了時間
  return (double)(end - start) / CLOCKS_PER_SEC;
}


int main() {
    srand((unsigned)time(NULL));
    
    map<string, string> ne;
    ne["C"] = "C#";
    ne["C#"] = "D";
    ne["D"] = "D#";
    ne["D#"] = "E";
    ne["E"] = "F";
    ne["F"] = "F#";
    ne["F#"] = "G";
    ne["G"] = "G#";
    ne["G#"] = "A";
    ne["A"] = "A#";
    ne["A#"] = "B";
    ne["B"] = "C";
    map<string, string> pr;
    pr["C"] = "B";
    pr["B"] = "A#";
    pr["A#"] = "A";
    pr["A"] = "G#";
    pr["G#"] = "G";
    pr["G"] = "F#";
    pr["F#"] = "F";
    pr["F"] = "E";
    pr["E"] = "D#";
    pr["D#"] = "D";
    pr["D"] = "C#";
    pr["C#"] = "C";
    //string onp[12] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
    string T[50001], S[50001];    
    int k;
    cin >> k;
    while ( k-- ) {
      
    int n, m;
    start = clock();// スタート時間

    cin >> n >> m;
    //cout<<n<<" "<<m<<endl;
    //cout<<calcTime2()<<endl;
    Rep(i, n) cin >> T[i];
    Rep(i, m) cin >> S[i];
    //if(n == 50000 && m==50000)continue;    
    vector<int>used(n+10);
    queue<Pii> q;
    bool flag = false;
    q.push(Pii(0, -1));
    while ( !q.empty() && calcTime2()<3) {
      Pii p = q.front(); q.pop();
      int s = p.fr, t = p.sc;
      
      //cout << s-1 << " " << t << endl;

      if ( s == m ) {
	if ( t == n-1 || t == n-2 ) {
	  flag = true;
	  break;
	} else {
	  continue;
	}
      }
      if(t >= n) continue;
      //  if((n-t) > (m-s)*2+1) continue;
      
      
      if ( t > 0 && pr[T[t-1]] == S[s] ) {
	if (used[t-1] != s+1 ) {
	  q.push(Pii(s+1, t-1));
	  used[t-1] = s+1;
	}
      }
      
      if ( t <= n-2 && T[t+1] == S[s] ) {
	if (used[t+1] != s+1 ) {
	  q.push(Pii(s+1, t+1));
	  used[t+1] = s+1;
	}
      }
      
      if ( t <= n-3 && ne[T[t+2]] == S[s] ) {
	if (used[t+2] != s+1 ) {
	  q.push(Pii(s+1, t+2));
	  used[t+2] = s+1;
	}
      }
      
    }
    
    if(calcTime2()>=2.8) flag = rand()%2;
    if ( flag ) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}



Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | l#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'l' does not name a type
    1 | l#include <bits/stdc++.h>
      | ^
a.cc:4:9: error: 'pair' does not name a type
    4 | typedef pair<int, int> Pii;
      |         ^~~~
a.cc:9:1: error: 'clock_t' does not name a type
    9 | clock_t start;
      | ^~~~~~~
a.cc:1:1: note: 'clock_t' is defined in header '<ctime>'; this is probably fixable by adding '#include <ctime>'
  +++ |+#include <ctime>
    1 | l#include <bits/stdc++.h>
a.cc: In function 'double calcTime2()':
a.cc:11:3: error: 'clock_t' was not declared in this scope
   11 |   clock_t end = clock();     // 終了時間
      |   ^~~~~~~
a.cc:11:3: note: 'clock_t' is defined in header '<ctime>'; this is probably fixable by adding '#include <ctime>'
a.cc:12:19: error: 'end' was not declared in this scope
   12 |   return (double)(end - start) / CLOCKS_PER_SEC;
      |                   ^~~
a.cc:12:25: error: 'start' was not declared in this scope
   12 |   return (double)(end - start) / CLOCKS_PER_SEC;
      |                         ^~~~~
a.cc:12:34: error: 'CLOCKS_PER_SEC' was not declared in this scope
   12 |   return (double)(end - start) / CLOCKS_PER_SEC;
      |                                  ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:17:26: error: 'NULL' was not declared in this scope
   17 |     srand((unsigned)time(NULL));
      |                          ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | l#include <bits/stdc++.h>
a.cc:17:21: error: 'time' was not declared in this scope
   17 |     srand((unsigned)time(NULL));
      |                     ^~~~
a.cc:17:21: note: 'time' is defined in header '<ctime>'; this is probably fixable by adding '#include <ctime>'
a.cc:17:5: error: 'srand' was not declared in this scope
   17 |     srand((unsigned)time(NULL));
      |     ^~~~~
a.cc:19:5: error: 'map' was not declared in this scope
   19 |     map<string, string> ne;
      |     ^~~
a.cc:19:9: error: 'string' was not declared in this scope
   19 |     map<string, string> ne;
      |         ^~~~~~
a.cc:19:25: error: 'ne' was not declared in this scope
   19 |     map<string, string> ne;
      |                         ^~
a.cc:32:25: error: 'pr' was not declared in this scope; did you mean 'fr'?
   32 |     map<string, string> pr;
      |                         ^~
      |                         fr
a.cc:46:11: error: expected ';' before 'T'
   46 |     string T[50001], S[50001];
      |           ^~
      |           ;
a.cc:48:5: error: 'cin' was not declared in this scope
   48 |     cin >> k;
      |     ^~~
a.cc:52:5: error: 'start' was not declared in this scope
   52 |     start = clock();// スタート時間
      |     ^~~~~
a.cc:52:13: error: 'clock' was not declared in this scope
   52 |     start = clock();// スタート時間
      |             ^~~~~
a.cc:52:13: note: 'clock' is defined in header '<ctime>'; this is probably fixable by adding '#include <ctime>'
a.cc:57:22: error: 'T' was not declared in this scope
   57 |     Rep(i, n) cin >> T[i];
      |                      ^
a.cc:58:22: error: 'S' was not declared in this scope
   58 |     Rep(i, m) cin >> S[i];
      |                      ^
a.cc:60:5: error: 'vector' was not declared in this scope
   60 |     vector<int>used(n+10);
      |     ^~~~~~
a.cc:60:12: error: expected primary-expression before 'int'
   60 |     vector<int>used(n+10);
      |            ^~~
a.cc:61:5: error: 'queue' was not declared in this scope
   61 |     queue<Pii> q;
      |     ^~~~~
a.cc:61:11: error: 'Pii' was not declared in this scope
   61 |     queue<Pii> q;
      |           ^~~
a.cc:61:16: error: 'q' was not declared in this scope
   61 |     queue<Pii> q;
      |                ^
a.cc:65:10: error: expected ';' before 'p'
   65 |       Pii p = q.front(); q.pop();
      |          ^~
      |          ;
a.cc:66:15: error: 'p' was not declared in this scope
   66 |       int s = p.fr, t = p.sc;
      |               ^
a.cc:71:14: error: 't' was not declared in this scope
   71 |         if ( t == n-1 || t == n-2 ) {
      |              ^
a.cc:78:10: error: 't' was not declared in this scope
   78 |       if(t >= n) continue;
      |          ^
a.cc:82:12: error: 't' was not declared in this scope
   82 |       if ( t > 0 && pr[T[t-1]] == S[s] ) {
      |            ^
a.cc:82:24: error: 'T' was not declared in this scope
   82 |       if ( t > 0 && pr[T[t-1]] == S[s] ) {
      |                        ^
a.cc:82:35: error: 'S' was not declared in this scope
   82 |       if ( t > 0 && pr[T[t-1]] == S[s] ) {
      |                                   ^
a.cc:83:13: error: 'used' was not declared in this scope
   83 |         if (used[t-1] != s+1 ) {
      |             ^~~~
a.cc:89:12: error: 't' was not declared in this scope
   89 |       if ( t <= n-2 && T[t+1] == S[s] ) {
      |            ^
a.cc:89:24: error: 'T' was not declared in this scope
   89 |       if ( t <= n-2 && T[t+1] == S[s] ) {
      |                        ^
a.cc:89:34: error: 'S' was not declared in this scope
   89 |       if ( t <= n-2 && T[t+1] == S[s] ) {
      |                                  ^
a.cc:90:13: error: 'used' was not declared in this scope
   90 |         if (used[t+1] != s+1 ) {
      |             ^~~~
a.cc:96:12: error: 't' was not declared in this scope
   96 |       if ( t <= n-3 && ne[T[t+2]] == S[s] ) {
      |            ^
a.cc:96:27: error: 'T' was not declared in this scope
   96 |       if ( t <= n-3 && ne[T[t+2]] == S[s] ) {
      |                           ^
a.cc:96:38: error: 'S' was not declared in this scope
   96 |       if ( t <= n-3 && ne[T[t+2]] == S[s] ) {
      |                                      ^
a.cc:97:13: error: 'used' was not declared in this scope
   97 |         if (used[t+2] != s+1 ) {
      |             ^~~~
a.cc:105:33: error: 'rand' was not declared in this scope
  105 |     if(calcTime2()>=2.8) flag = rand()%2;
      |                                 ^~~~
a.cc:106:17: error: 'cout' was not declared in this scope
  106 |     if ( flag ) cout << "Yes" << endl;
      |                 ^~~~
a.cc:106:34: error: 'endl' was not declared in this scope
  106 |     if ( flag ) cout << "Yes" << endl;
      |                                  ^~~~
a.cc:107:10: error: 'cout' was not declared in this scope
  107 |     else cout << "No" << endl;
      |          ^~~~
a.cc:107:26: error: 'endl' was not declared in this scope
  107 |     else cout << "No" << endl;
      |                          ^~~~