criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void){
  int n;
  cin >> n;
  
  vector<string>words(n);
  char word_last;
  int same = 0;
  
  int word_long = 0;
  
  
  for(int i=0;i<n;i++){
    cin >> words[i];
    for(int j=0;j<i;j++){
      if(words[i] == words[j])
        same = 1;
    }
    if(same == 1)
      break;
    else if(last != words[i][1]){
      same == 1;
      break;
    }
    else{
      word_long = words[i].length();
      word_last = words[i][word_long-1];
    }
  }
  
  if(same == 1)
    cout << "No" << endl;
  else
    cout << "Yes" <<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: 'last' was not declared in this scope
   24 |     else if(last != words[i][1]){
      |             ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void){
  int n;
  cin >> n;
  
  vector<string>words(n);
  char last;
  int same = 0;
  
  int long = 0;
  
  
  for(int i=0;i<n;i++){
    cin >> words[i];
    for(int j=0;j<i;j++){
      if(words[i] == words[j])
        same = 1;
    }
    if(same == 1)
      break;
    if(last != words[i][1]){
      same == 1;
      break;
    }
    else{
      long = words[i].length();
      last = words[i][n-1];
    }
  }
  
  if(same == 1)
    cout << "No" << endl;
  else
    cout << "Yes" <<endl;
  
  return 0;
}

    
    
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected unqualified-id before '=' token
   13 |   int long = 0;
      |            ^
a.cc:29:12: error: expected unqualified-id before '=' token
   29 |       long = words[i].length();
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  	cin>>n;
  vector<string>vec(n);
  vector<char>first(n);
  vector<char>last(n);
  
  for(int i=0;i<n;i++){
    string s;
    	cin>>s;
    int sige=s.size();
    vec[i]=s;
    first[i]=s.at(0);
    last[i]=s.at(sige-1);
  }
  
  int sum=1;
  for(int i=1;i<n;i++){
    if(first[i]!=last[i-1]){
      cout<<"No"<<endl;
      	break;
    }
    else{
    for(int j=0;j<i;j++){
      if(vec[i]==vec[j]){
        cout<<"No"<<endl;
        break;
      }
      else sum+=1;
    }
    } 
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:35:6: error: expected '}' at end of input
   35 |     }
      |      ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
 int n,l;
  cin>>n;
vector<string> m(n);
  for(int i=0;i<n;i++){
    cin>>m[i];
    if(i>0){
    if((m[i-1])[l-1]!=(m[i])[0]){
      cout<<"No"<<endl;
      break;
    }
    }
    l=(m[i]).size;
    if(i==n-1){
      cout<<"Yes"<<endl;
    }
  }



}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
   16 |     l=(m[i]).size;
      |              ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
 int n,l;
  cin>>n;
vector<string> m(n);
  for(int i=0;i<n;i++){
    cin>>m(i);
    if(i>0){
    if((m[i-1])[l-1]!=(m[i])[0]){
      cout<<"No"<<endl;
      break;
    }
    }
    l=(m[i]).size;
    if(i==n-1){
      cout<<"Yes"<<endl;
    }
  }



}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
    9 |     cin>>m(i);
      |          ~^~~
a.cc:16:14: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
   16 |     l=(m[i]).size;
      |              ^~~~
Language: C++

#include <bits/stdc++.h> 
using namespace std;

int main(){
    int N,count = 0;
    cin >> N;
    string W[N] = {};
    for(int i = 0;i < N;i++){
        cin >> W[i] ; 
        for(int j = 0;j < i;j++){
            if((W[i] == W[j])&&(i>=1)){
                cout << "No" <<endl;
                return 0;
            }
        }
        if((W[i]begin()==W[i-1])&&(i>=1)){
            cout <<"No" << endl;
            return 0;
        }
    }
   
        cout << "Yes" << endl;
    
    

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected ')' before 'begin'
   16 |         if((W[i]begin()==W[i-1])&&(i>=1)){
      |            ~    ^~~~~
      |                 )
a.cc:19:10: error: expected ')' before '}' token
   19 |         }
      |          ^
      |          )
   20 |     }
      |     ~     
a.cc:16:11: note: to match this '('
   16 |         if((W[i]begin()==W[i-1])&&(i>=1)){
      |           ^
a.cc:16:16: error: could not convert 'W[i]' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   16 |         if((W[i]begin()==W[i-1])&&(i>=1)){
      |            ~~~~^~~~~~
      |                |
      |                std::string {aka std::__cxx11::basic_string<char>}
a.cc:20:5: error: expected primary-expression before '}' token
   20 |     }
      |     ^
Language: C++

#include <bits/stdc++.h> 
using namespace std;

int main(){
    int N,count = 0;
    cin >> N;
    string W[N] = {};
    for(int i = 0;i < N;i++){
        cin >> W[i] ; 
        for(int j = i;j < i;j++){
            if(W[i] == W[j]){
                cout << "No" <<endl;
                return 0;
            }
        }
        if((W[i]begin()==W[i-1])&&(i>=1)){
            cout <<"No" << endl;
            return 0;
        }
    }
   
        cout << "Yes" << endl;
    
    

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected ')' before 'begin'
   16 |         if((W[i]begin()==W[i-1])&&(i>=1)){
      |            ~    ^~~~~
      |                 )
a.cc:19:10: error: expected ')' before '}' token
   19 |         }
      |          ^
      |          )
   20 |     }
      |     ~     
a.cc:16:11: note: to match this '('
   16 |         if((W[i]begin()==W[i-1])&&(i>=1)){
      |           ^
a.cc:16:16: error: could not convert 'W[i]' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   16 |         if((W[i]begin()==W[i-1])&&(i>=1)){
      |            ~~~~^~~~~~
      |                |
      |                std::string {aka std::__cxx11::basic_string<char>}
a.cc:20:5: error: expected primary-expression before '}' token
   20 |     }
      |     ^
Language: C++

#include <bits/stdc++.h> 
using namespace std;

int main(){
    int N,count = 0;
    cin >> N;
    string W[N] = {};
    for(int i = 0;i < N;i++){
        cin >> W[i] ; 
        for(int j = 0;j < i;j++){
            if(W[i] == W[j]){
                cout << "No" <<endl;
                return 0;
            }
        }
        if((W[i]begin()==W[i-1])&&(i>=1)){
            cout <<"No" << endl;
            return 0;
        }
    }
   
        cout << "Yes" << endl;
    
    

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected ')' before 'begin'
   16 |         if((W[i]begin()==W[i-1])&&(i>=1)){
      |            ~    ^~~~~
      |                 )
a.cc:19:10: error: expected ')' before '}' token
   19 |         }
      |          ^
      |          )
   20 |     }
      |     ~     
a.cc:16:11: note: to match this '('
   16 |         if((W[i]begin()==W[i-1])&&(i>=1)){
      |           ^
a.cc:16:16: error: could not convert 'W[i]' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   16 |         if((W[i]begin()==W[i-1])&&(i>=1)){
      |            ~~~~^~~~~~
      |                |
      |                std::string {aka std::__cxx11::basic_string<char>}
a.cc:20:5: error: expected primary-expression before '}' token
   20 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin>>N;
  
  // 100要素の配列で初期化
  vector<string> x(N);
  int ans=0;
  for(int i=0;i<N;i++)
    cin>>x.at(i);
  for(int i=0;i<N;i++){
    string X =x.at(i);
    for(int j=i+1;j<N;j++){
      string Y=y.at(j);
      if(X==Y){
        ans=1;
        break;
      }
    }
  }
  string tmp=x[0];
  for(int i=1;i<N;i++){
      string X =x.at(i);
      if(X.at(0)!=tmp.at(tmp.size()-1)){
        ans=1;
        break;
      }
      tmp=x.at(i);
  }
  if(ans==1)
    cout<<"No"<<endl;
  else
    cout<<"Yes"<<endl;
}
    
        
      
  



Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: 'y' was not declared in this scope
   16 |       string Y=y.at(j);
      |                ^
Language: C++

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(){
    int n;
    vector<string> vs;
    string s,sb;
    cin >> n;

    bool iswrong = false;
    cin >> s;
    vs.push_back(s);

    for(int i = 0; i < n-1; i++){
        sb = s;
        cin >> s;
        if(sb[sb.length()-1] != s[0]){
            iswrong = true;
        }
        vs.push_back(s);
    }
    sort(vs.begin(), vs.end());

    for(int i = 0; i < n-1; i++){
        if(vs[i] == vs[i+1]){
            iswrong = true;
        }
    }
    if(iswrong){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   26 |     sort(vs.begin(), vs.end());
      |     ^~~~
      |     short
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FORR(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)

#define CHMIN(a, b) (a) = min((a), (b))
#define CHMAX(a, b) (a) = max((a), (b))

#define DEBUG(x) cout << #x << ": " << (x) << endl
#define PRINT(x) cout << x << endl
#define all(x) x.begin(),x.end()


int main() {
    int N;
    cin >> N;

    vector<string> v(N);
    REP(i,N){
        cin >> vec[i];
    }


    bool ok =true;

    FOR(i,1,N){
        if(v[i][0]!=v[i-1][v[i-1].length()-1]){
            ok = false;
        }
    }
    
    FOR(i,0,N){
        FOR(j,i+1,N){
            if(v[i]==v[j]) ok = false;
        }
    }

    if(ok)PRINT("Yes");
    else PRINT("No");

}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: 'vec' was not declared in this scope
   28 |         cin >> vec[i];
      |                ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<string> da(n);
  for(int i=0;i<n;i++){
    cin >> da[i];
  }
  bool ans=true;
  for(int i=0;i<n-1;i++){
    int x=da[i].size();
    if(da[i+1][1]!=da[i][x])
      ans =false;
  }
  for(int i=0;i<n-1;i++){
    for(int j=0;j<i;j++){
      if(da[i]==da[]]){
        ans=false;
      }
    }
  }
  if(ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: expected primary-expression before ']' token
   18 |       if(da[i]==da[]]){
      |                    ^
a.cc:18:21: error: expected ')' before ']' token
   18 |       if(da[i]==da[]]){
      |         ~           ^
      |                     )
a.cc:18:21: error: expected primary-expression before ']' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<string> da(n);
  for(int i=0;i<n;i++){
    cin >> da[i];
  }
  bool ans=true;
  for(int i=0;i<n-1;i++){
    int x=da[i].size();
    if(da[i+1][1]!=da[i][x])
      ans =false;
  }
  for(int i=0;i<n-1;i++){
    for(in j=0;j<i;j++){
      if(da[i]==da[]]){
        ans=false;
      }
    }
  }
  if(ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'in' was not declared in this scope; did you mean 'i'?
   17 |     for(in j=0;j<i;j++){
      |         ^~
      |         i
a.cc:17:16: error: 'j' was not declared in this scope
   17 |     for(in j=0;j<i;j++){
      |                ^
a.cc:18:20: error: expected primary-expression before ']' token
   18 |       if(da[i]==da[]]){
      |                    ^
a.cc:18:21: error: expected ')' before ']' token
   18 |       if(da[i]==da[]]){
      |         ~           ^
      |                     )
a.cc:18:21: error: expected primary-expression before ']' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<string> da(n);
  for(int i=0;i<n;i++){
    cin >> da[i];
  }
  bool ans=true;
  for(int i=0;i<n-1;i++){
    int x=da[i].size();
    if(da[i+1][1]!=da[i][x])
      ans =false;
  }
  for(int i=0;i<n-1;i++){
    for(in j=0;j++;j<i){
      if(da[i]==da[]]){
        ans=false;
      }
    }
  }
  if(ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'in' was not declared in this scope; did you mean 'i'?
   17 |     for(in j=0;j++;j<i){
      |         ^~
      |         i
a.cc:17:16: error: 'j' was not declared in this scope
   17 |     for(in j=0;j++;j<i){
      |                ^
a.cc:18:20: error: expected primary-expression before ']' token
   18 |       if(da[i]==da[]]){
      |                    ^
a.cc:18:21: error: expected ')' before ']' token
   18 |       if(da[i]==da[]]){
      |         ~           ^
      |                     )
a.cc:18:21: error: expected primary-expression before ']' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<string> da(n);
  for(int i=0;i<n;i++){
    cin >> da[i];
  }
  bool ans=true;
  for(int i-0;i<n-1;i++){
    int x=da[i].size();
    if(da[i+1][1]!=da[i][x])
      ans =false;
  }
  if(ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected ';' before '-' token
   11 |   for(int i-0;i<n-1;i++){
      |            ^
      |            ;
a.cc:11:20: error: expected ')' before ';' token
   11 |   for(int i-0;i<n-1;i++){
      |      ~             ^
      |                    )
a.cc:11:21: error: 'i' was not declared in this scope
   11 |   for(int i-0;i<n-1;i++){
      |                     ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main(){
  int N;
  cin>>N;
  vector<string> W(N);
  for(int i=0; i<N; ++i) cin>>W.at(i);
  bool can=true;
  for(int i=0; i<N-1; ++i){
    
    if(W.at(i).back() != W.at(i+1).front()){
      can=false;
      break;
    }
    
    for(int j=1; j<N; ++j){
      if(i!=j){
        bool AAA=false;
        AAA=equal(begin(W.at(i)), end(W.at(i)), begin(W.at(j)), end(W.at(j));
        if(AAA){
          can=false;
          break;
        }
      }
    }
    
  }
  
  if(can) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:77: error: expected ')' before ';' token
   22 |         AAA=equal(begin(W.at(i)), end(W.at(i)), begin(W.at(j)), end(W.at(j));
      |                  ~                                                          ^
      |                                                                             )
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main(){
  int N;
  cin>>N;
  vector<string> W(N);
  for(int i=0; i<N; ++i) cin>>W.at(i);
  bool can=true;
  for(int i=0; i<N-1; ++i){
    
    if(W.at(i).back() != W.at(i+1).front()){
      can=false;
      break;
    }
    
    for(int j=1; j<N; ++j){
      if(i!=j){
        bool AAA=false;
        AAA=equal(begin(W.at(i)), end(W.at(i)), begin(W.at(j)), end(W.at(j));
        if(EQUAL){
          can=false;
          break;
        }
      }
    }
    
  }
  
  if(can) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:77: error: expected ')' before ';' token
   22 |         AAA=equal(begin(W.at(i)), end(W.at(i)), begin(W.at(j)), end(W.at(j));
      |                  ~                                                          ^
      |                                                                             )
a.cc:23:12: error: 'EQUAL' was not declared in this scope
   23 |         if(EQUAL){
      |            ^~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main(){
  int N;
  cin>>N;
  vector<string> W(N);
  for(int i=0; i<N; ++i) cin>>W.at(i);
  bool can=true;
  for(int i=0; i<N-1; ++i){
    
    if(W.at(i).back() != W.at(i+1).front()){
      can=false;
      break;
    }
    
    for(int j=1; j<N; ++j){
      if(i!=j){
        bool EQUAL=false;
        EQUAl=equal(begin(W.at(i)), end(W.at(i)), begin(W.at(j)), end(W.at(j));
        if(EQUAL){
          can=false;
          break;
        }
      }
    }
    
  }
  
  if(can) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'EQUAl' was not declared in this scope; did you mean 'EQUAL'?
   22 |         EQUAl=equal(begin(W.at(i)), end(W.at(i)), begin(W.at(j)), end(W.at(j));
      |         ^~~~~
      |         EQUAL
a.cc:22:79: error: expected ')' before ';' token
   22 |         EQUAl=equal(begin(W.at(i)), end(W.at(i)), begin(W.at(j)), end(W.at(j));
      |                    ~                                                          ^
      |                                                                               )
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(void){
    int N;
    cin>>N;
    vector<string> W(N);

    for(int i=0;i<N;i+++){
        cin>>W[i];
    }

    for(int i=0;i<N-1;i++){
        for(int j=1;j<N;j++){
            if(W[i]==W[j]){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: expected primary-expression before ')' token
    9 |     for(int i=0;i<N;i+++){
      |                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(void){
    int N;
    cin>>N;
    vector<string> W(N);

    for(int i=0;i<N;i+++){
        cin>>W[i];
    }

    for(int i=0;i<N-1;i++){
        for(int j=1;j<N;j++){
            if(W[i]==W[j]){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    coutZ<<<"Yes"<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: expected primary-expression before ')' token
    9 |     for(int i=0;i<N;i+++){
      |                         ^
a.cc:21:5: error: 'coutZ' was not declared in this scope
   21 |     coutZ<<<"Yes"<<endl;
      |     ^~~~~
a.cc:21:12: error: expected primary-expression before '<' token
   21 |     coutZ<<<"Yes"<<endl;
      |            ^
a.cc:21:18: error: invalid operands of types 'const char [4]' and '<unresolved overloaded function type>' to binary 'operator<<'
   21 |     coutZ<<<"Yes"<<endl;
      |             ~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n, i, j;
    cin >> n;
    string s[n];
    cin >> s[0];
    for(i=1; i<n; i++){
        cin >> s[i];
        if(s[i-1][s[i-1].length()] != s[i][0]){
            cout << "No";
            cout << 1;
            return 0;
        }
        for(j=0; j<i; j++){
            if(s[j] == s[i]){
                cout << "No";
                cout << 2
                return 0;
            }
        }
    }
    cout << "Yes";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: expected ';' before 'return'
   19 |                 cout << 2
      |                          ^
      |                          ;
   20 |                 return 0;
      |                 ~~~~~~
Language: C++

#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;

int main() {
int n;cin>>n;
  vector<string> siri;
  rep(i, n) cin>>siri.at(i);
  
  bool ok=true;
  
  for(int i=0,i<n-1;i++){
    if((siri.at(i)).end()==(siri.at(i+1)).begin()){ok=false;
                                                 break;}
  }
  
  if(ok){sort(All(siri);
              for(int i=0,i<n-1;i++){
    if(siri.at(i)==siri.at(i+1)){ok=false;
                                break;}
              }
              }
     if(ok) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
              
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: expected ';' before '<' token
   14 |   for(int i=0,i<n-1;i++){
      |                ^
      |                ;
a.cc:14:16: error: expected primary-expression before '<' token
a.cc:19:15: error: 'All' was not declared in this scope; did you mean 'll'?
   19 |   if(ok){sort(All(siri);
      |               ^~~
      |               ll
a.cc:20:28: error: expected ';' before '<' token
   20 |               for(int i=0,i<n-1;i++){
      |                            ^
      |                            ;
a.cc:20:28: error: expected primary-expression before '<' token
Language: C++

N = int(input())
W = [input() for i in range(N)]
setw = set(W)

ans = 'Yes'

if len(setw)!=len(W):
    ans='No'
    
for i in range(N):
    if i==0:
        continue
    if W[i][0] != W[i-1][-1]:
        ans='No'
        
print(ans)


Compiler output:
a.cc:5:7: warning: multi-character character constant [-Wmultichar]
    5 | ans = 'Yes'
      |       ^~~~~
a.cc:8:9: warning: multi-character character constant [-Wmultichar]
    8 |     ans='No'
      |         ^~~~
a.cc:14:13: warning: multi-character character constant [-Wmultichar]
   14 |         ans='No'
      |             ^~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
int main() {
    int N;
    cin >> N;
    vector<string> w;
    string a;
    for (int i = 0;i<N;i++){
        cin >> a;
        w.push_back(a);
    }
    bool flag = true;
    for (int i = 0;i<N - 1;i++){
        if (w[i][w[i].size() -1] != w[i + 1][0]){
            flag = false;
            break;
        }
        for (int j = 0;j < i;j++){
            if (w[i] == w[j]){
                flag = false;
                break;
            }
        }
    }
    if(flag == true){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:34:6: error: expected '}' at end of input
   34 |     }
      |      ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C

#include <stdio.h>
int main (){
int k;han=0,i;
  scanf ("%d",&k);
  char s[100][10];
  scanf ("%s",s[0]);
  for (i=1;i<k;i++){
    scanf ("%s",s[i]);
  if (s[i-1][strlen(s[i-1])-1]==s[i][0]){
  }
    else{
    han=han+1;
      break;
    }
    for (int j=0;j<i;j++){
  if(s[j]==s[i]){
  han=han+1;
    break;
  }
    }
    if (han>0){
    break;
    }
  }  
  
  if (han==0){
printf ("Yes");
  }
  else{
printf("No");
  }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:7: error: 'han' undeclared (first use in this function)
    3 | int k;han=0,i;
      |       ^~~
main.c:3:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:13: error: 'i' undeclared (first use in this function)
    3 | int k;han=0,i;
      |             ^
main.c:9:14: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    9 |   if (s[i-1][strlen(s[i-1])-1]==s[i][0]){
      |              ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | int main (){
main.c:9:14: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    9 |   if (s[i-1][strlen(s[i-1])-1]==s[i][0]){
      |              ^~~~~~
main.c:9:14: note: include '<string.h>' or provide a declaration of 'strlen'
Language: C

#include <stdio.h>
int main (){
int k;han=0,i;
  scanf ("%d",&k);
  char s[100];
  scanf ("%s",s[0]);
  for (i=1;i<k;i++){
    scanf ("%s",s[i]);
  if (s[i-1][strlen(s[i-1])]==s[i][0]){
  }
    else{
    han=han+1;
      break;
    }
    for (int j=0;j<i;j++){
  if(s[j]==s[i]){
  han=han+1;
    break;
  }
    }
    if (han>0){
    break;
    }
  }  
  
  if (han==0){
printf ("Yes");
  }
  else{
printf("No");
  }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:7: error: 'han' undeclared (first use in this function)
    3 | int k;han=0,i;
      |       ^~~
main.c:3:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:13: error: 'i' undeclared (first use in this function)
    3 | int k;han=0,i;
      |             ^
main.c:9:14: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    9 |   if (s[i-1][strlen(s[i-1])]==s[i][0]){
      |              ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | int main (){
main.c:9:14: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    9 |   if (s[i-1][strlen(s[i-1])]==s[i][0]){
      |              ^~~~~~
main.c:9:14: note: include '<string.h>' or provide a declaration of 'strlen'
Language: C++

# https://atcoder.jp/contests/abc109/tasks/abc109_b

N = int(input())

words = {}
last_w = ""

for _ in range(N):
    w = input()
    if w in words:
        print("No")
        exit()
    else:
        if len(last_w) == 0 or last_w == w[0]:
            words[w] = True
            last_w = w[-1]
        else:
            print("No")
            exit()

print("Yes")



Compiler output:
a.cc:1:3: error: invalid preprocessing directive #https
    1 | # https://atcoder.jp/contests/abc109/tasks/abc109_b
      |   ^~~~~
a.cc:3:1: error: 'N' does not name a type
    3 | N = int(input())
      | ^
a.cc:6:1: error: 'last_w' does not name a type
    6 | last_w = ""
      | ^~~~~~
Language: C

#include<stdio.h>
int main(){
  int N,ans = 1;
  scanf("%d",&N);
  int W[N][10];
  for(int i = 0;i < N;i++){
    scanf("%d",%W[i]);
    if(i != 0){
      for(int j = 0;j < i;j++){
        if(W[i] == W[j] \\ W[i][strlen(W[i])] != W[j][0]){
          ans = 0;
        }
      }
    }
  }
  if(ans == 1){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:16: error: expected expression before '%' token
    7 |     scanf("%d",%W[i]);
      |                ^
main.c:10:25: error: stray '\' in program
   10 |         if(W[i] == W[j] \\ W[i][strlen(W[i])] != W[j][0]){
      |                         ^
main.c:10:26: error: stray '\' in program
   10 |         if(W[i] == W[j] \\ W[i][strlen(W[i])] != W[j][0]){
      |                          ^
main.c:10:24: error: expected ')' before 'W'
   10 |         if(W[i] == W[j] \\ W[i][strlen(W[i])] != W[j][0]){
      |           ~            ^   ~
      |                        )
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  cin>>n;
  bool ans=true;
    vector(string) vec{n};
  for(int i=0;i<n;i++){
    cin>>vec{i};
    if (i>=1){
      if(vec{i}==vec{i-1}){ans=false;
                           break;}
      if(vec{i-1}[vec{i}.size]==vec{i}[1]){
        ans=false;
        break;}
    }
    if(ans)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
     
      
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: missing template arguments before '(' token
   10 |     vector(string) vec{n};
      |           ^
a.cc:10:18: error: expected primary-expression before ')' token
   10 |     vector(string) vec{n};
      |                  ^
a.cc:12:10: error: 'vec' was not declared in this scope
   12 |     cin>>vec{i};
      |          ^~~
a.cc:14:13: error: expected ')' before '{' token
   14 |       if(vec{i}==vec{i-1}){ans=false;
      |         ~   ^
      |             )
a.cc:16:13: error: expected ')' before '{' token
   16 |       if(vec{i-1}[vec{i}.size]==vec{i}[1]){
      |         ~   ^
      |             )
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

int main()
{
  int n;
  cin>>n;
  bool ans=true;
    vector(string) vec{n};
  for(int i=0;i<n;i++){
    cin>>vec{i};
    if (i>=1){
      if(vec{i}==vec{i-1}){ans=false;
                           break;}
      if(vec{i-1}[vec{i}.size]==vec{i}[1]){
        ans=false;
        break;}
    }
    if(ans)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
     
      
}



Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin>>n;
      |   ^~~
a.cc:6:12: error: 'string' was not declared in this scope
    6 |     vector(string) vec{n};
      |            ^~~~~~
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector(string) vec{n};
      |     ^~~~~~
a.cc:8:10: error: 'vec' was not declared in this scope
    8 |     cin>>vec{i};
      |          ^~~
a.cc:10:13: error: expected ')' before '{' token
   10 |       if(vec{i}==vec{i-1}){ans=false;
      |         ~   ^
      |             )
a.cc:12:13: error: expected ')' before '{' token
   12 |       if(vec{i-1}[vec{i}.size]==vec{i}[1]){
      |         ~   ^
      |             )
a.cc:16:12: error: 'cout' was not declared in this scope
   16 |     if(ans)cout<<"Yes"<<endl;
      |            ^~~~
a.cc:16:25: error: 'endl' was not declared in this scope
   16 |     if(ans)cout<<"Yes"<<endl;
      |                         ^~~~
a.cc:17:10: error: 'cout' was not declared in this scope
   17 |     else cout<<"No"<<endl;
      |          ^~~~
a.cc:17:22: error: 'endl' was not declared in this scope
   17 |     else cout<<"No"<<endl;
      |                      ^~~~
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:2:1: note: to match this '{'
    2 | {
      | ^
Language: Java

import java.util.*;
class Main {
	public static void main(String args[]) {
    	Scanner s = new Scanner(System.in);
      	int n = s.nextInt();
      	String prevWord = null;
      	String currWord = null;
		Set<String> s = new HashSet<>();
      	boolean isValid = true;
      	for(int i = 0; i< n ;i++) {
        	currWord = s.nextLine();
          	if(s.contains(currWord)) {
            	isValid = false;
            }
          	if( isValid && i != 0 ) {
            	if(prevWord.charAt(prevWord.length() - 1) != currWord.charAt(0)) {
                	isValid = false;
                }
            }
            prevWord = currWord;
        }
                  System.out.println(isValid ? "Yes" : "No");
    }
}

Compiler output:
Main.java:8: error: variable s is already defined in method main(String[])
		Set<String> s = new HashSet<>();
		            ^
Main.java:11: error: cannot find symbol
        	currWord = s.nextLine();
        	            ^
  symbol:   method nextLine()
  location: variable s of type Set<String>
2 errors
Language: C++

#include "bits/stdc++.h"
using namespace std;
using ll = long long; using ull = unsigned long long;
using vb = vector<bool>;
using vi = vector<int>; using vvi = vector<vector<int>>;
using vl = vector<ll>; using vvl = vector<vector<ll>>;
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
//#define int ll
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
signed main(){
  int n;
  cin >> n;
  set<string> st;
  char last = '1';
  bool ans = true;
  REP(i,n){
    string tmp;
    cin >> tmp;
    if(st.find(tmp)!=st.end()) ans = false;
    if(last==tmp.front()) ans = false;
    st.push(tmp);
    last = tmp.back();
  }
  cout << (ans?"Yes":"No") << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:8: error: 'class std::set<std::__cxx11::basic_string<char> >' has no member named 'push'
   32 |     st.push(tmp);
      |        ^~~~
Language: C

#include<stdio.h>
#include<string.h>

char list[100][11], p = 0; 
int check(char*s){
  int i;
  for (i = 0; i < p; i++){
    if(strcmp(s, list[i]) == 0){
      return 0;
    }
  }
  strcpy(list[p++], s);
  return 1;
}

int main(){
  int N, len, flag = 1;
  char W[100][11];
  
  scanf("%d", &N);
  for (i = 0; i < N; i++){
    scanf("%s", W[i]);
    if(i > 0){
      if(W[i][0] != W[i - 1][len - 1]){
        flag = 0;
      }
    }
    len = strlen(W[i]);
    if(check(W[i]) == 0){
      flag = 0;
    }
  }
  
  if(flag == 1){
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:8: error: 'i' undeclared (first use in this function)
   21 |   for (i = 0; i < N; i++){
      |        ^
main.c:21:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <cmath>
#include <map>
using namespace std;
typedef long long LL;

int main() {
    int n;
    string s, t;
    cin >> n;
    cin >> s;
    bool flg = true;
    for (int i = 1; i < n; i++) {
        cin >> t;
        if (s[length(s)-1] != t[0]) {
            flg = false;
            break;
        }
        s = t;
    }
    if (flg) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'length' was not declared in this scope
   22 |         if (s[length(s)-1] != t[0]) {
      |               ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int N;
char s[101][101];
int main()
{
  scanf("%d", &N);
  for(int i=0; i<N; ++i)
    scanf("%s", s[i]);
  for(int i=0; i<N-1; ++i)
  {
    if( s[i][strlen(s)-1] != s[i+1][0])
    {
      puts("No");
      return 0;
    }
  }
  for(int i=0; i<N; ++i)
    for(int j=0; j<N; ++j)
      if(0 == strcmp(i, j))
      {
        puts("No");
        return 0;
      }
  puts("Yes");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: cannot convert 'char (*)[101]' to 'const char*'
   12 |     if( s[i][strlen(s)-1] != s[i+1][0])
      |                     ^
      |                     |
      |                     char (*)[101]
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:20:22: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   20 |       if(0 == strcmp(i, j))
      |                      ^
      |                      |
      |                      int
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:20:25: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   20 |       if(0 == strcmp(i, j))
      |                         ^
      |                         |
      |                         int
/usr/include/string.h:156:50: note:   initializing argument 2 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
      	//データ取り込み
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
      	boolean flg = true;
		String words[] = new String[N];
      	for(int i=0;i<N;i++){
        	words[i] = sc.next();
        }
      	ArrayList<String> list = new ArrayList<String>();
      	list.add(words[i]);
      	for(int i=0;i<N-1;i++){
        	if(words[i].charAt(words[i].length()-1)!=words[i+1].charAt(0)||list.contains(words[i+1])){
                System.out.println("No");
                flg = false;
                break;
             }else{
                list.add(words[i+1]);
            }
        }
      	if(flg){
        	System.out.println("Yes");
        }
    }
}


Compiler output:
Main.java:13: error: cannot find symbol
      	list.add(words[i]);
      	               ^
  symbol:   variable i
  location: class Main
1 error
Language: C++

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<bitset>
#include<queue>
#include<set>
#include<map>
using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define ROF(i,b,a) for (int i=(b);i>(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,n-1,-1)

typedef int i32;
typedef long long int i64;
typedef unsigned long long int ui64;
typedef float f32;
typedef double f64;
typedef long double f128;
typedef pair<int,int> Pi;

constexpr int INF = 1e9 + 7;
constexpr int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};

int main() {
    int N; cin>>N;
    string W[N]; REP(i,N) cin>>W[i];
    REP(i,N-1) {
        mae = W[i];
        ato = W[i+1];
        if (mae[mae.size()-1]!=ato[0]) {
            cout<<"No"<<endl;
            return 0;
        }
        REP(j,i) {
            if (W[i+1]==W[j]) {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: 'mae' was not declared in this scope
   33 |         mae = W[i];
      |         ^~~
a.cc:34:9: error: 'ato' was not declared in this scope; did you mean 'atol'?
   34 |         ato = W[i+1];
      |         ^~~
      |         atol
Language: C++

#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<string> word(n);
  for(int i=0;i<n;i++){
    cin >> word[i];
  }
  int cnt=0;
  for(int i=0;i<n-1;i++){
    if(word[i][word[i].size()-1]==word[i+1][0]) cnt++;
    else break;
  }
  if(cnt==n-1){
    sort(word.begin(),word.end());
    int cnt=0;
    for(int i=0;i<n-1;i++){
      if(word[i]==word[i+1]){
	cout << "No\n";
	break;
      }
      else cnt++;
    }
    if(cnt==n-1) cout << "Yes\n";
  }
  else cout << "No\n";

  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |     sort(word.begin(),word.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <vector>

int main() {
    int N;
    std::cin >> N;
    
    std::string temp;
    char tail;
    char head;
    std::vector<std::string> words;
    bool win = true;
    for (auto i=0; i<N; ++i) {
        std::cin >> temp;
        auto find_iter = std::find(words.begin(), words.end(), temp);
        if (find_iter != words.end()) {
            win = false;
            break;
        }
        words.push_back(temp);
        head = temp.front();
        if (i != 0) {
            if (head != tail) {
                win = false;
                break;
            }
        }
        tail = temp.back();
    }
    if (win) std::cout << "Yes" << std::endl;
    else std::cout << "No" << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:35: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)'
   15 |         auto find_iter = std::find(words.begin(), words.end(), temp);
      |                          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:15:35: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   15 |         auto find_iter = std::find(words.begin(), words.end(), temp);
      |                          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  
  int N;
  cin >> N;
  vector<string> wor(N);
  
  for(int i=0; i<N; i++){
    cin >> wor.at(i);
  }
  
  bool nocnt, same;

  for(int i=0; i<(N-1); i++){
    if(wor.at(i).at(wor.at(i).size()-1) != wor.at(i+1).at(0)){ nocnt=true; break;}
    for(int j=i; j<N; j++){
      if(wor.at(i)==wor.at(j)){
        same = true;
        break;
      }
    }
  }
  
  if(!nocnt && !same){ cout << "Yes" << endl; }
  else{ cout << "No" << endl; }
  cout << mocnt << endl << same << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:11: error: 'mocnt' was not declared in this scope; did you mean 'nocnt'?
   28 |   cout << mocnt << endl << same << endl;
      |           ^~~~~
      |           nocnt
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int N = Integer.parseInt(sc.next());
    int[] W = new int[N];
    for (int i=0; i<N; i++) {
      W[i] = sc.nextLine();
    }
    
    
    for (int i=1; i<N; i++) {
      for (int j=0; j<i; j++) {
        if (W[i].equals(W[j])) {
          System.out.println("No");
          return;
        }
      }
      
      char lastChar = W[i-1].charAt(W[i-1].length()-1);
      if (!W[i].startsWith(String.valueOf(lastChar)) {
        System.out.println("No");
        return;
      }
    }
    
    System.out.println("Yes");
    
  }
}

Compiler output:
Main.java:23: error: ')' expected
      if (!W[i].startsWith(String.valueOf(lastChar)) {
                                                    ^
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int N = Integer.parseInt(sc.next());
    int[] W = new int[N];
    for (int i=0; i<N; i++) {
      W[i] = sc.nextLine();
    }
    
    
    for (int i=1; i<N; i++) {
      for (int j=0; j<i; j++) {
        if (W[i].equals(W[j])) {
          System.out.println("No");
          return;
        }
      }
      
      char lastChar = W[i-1].charAt(W[i-1].length()-1);
      if (!W[i].startsWith(lastChar)) {
        System.out.println("No");
        return;
      }
    }
    
    System.out.println("Yes");
    
  }
}

Compiler output:
Main.java:10: error: incompatible types: String cannot be converted to int
      W[i] = sc.nextLine();
                        ^
Main.java:16: error: int cannot be dereferenced
        if (W[i].equals(W[j])) {
                ^
Main.java:22: error: int cannot be dereferenced
      char lastChar = W[i-1].charAt(W[i-1].length()-1);
                                          ^
Main.java:22: error: int cannot be dereferenced
      char lastChar = W[i-1].charAt(W[i-1].length()-1);
                            ^
Main.java:23: error: int cannot be dereferenced
      if (!W[i].startsWith(lastChar)) {
               ^
5 errors
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
using namespace std;

int main()
{
  int n;
  cin >> n;
  vector<string> s(n);
  set<int> ki;
  bool f = true;
  for(int i = 0; i < n; i++){
    cin >> s[i];
    if(ki.find(s[i] != ki.end()){
      f = false;
      break;
    }
    else{
      ki.insert(s[i]);
    }
  }
  for(int i = 1; i < n; i++){
    int m = s[i - 1].size();
    if(s[i - 1][m - 1] != s[i][0]){
      f = false;
      break;
    }
  }
}    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'set' was not declared in this scope
   12 |   set<int> ki;
      |   ^~~
a.cc:5:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    4 | #include <unordered_set>
  +++ |+#include <set>
    5 | using namespace std;
a.cc:12:7: error: expected primary-expression before 'int'
   12 |   set<int> ki;
      |       ^~~
a.cc:16:8: error: 'ki' was not declared in this scope; did you mean 'i'?
   16 |     if(ki.find(s[i] != ki.end()){
      |        ^~
      |        i
a.cc:16:33: error: expected ')' before '{' token
   16 |     if(ki.find(s[i] != ki.end()){
      |       ~                         ^
      |                                 )
a.cc:23:3: error: expected primary-expression before '}' token
   23 |   }
      |   ^
Language: C++

#include <iostream>
#include <vector>
#include <string>

#define Yes cout << "Yes" << endl
#define No cout << "No" << endl

using namespace std;

int main(void) {
	int N; cin >> N;
	vector<string> W;
	for (int i = 0; i < N; i++) {
		string w; cin >> w;
		if (i != 0 && w.front() != W.at(i-1).back() {
			No; return 0;
		}
		for (auto j:W)
			if (j == w) {
				No; return 0;
			}
		W.push_back(w);
	}

	Yes;
	//for (auto i : W) cout << i << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:60: error: expected ';' before '{' token
   15 |                 if (i != 0 && w.front() != W.at(i-1).back() {
      |                                                            ^~
      |                                                            ;
a.cc:18:17: error: expected primary-expression before 'for'
   18 |                 for (auto j:W)
      |                 ^~~
a.cc:17:18: error: expected ')' before 'for'
   17 |                 }
      |                  ^
      |                  )
   18 |                 for (auto j:W)
      |                 ~~~
a.cc:15:20: note: to match this '('
   15 |                 if (i != 0 && w.front() != W.at(i-1).back() {
      |                    ^
Language: C++

import sys
# N,M = [int(n) for n in input().split()]
# S = str(input())
# T = str(input())

N = int(input())
SS = [0]*N
s = set()
SS[0] = str(input())
for i in range(1,N):
    SS[i] = str(input())
    if(SS[i] in s):
        print('No')
        sys.exit()
    s.add(SS[i])
for i in range(1,N):
    if(SS[i-1][-1] != SS[i][0]):
        print('No')
        sys.exit()
print('Yes')


Compiler output:
a.cc:2:3: error: invalid preprocessing directive #N
    2 | # N,M = [int(n) for n in input().split()]
      |   ^
a.cc:3:3: error: invalid preprocessing directive #S
    3 | # S = str(input())
      |   ^
a.cc:4:3: error: invalid preprocessing directive #T
    4 | # T = str(input())
      |   ^
a.cc:13:15: warning: multi-character character constant [-Wmultichar]
   13 |         print('No')
      |               ^~~~
a.cc:18:15: warning: multi-character character constant [-Wmultichar]
   18 |         print('No')
      |               ^~~~
a.cc:20:7: warning: multi-character character constant [-Wmultichar]
   20 | print('Yes')
      |       ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'