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

#include<bits/stdc++.h>
using namespace std;
g string s[105]; // 定义了数组 s, 每个数组元素存放的是一个字符串（单词）
int n;
int main(){
cin>>n;
for(int i=1;i<=n;i++)cin>>s[i];
for(int i=2;i<=n;i++){
if(s[i][0]!=s[i-1][s[i-1].size()-1])//s[i]代表当前单词
{ cout<<"No"<<endl;return 0;}//第二个条件
}
for(int i=1;i<n;i++)
for(int j=i+1;j<=n;j++)
{
if(s[i]==s[j]){ cout<<"No"<<endl;return 0;}//第一个条件
}
cout<<"Yes"<<endl;
return 0;
}

Compiler output:
a.cc:3:1: error: 'g' does not name a type
    3 | g string s[105]; // 定义了数组 s, 每个数组元素存放的是一个字符串（单词）
      | ^
a.cc: In function 'int main()':
a.cc:7:27: error: 's' was not declared in this scope
    7 | for(int i=1;i<=n;i++)cin>>s[i];
      |                           ^
a.cc:9:4: error: 's' was not declared in this scope
    9 | if(s[i][0]!=s[i-1][s[i-1].size()-1])//s[i]代表当前单词
      |    ^
a.cc:15:4: error: 's' was not declared in this scope
   15 | if(s[i]==s[j]){ cout<<"No"<<endl;return 0;}//第一个条件
      |    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
g string s[105];
int n;
int main(){
cin>>n;
for(int i=1;i<=n;i++)cin>>s[i];
for(int i=2;i<=n;i++){
if(s[i][0]!=s[i-1][s[i-1].size()-1])
{ cout<<"No"<<endl;return 0;}
}
for(int i=1;i<n;i++)
for(int j=i+1;j<=n;j++)
{
if(s[i]==s[j]){ cout<<"No"<<endl;return 0;}
}
cout<<"Yes"<<endl;
return 0;

Compiler output:
a.cc:3:1: error: 'g' does not name a type
    3 | g string s[105];
      | ^
a.cc: In function 'int main()':
a.cc:7:27: error: 's' was not declared in this scope
    7 | for(int i=1;i<=n;i++)cin>>s[i];
      |                           ^
a.cc:9:4: error: 's' was not declared in this scope
    9 | if(s[i][0]!=s[i-1][s[i-1].size()-1])
      |    ^
a.cc:15:4: error: 's' was not declared in this scope
   15 | if(s[i]==s[j]){ cout<<"No"<<endl;return 0;}
      |    ^
a.cc:18:10: error: expected '}' at end of input
   18 | return 0;
      |          ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main(){
	int N;
    cin >> N;
  
  	map<string,int> mp;
  	
  	string pre;
  	cin >> pre;
  
  	for(int i = 0;i < N-1;i++){
      string s;
      cin >> s;
      if(mp[s] || pre[sz(pre)-1] != s[0]){
		cout << "No" << endl;
		return 0;
      }else{
		mp[s]++;
      }
      pre = s;
    }
  
  	cout << "Yes" << endl;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: 'sz' was not declared in this scope; did you mean 's'?
   16 |       if(mp[s] || pre[sz(pre)-1] != s[0]){
      |                       ^~
      |                       s
Language: C++

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

int main(){
	int N;
    cin >> N;
  
  	map<string,int> mp;
  	
  	string pre;
  	cin >> pre;
  
  	rep(i,N-1){
      string s;
      cin >> s;
      if(mp[s] || pre[sz(pre)-1] != s[0]){
		cout << "No" << endl;
		return 0;
      }else{
		mp[s]++;
      }
      pre = s;
    }
  
  	cout << "Yes" << endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'i' was not declared in this scope
   13 |         rep(i,N-1){
      |             ^
a.cc:13:9: error: 'rep' was not declared in this scope
   13 |         rep(i,N-1){
      |         ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())

signed main(){
  int n;
  cin>>n;
  int a=0;
  V<string> w(n),b;
  fo(i,n){
    cin>>w[i];
  }
  w=b;
  Sort(w);
  fo(i,n-1){
    if(w[i]==w[i+1]){
      cout<<"No"<<endl;
      break;
    }
  }
  fo(i,n-1){
    if(b[i][b[i].size()-1]!=b[i+1][0]){
      d=1;
      break;
    }
  }
  if(d)
    cout<<"No"<<endl;
  else
    cout<<"Yes"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:7: error: 'd' was not declared in this scope
   41 |       d=1;
      |       ^
a.cc:45:6: error: 'd' was not declared in this scope
   45 |   if(d)
      |      ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <stack>
#include <math.h>

using namespace std;

typedef long long int ll;
typedef long double ld;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define vsort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())

const int MOD = 1000000007;
const int INF = INT_MAX;



int main(){

    int n;
    cin >> n;
    string w[n];
    rep(i, n) cin >> w[i];

    int flag = 1;

    rep(i, n-1){
        if (w[i].back() != w[i+1].front()) flag = 0;
    }

    for (int i=0; i < n-1; i++){
        for (int j=i+1; j < n; j++){
            if (w[i] == w[j]) flag = 0;
        }
    }

    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;

}





//              g++ -std=c++1z

Compiler output:
a.cc:17:17: error: 'INT_MAX' was not declared in this scope
   17 | const int INF = INT_MAX;
      |                 ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <math.h>
  +++ |+#include <climits>
    6 |
Language: C++

# include < iostream >
# include < vector >
using namespace std ;
bool solve ( const vector < string >& W ) {
const int n = W . size ();
// condition 1
for ( int i = 0; i < n -1; ++ i ) {
if ( W [ i ]. back () != W [ i +1]. front ()) {
return false ;
}
}
// condition 2
for ( int i = 0; i < n ; ++ i ) {
for ( int j = i +1; j < n ; ++ j ) {
if ( W [ i ] == W [ j ]) {
return false ;
}
}
}
return true ;
}
vector < string > input () {
int n; cin >> n ;
vector < string > W ( n );
for ( int i = 0; i < n ; ++ i ) {
cin >> W [ i ];
}
return W ;
}

Compiler output:
a.cc:1:11: fatal error:  iostream : No such file or directory
    1 | # include < iostream >
      |           ^~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {

    int N;
    cin >> N;
  vector<string> A(N);
 map<string,int> m;
  for(int i=0;i<N;i++){
    cin>>A[i];
    if(!m.count(A[i])) m[A[i]]=1;
    else {cout<<"No"<<endl;break;}
    if(A[i][A[i].size()-1]!=A[i+1][0]&&i<N-1){cout<<"No"<<endl;break;}
    if(i==N-1)cout<<"Yes"<<endl;
}
  
    


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

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

int main() {

    int N;
    cin >> N;
  vector<string> A(N);
 map<string,int> m;
  for(int i=0;i<N;i++){
    cin>>A[i];
    if(!m.count(tmp)) m[A[i]]=1;
    else {cout<<"No"<<endl;break;}
    if(A[i][A[i].size()-1]!=A[i+1][0]&&i<N-1){cout<<"No"<<endl;break;}
    if(i==N-1)cout<<"Yes"<<endl;
}
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   13 |     if(!m.count(tmp)) m[A[i]]=1;
      |                 ^~~
      |                 tm
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C

# -*- coding: utf-8 -*-
n = int(input())
w = []
for i in range(n):
    w.append(str(input()))

count = n
for i in range(n - 1):
    for j in range(i + 1, n):
        if w[i] == w[j]:
            count = 0

for i in range(n - 1):
    s1 = list(w[i])
    s2 = list(w[i + 1])
    #print(s1)
    #print(s2)
    if s1[len(s1) - 1] != s2[0]:
        #print(i)
        count = 0

if count == n:
    print("Yes")
else:
    print("No")


Compiler output:
main.c:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
main.c:2:1: warning: data definition has no type or storage class
    2 | n = int(input())
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:2:5: error: expected expression before 'int'
    2 | n = int(input())
      |     ^~~
main.c:16:6: error: invalid preprocessing directive #print
   16 |     #print(s1)
      |      ^~~~~
main.c:17:6: error: invalid preprocessing directive #print
   17 |     #print(s2)
      |      ^~~~~
main.c:19:10: error: invalid preprocessing directive #print
   19 |         #print(i)
      |          ^~~~~
Language: C++

√#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
    int n;
    cin >> n;
    string S[n];
    set <string> s;
    for(int i=0;i<n;++i) cin >> S[i];
    s.insert(S[0]);
    bool ok=true;
    for(int i=1;i<n;++i) {
        if(S[i-1].back()!=S[i][0]) ok=false;
        if(s.count(S[i])) ok=false;
        s.insert(S[i]);
    }
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Compiler output:
a.cc:1:1: error: extended character √ is not valid in an identifier
    1 | √#include <bits/stdc++.h>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | √#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: '\U0000221a' does not name a type
    1 | √#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> n;
      |     ^~~
a.cc:7:5: error: 'string' was not declared in this scope
    7 |     string S[n];
      |     ^~~~~~
a.cc:8:5: error: 'set' was not declared in this scope
    8 |     set <string> s;
      |     ^~~
a.cc:8:18: error: 's' was not declared in this scope
    8 |     set <string> s;
      |                  ^
a.cc:9:33: error: 'S' was not declared in this scope
    9 |     for(int i=0;i<n;++i) cin >> S[i];
      |                                 ^
a.cc:10:14: error: 'S' was not declared in this scope
   10 |     s.insert(S[0]);
      |              ^
a.cc:17:12: error: 'cout' was not declared in this scope
   17 |     if(ok) cout << "Yes" << endl;
      |            ^~~~
a.cc:17:29: error: 'endl' was not declared in this scope
   17 |     if(ok) cout << "Yes" << endl;
      |                             ^~~~
a.cc:18:10: error: 'cout' was not declared in this scope
   18 |     else cout << "No" << endl;
      |          ^~~~
a.cc:18:26: error: 'endl' was not declared in this scope
   18 |     else cout << "No" << endl;
      |                          ^~~~
Language: C++

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

int main(){
	int N;
    cin >> N;
	vector<string> siri(N);
    for(int i = 0 ; i < N ; i ++){
    	cin >> siri[i];
        if(i && siri[i - 1][siri[i - 1].length] == siri[i][0])
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:28: error: invalid use of non-static member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
   12 |         if(i && siri[i - 1][siri[i - 1].length] == siri[i][0])
      |                            ^
In file included from /usr/include/c++/14/string:54,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1083:7: note: declared here
 1083 |       length() const _GLIBCXX_NOEXCEPT
      |       ^~~~~~
a.cc:13:5: error: expected primary-expression before '}' token
   13 |     }
      |     ^
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<sstream>
#include<utility>
#include<map>
#include<ctime>
#include<cstdio>
#include<cassert>
#include<functional>
#include<unordered_map>
#include<deque>




using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;
typedef pair<double, double> pdd;

#define show(x) cerr << x
#define debug(x) show(#x << ": " << (x) << endl)

const long double PI = 3.14159265358979323846;
const long double eps = 1e-5;
const ll INF = numeric_limits<int>::max();
const ll LINF = numeric_limits<ll>::max();
const ll mod = 1000 * 1000 * 1000 + 7;



void solve() {
    int n;
    cin >> n;
    vector<string> a(n);
    for (int i = 0; i < n; ++i)
        cin >> a[i];
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            if (a[i] == a[j]) {
                cout << "No\n";
                return;
            }
        }
    }
    for (int i = 0; i + 1 < n; ++i) {
        if (a[i].last() != a[i + 1][0]) {
            cout << "No\n";
            return;
        }
    }
    cout << "Yes\n";
}


//#define LOCAL

int main() {
    ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    solve();



#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif	
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:62:18: error: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'last'; did you mean 'at'?
   62 |         if (a[i].last() != a[i + 1][0]) {
      |                  ^~~~
      |                  at
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        // 標準入力の取得
        int N = Integer.parseInt(scan.next());

        String[] W = new String[N];
        for (int i = 0; i < N; i++) {
            W[i] = scan.next();
        }
        scan.close();

        // 重複チェック
        Set<String> Wst = new HashSet<String>(Arrays.asList(W));
        if(!(Wst.size() == W.size())){
            System.out.println("No");
            return ;
        }
        
        // しりとりできてるかチェック
        for (int i = 0; i < N-1; i++) {
            if(W.get(i).charAt(W.get(i).length() - 1) != W.get(i+1).charAt(0)){
                System.out.println("No");
                return ; 
            }
        }
        System.out.println("Yes");
        return ; 
    }
}


Compiler output:
Main.java:18: error: cannot find symbol
        if(!(Wst.size() == W.size())){
                            ^
  symbol:   method size()
  location: variable W of type String[]
Main.java:25: error: cannot find symbol
            if(W.get(i).charAt(W.get(i).length() - 1) != W.get(i+1).charAt(0)){
                                ^
  symbol:   method get(int)
  location: variable W of type String[]
Main.java:25: error: cannot find symbol
            if(W.get(i).charAt(W.get(i).length() - 1) != W.get(i+1).charAt(0)){
                ^
  symbol:   method get(int)
  location: variable W of type String[]
Main.java:25: error: cannot find symbol
            if(W.get(i).charAt(W.get(i).length() - 1) != W.get(i+1).charAt(0)){
                                                          ^
  symbol:   method get(int)
  location: variable W of type String[]
4 errors
Language: C++

# include < iostream >
# include < vector >
using namespace std ;
bool solve ( const vector < string >& W ) {
const int n = W . size ();
// condition 1
for ( int i = 0; i < n -1; ++ i ) {
if ( W [ i ]. back () != W [ i +1]. front ()) {
return false ;
}
}
// condition 2
for ( int i = 0; i < n ; ++ i ) {
for ( int j = i +1; j < n ; ++ j ) {
if ( W [ i ] == W [ j ]) {
return false ;
}
}
}
return true ;
}
vector < string > input () {
int n; cin >> n ;
vector < string > W ( n );
for ( int i = 0; i < n ; ++ i ) {
cin >> W [ i ];
}
return W ;
}
int main () {
const vector < string > W = input ();
if ( solve ( W )) {
cout << " Yes " << endl ;
}
else {
cout << "No" << endl ;
}
}

    

Compiler output:
a.cc:1:11: fatal error:  iostream : No such file or directory
    1 | # include < iostream >
      |           ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstring>
#include <string>
using namespace std;
const int N=100+10;
char a[N][15];
int main()
{
	int n;
	bool pd=true;
	cin>>n;
	memset(a,0,sizeof(a));
	for(int i=0;i<n;i++)
		cin>>a[i];
	for(int i=0;i<n-1;i++)
	{
		int l=strlen(a[i]);
		if(a[i][l-1]!=a[i+1][0])
		{
			cout<<"No";
			pd=false; 
			break;
		}	
		for(int j=i+1;j<n;j++)
		{
			if(strcmp(a[i],a[j])==0)
			{
				cout<<"No";
				pd=false;
				break;
			}
		} 
	}
	if(pd)
	cout<<"Yes";	
    return 0；		
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:12: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   36 |     return 0；
      |            ^~~
a.cc:36:16: error: expected ';' before '}' token
   36 |     return 0；
      |               ^ 
      |                ;
   37 | }
      | ~
Language: Java

import java.util.*;
public class Shiritori
{
 public static List<String> theGame(List<String> words)
  {
    List<String> result = new ArrayList<>();
    if(words.size() == 0 || words.get(0).equals("")) return result;
    result.add(words.get(0));
    for(int i = 1; i < words.size(); i++) {
      String prev = words.get(i-1), curr = words.get(i);
      if(curr.equals("")) break;
      if(curr.charAt(0) == prev.charAt(prev.length()-1)) {
        result.add(curr);
      }
      else {
        break;
      }
    } 
    return result;
  }
}

Compiler output:
Main.java:2: error: class Shiritori is public, should be declared in a file named Shiritori.java
public class Shiritori
       ^
1 error
Language: Java

#incimport java.util.*;
class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int N=scan.nextInt();
    scan.nextLine();
    String[] W=new String[N];
    for(int i=0;i<N;i++){
      W[i]=scan.nextLine();
    }
    
    for(int i=0;i<N-1;i++){
      for(int j=i+1;j<N;j++){
        if(W[i].equals(W[j])){
          System.out.println("No");
          System.exit(0);
        }
      }
    }
      for(int i=0;i<N-1;i++){
        int j=i+1;
        String A=W[i].substring(W[i].length()-1);
        String B=W[j].substring(0,1);
        if(!A.equals(B)){
          System.out.println("No");
          System.exit(0);
        }
      }
      System.out.println("Yes");
    }
  }


Compiler output:
Main.java:1: error: illegal character: '#'
#incimport java.util.*;
^
Main.java:1: error: class, interface, enum, or record expected
#incimport java.util.*;
           ^
2 errors
Language: Java

#incimport java.util.*;
class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int N=scan.nextInt();
    scan.nextLine();
    String[] W=new String[N];
    for(int i=0;i<N;i++){
      W[i]=scan.nextLine();
    }
    
    for(int i=0;i<N-1;i++){
      for(int j=i+1;j<N;j++){
        if(W[i].equals(W[j])){
          System.out.println("No");
          System.exit(0);
        }
      }
    }
      for(int i=0;i<N-1;i++){
        int j=i+1;
        String A=W[i].substring(W[i].length()-1);
        String B=W[j].substring(0,1);
        String B_end=W[j].substring(W[j].length()-1);
        if(!A.equals(B)){
          System.out.println("No");
          System.exit(0);
        }
      }
      System.out.println("Yes");
    }
  }


Compiler output:
Main.java:1: error: illegal character: '#'
#incimport java.util.*;
^
Main.java:1: error: class, interface, enum, or record expected
#incimport java.util.*;
           ^
2 errors
Language: C++

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

signed main(){
  int n;
  cin>>n;
  map<string,int> mp;
  int a[30]={};
  rep(i,n){
    string s;
    cin>>s;
    mp[s]++;
    a[s[0]-'a']++;
    a[s[s.size()-1]-'a']++;
  }

  bool flag=true;
  for(auto m:mp){

    flag&=(m.S>1);
  }

  int count=0;
  rep(i,30){
    if(a[i]%2) count++;
  }

  if(flag&count<=2) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: 'struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 'S'
   21 |     flag&=(m.S>1);
      |              ^
Language: C++

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

signed main(){
  int n;
  cin>>n;
  map<string,int> mp;
  int a[30]={};
  rep(i,n){
    string s;
    cin>>s;
    mp[s]++;
    a[s[0]-'a']++;
    a[s[s.size()-1]-'a']++;
  }

  bool flag=true;
  for(auto m:mp){

    flag&=(m.S>1);
  }

  int count=0;
  rep(i,30){
    if(a[i]%2) count++;
  }

  if(flag&count<=2) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   rep(i,n){
      |       ^
a.cc:9:3: error: 'rep' was not declared in this scope
    9 |   rep(i,n){
      |   ^~~
a.cc:20:14: error: 'struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 'S'
   20 |     flag&=(m.S>1);
      |              ^
Language: C

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

int main()
{
    int n,j;
    bool out=true;
    cin>>n;
    string arr[n];
    for(int i=0;i<n;i++)
        cin>>arr[i];
     for(int i=0;i<n;i++)
     {
        if(arr[i]==arr[i+1])
                {cout<<"No";
                    out=false;}
         for(int j=i+1;j<n;j++)
			if(arr[i]==arr[j])
				{out=false;
				cout<<"no";}
     }
    if(out)
        cout<<"Yes";
    return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

void main()
{
    int n ,j;
    bool out=true;
    cin>>n;
    string arr[n];
    for(int i=0;i<n;i++)
        cin>>arr[i];
    for(int i=0;i<n;i++)
    {
        if(arr[i]==arr[i+1])
            {out=false;
            break;}

    for(j=i+1;j<n;j++)
    {
      if(arr[i]==arr[j])
      {
        out=false;
        break;
      }
    }
    }
    if(out)
        cout<<"Yes";
    else
        cout<<"No";
    //return 0;
}


Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main()
      | ^~~~
Language: C++

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

int main()
{
    int n;
    bool out=true;
    cin>>n;
    string arr[n];
    for(int i=0;i<n;i++)
        cin>>arr[i];
    for(int i=0;i<n;i++)
    {
        if(arr[i]==arr[i+1])
            {out=false;
            break;}

str
    for(int j=i+1;j<n;j++)
    {
      if(arr[i]==arr[j])
      {
        out=false;
        break;
      }
    }
    }
    if(out)
        cout<<"Yes";
    else
        cout<<"No";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:1: error: 'str' was not declared in this scope; did you mean 'std'?
   19 | str
      | ^~~
      | std
a.cc:20:19: error: 'j' was not declared in this scope
   20 |     for(int j=i+1;j<n;j++)
      |                   ^
Language: C++

#include <iostream>
#include <cstring>
#include <string>
using namespace std;
const int N=100+10;
char a[N][15];
int main()
{
	int n;
	bool pd=true;
	cin>>n;
	memset(a,0,sizeof(a));
	for(int i=0;i<n;i++)
		cin>>a[i];
	for(int i=0;i<n-1;i++)
	{
		int l=strlen(a[i]);
		if(a[i][l-1]!=a[i+1][0])
		{
			cout<<"No";
			pd=false; 
			break;
		}	
		for(int j=i+1;j<n;j++)
		{
			if(strcmp(a[i],a[j])==0)
			{
				cout<<"No";
				pd=false;
				break;
			}
		} 
	}
	if(pd)
	cout<<"Yes";	
    return 0；		


Compiler output:
a.cc: In function 'int main()':
a.cc:36:12: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   36 |     return 0；
      |            ^~~
a.cc:36:16: error: expected ';' at end of input
   36 |     return 0；
      |               ^ 
      |                ;
a.cc:36:16: error: expected '}' at end of input
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<string> vec(n);
  int count=0;
  for(int i=0;i<n;i++){
    cin>>W.at(i);
  }
  for(int i=0;i<n-1;i++){
    if(W.at(i).back()!=W.at(i+1).at(0)){
      count++;
      break;
    }
  }
  for(int i=0;i<n;i++){
    for(int j=i;j<n;j++){
      if(W.at(i)==W.at(j)){
        count++;
        break;
      }
    }
  }
  if(count>0){
    cout<<"No"<<endl;
    return 0;
  }
  cout<<"Yes"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'W' was not declared in this scope
   10 |     cin>>W.at(i);
      |          ^
a.cc:13:8: error: 'W' was not declared in this scope
   13 |     if(W.at(i).back()!=W.at(i+1).at(0)){
      |        ^
a.cc:20:10: error: 'W' was not declared in this scope
   20 |       if(W.at(i)==W.at(j)){
      |          ^
Language: C++

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

int main(){
  int n; cin >> n;
  vector<string> s(n);
  set<string> st;
  for(auto&e:s){cin >> e;st.insert(e);}
  if(st.size() != n){
    cout << "No" << endl;
    return 0;
  }
  for(int i = 1; i < n; ++i){
    if(s[i-1][(int)s[i-1].size() - 1] != s[i][0]){
      cout << "No" << endl; 
    }
  }
  cout << "Yes" << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:10: error: 'cin' was not declared in this scope
    5 |   int n; cin >> n;
      |          ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<string> s(n);
      |   ^~~~~~
a.cc:6:10: error: 'string' was not declared in this scope
    6 |   vector<string> s(n);
      |          ^~~~~~
a.cc:6:18: error: 's' was not declared in this scope
    6 |   vector<string> s(n);
      |                  ^
a.cc:7:3: error: 'set' was not declared in this scope
    7 |   set<string> st;
      |   ^~~
a.cc:7:15: error: 'st' was not declared in this scope; did you mean 'std'?
    7 |   set<string> st;
      |               ^~
      |               std
a.cc:10:5: error: 'cout' was not declared in this scope
   10 |     cout << "No" << endl;
      |     ^~~~
a.cc:10:21: error: 'endl' was not declared in this scope
   10 |     cout << "No" << endl;
      |                     ^~~~
a.cc:15:7: error: 'cout' was not declared in this scope
   15 |       cout << "No" << endl;
      |       ^~~~
a.cc:15:23: error: 'endl' was not declared in this scope
   15 |       cout << "No" << endl;
      |                       ^~~~
a.cc:18:3: error: 'cout' was not declared in this scope
   18 |   cout << "Yes" << endl;
      |   ^~~~
a.cc:18:20: error: 'endl' was not declared in this scope
   18 |   cout << "Yes" << endl;
      |                    ^~~~
Language: C++


#include <iostream>
#include <cstring>
#include <string>
using namespace std;
const int N=100+10;
char a[N][15];
int main()
{
	int n;
	bool pd=true;
	cin>>n;
	memset(a,0,sizeof(a));
	for(int i=0;i<n;i++)
		cin>>a[i];
	for(int i=0;i<n-1;i++)
	{
		int l=strlen(a[i]);
		if(a[i][l-1]!=a[i+1][0])
		{
			cout<<"No";
			pd=false; 
			break;
		}	
		for(int j=i+1;j<n;j++)
		{
			if(strcmp(a[i],a[j])==0)
			{
				cout<<"No";
				pd=false;
				break;
			}
		} 
	}
	if(pd)
	cout<<"Yes";	
    return 0；		
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:12: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   37 |     return 0；
      |            ^~~
a.cc:37:16: error: expected ';' before '}' token
   37 |     return 0；
      |               ^ 
      |                ;
   38 | }
      | ~
Language: C++

#include <iostream>
#include <cstring>
#include <string>
using namespace std;
const int N=100+10;
char a[N][15];
int main()
{
	int n;
	bool pd=true;
	cin>>n;
	memset(a,0,sizeof(a));
	for(int i=0;i<n;i++)
		cin>>a[i];
	for(int i=0;i<n-1;i++)
	{
		int l=strlen(a[i]);
		if(a[i][l-1]!=a[i+1][0])
		{
			cout<<"No";
			pd=false; 
			break;
		}	
		for(int j=i+1;j<n;j++)
		{
			if(strcmp(a[i],a[j])==0)
			{
				cout<<"No";
				pd=false;
				break;
			}
		} 
	}
	if(pd)
	cout<<"Yes";	
    return 0；		
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:12: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   36 |     return 0；
      |            ^~~
a.cc:36:16: error: expected ';' before '}' token
   36 |     return 0；
      |               ^ 
      |                ;
   37 | }
      | ~
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class JMain {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();

        List<String> list = new ArrayList<>();

        for (int i = 0; i < count; ++i)
            list.add(scanner.next());

        if (list.stream().distinct().count() < list.size()) {
            System.out.println("NO");
            return;
        }

        boolean isSuccess = true;
        for (int i = 1; i < list.size(); ++i) {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        }

        if (isSuccess)
            System.out.println("YES");
        else
            System.out.println("NO");
    }
}


Compiler output:
Main.java:5: error: class JMain is public, should be declared in a file named JMain.java
public class JMain {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
#define rep0(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define mREP(i,a,b) for (int i = a; i > (b); --i)
#define all(x) (x).begin(),(x).end()
const int INF = 1000000007;
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int main(){
  int n;
  cin >> n;
  vector<string>w(n);
  set<string>check;
  string temp;
  rep0(i,n){
    cin >> temp;
    check.insert(temp);
    w[i] = temp;
  }
  char now = w[0][0];
  bool ans = true;
  rep0(i,n){
    if(now != w[i][0])ans = false;
    now = w[i][w[i].size() - 1];
    cout << now << endl;
  }
  if(ans && check.size() == n)cout << "Yes";
  else cout << "No;
  return 0;
}

Compiler output:
a.cc:32:16: warning: missing terminating " character
   32 |   else cout << "No;
      |                ^
a.cc:32:16: error: missing terminating " character
   32 |   else cout << "No;
      |                ^~~~
a.cc: In function 'int main()':
a.cc:33:3: error: expected primary-expression before 'return'
   33 |   return 0;
      |   ^~~~~~
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  int n ;
  cin >>  n  ;
  vector<string> st(n) ;
 for(int i=0;i<n;i++){
  cin >> st.at(i) ;
 }
  
  bool cond = 1 ;
  
  for(int i=0 ; i<(n-1) ; i++){
    
    char target = st.at(i)[st.size()] ;
    if(target == st.at(i+1)[0]){
      next ;
    }else{
      cond = 0 ;
      break ;
    }
  }
  
  bool check = 1 ; 
  
  if(cond){
    for(int i=0; i<(n-1) ; i++){
      string tg = st.at(i) ;
      for(int j=i+1 ; j<(n-1) ; j++){
        if(tg == st.at(j)){
          check =0 ;
          break ; 
      }
    }
  }
  }
  
  if(cond && check)
    cout << "Yes" << endl ;
  else
    cout << "No" << endl ;
  
  return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: statement cannot resolve address of overloaded function
   20 |       next ;
      |            ^
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  int n ;
  cin >>  n  ;
  vector<string> st(n) ;
 for(int i=0;i<n;i++){
  cin >> st.at(i) ;
 }
  
  bool cond = 1 ;
  
  for(int i=0 ; i<(n-1) ; i++){
    
    char target = st.at(i)[st.size()] ;
    if(target == st.at(i+1)[0])
      next ;
    else{
      cond = 0 ;
      break ;
    }
  }
  
  bool check = 1 ; 
  
  if(cond){
    for(int i=0; i<(n-1) ; i++){
      string tg = st.at(i) ;
      for(int j=i+1 ; j<(n-1) ; j++){
        if(tg == st.at(j)){
          check =0 ;
          break ; 
        }else{
          next ;
        }
      }
    }
  }
  
  if(cond && check)
    cout << "Yes" << endl ;
  else
    cout << "No" << endl ;
  
  return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: statement cannot resolve address of overloaded function
   20 |       next ;
      |            ^
a.cc:37:16: error: statement cannot resolve address of overloaded function
   37 |           next ;
      |                ^
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  int n ;
  cin >>  n  ;
  vector<string> st(n) ;
 for(int i=0;i<n;i++){
  cin >> st.at(i) ;
 }
  
  bool cond = 1 ;
  
  for(int i=0 ; i<(n-1) ; i++){
    
    char target = st.at(i)[st.size()] ;
    if(target == st.at(i+1)[0]) 
      next ;
    else
      cond = 0 ;
      break ;
  }
  
  if(cond){
    bool check = 1 ; 
    for(int i=0; i<(n-1) ; i++){
      string tg = st.at(i) ;
      for(int j=i+1 ; j<(n-1) ; j++){
        if(tg == st.at(j)){
          check =0 ;
          break ; 
        }else{
          next ;
        }
      }
    }
  }
  
  if(cond && check)
    cout << "Yes" << endl ;
  else
    cout << "No" << endl ;
  
  return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: statement cannot resolve address of overloaded function
   20 |       next ;
      |            ^
a.cc:35:16: error: statement cannot resolve address of overloaded function
   35 |           next ;
      |                ^
a.cc:41:14: error: 'check' was not declared in this scope
   41 |   if(cond && check)
      |              ^~~~~
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  int n ;
  cin >>  n  ;
  vector<string> st(n) ;
 for(int i=0;i<n;i++){
  cin >> st.at(i) ;
 }
  
  bool cond = 1 ;
  
  for(int i=0 ; i<(n-1) ; i++){
    
    char target = st.at(i)[st.size()]
    if(target == st.at(i+1)[0]) ;
      next
    else
      cond = 0 ;
      break ;
  }
  
  if(cond){
    bool check = 1 ; 
    for(int i=0; i<(n-1) ; i++){
      string tg = st.at(i) ;
      for(int j=i+1 ; j<(n-1) ; j++){
        if(tg == st.at(j)){
          check =0 ;
          break ; 
        }else{
          next ;
        }
      }
    }
  }
  
  if(cond && check)
    cout << "Yes" << endl ;
  else
    cout << "No" << endl ;
  
  return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected ',' or ';' before 'if'
   19 |     if(target == st.at(i+1)[0]) ;
      |     ^~
a.cc:20:11: error: expected ';' before 'else'
   20 |       next
      |           ^
      |           ;
   21 |     else
      |     ~~~~   
a.cc:22:16: error: statement cannot resolve address of overloaded function
   22 |       cond = 0 ;
      |                ^
a.cc:35:16: error: statement cannot resolve address of overloaded function
   35 |           next ;
      |                ^
a.cc:41:14: error: 'check' was not declared in this scope
   41 |   if(cond && check)
      |              ^~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int a;
    cin>>a;
  string b[110];
  for(int i=0;i<a;i++){
    cin >> b[i];
  }
  
  for(int j=0;j<a;j++){
    for(int i =0;i<a;i++){
    if(b[i] == b[j]){
      cout <<"No"<<endl:
      
      return 0;
    }
        if(b[i][b[i].size()-1] != b[i+1][0]){
          cout << "No" <<endl;
          
          return 0;
        }
    }
  }
  cout <<"Yes" <<endl;
}
  
 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: expected ';' before ':' token
   15 |       cout <<"No"<<endl:
      |                        ^
      |                        ;
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
string w[110];
int main(){
  int N;
  cin>>N;
  rep(i,N)cin>>w[i];
  bool ans=true;
  rep(i,N-1){
    if(w[i][w[i].size()-1] |= w[i+1][0]){
      ans=false;
    }
  }
  rep(i,N){
    rep(j,i){
      if(w[i]==w[j]){
        ans=false;
      }
    }
  }
  if (ans){
    cout<<"Yes"<<endl;
  }else{
    cout<<""<<endNo<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: 'endNo' was not declared in this scope
   25 |     cout<<""<<endNo<<endl;
      |               ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;cin>>n;
    vector<string> w(n);
    vector<string> in(n);
    vector<string> en(n);
    for(int i=0;i<n;i++){
        cin>>w[i];
        in[i] = w[i].substr(0,1);
        en[i] = w[i].substr(w.length(),1);
    }
    bool key = true;
    for(int i=0;i<n-1;i++){
        if(en[i] != in[i+1]){
            key = false;
        }
    }
    sort(w.begin(),w.end());
    for(int i=0;i>n-1;i++){
        if(w[i] == w[i+1]){
            key = false;
        }
    }
    if(key==true){cout<<"Yes";}
    else{cout<<"No";}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:31: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'length'
   11 |         en[i] = w[i].substr(w.length(),1);
      |                               ^~~~~~
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        String[] word = new String[n];
        boolean jdg = true;
        for(int i = 0;i < n;i++)
            word[i] = sc.next();

        for(int i = 0;i < n;i++){
            for(int j = i+1;i < n;j++){
                if(word[i].equalsIgnoreCase(word[j])){
                    jdg = false;
                    break;
                }
            }
            if(jdg == false)
            break;
        }

        if(jdg == true){
            for(int i = 0;i < n-1;i++){
                if(word[i-1].carAt(word[i].length()-1) != word[i].charAt(0)){
                    jdg = false;
                    break;
                }
            }
        }
        System.out.println(jdg == true?"Yes" : "No");
        
    }
}

Compiler output:
Main.java:26: error: cannot find symbol
                if(word[i-1].carAt(word[i].length()-1) != word[i].charAt(0)){
                            ^
  symbol:   method carAt(int)
  location: class String
1 error
Language: C++

#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cmath>		
#include <stdio.h>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int (i) = 0; (i) < int(n); i++)
#define mod 1000000007
#define fst first
#define pb push_back


int main()
{
	int n;
	cin >> n;
	vector<string> w(n);
	for (int i = 0; i < n; i++) {
		cin >> w[i];
	}
	bool ok = true;
	for (int i = 0; i < N - 1; i++) {
		if (w[i][w.size() - 1] != w[i + 1][0]) {
			ok = false;
		}
		if (w[i] == w[i + 1]) {
			ok = false;
		}

	}
	if (ok) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:29: error: 'N' was not declared in this scope
   36 |         for (int i = 0; i < N - 1; i++) {
      |                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
    int n;
    cin>>n;
    string a[n];
    string ans="Yes";
    char last;
    cin>>a[0];
    int m=a[0].size();
    last=a[0][m-1];
    for(int i=1;i<n;i++){
      cin>>a[i];
      if(a[i][0]==last){
        last=a[i][0];
      }else{
        ans="No";
        break;
      }
    }
  rep(i,n){
    for(j=i+1;j<n;j++){
      if(a[j]==a[i]){
           ans="No";
           break;
      }
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'j' was not declared in this scope
   25 |     for(j=i+1;j<n;j++){
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int mian() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<string> w = {s};
  for(int i = 0;i < n - 1;i++) {
    cin >> s;
    if(s.at(0) != w.at(i).at(w.at(i).size() - 1)) {
      cout << "No" << endl;
      return 0;
    }
    for(int j = 0;j < w.size();j++) {
      if(s == w.at(j)) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int mian()':
a.cc:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;
int mian() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<string> w = {s};
  for(int i = 0;i < n - 1;i++) {
    cin >> s;
    if(s.at(0) != w.at(i).at(w.at(i).size() - 1)) {
      cout << "No" << endl;
      return 0;
    }
    for(int j = 0;j < w.size();j++) {
      if(s == w.at(j)) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;

Compiler output:
a.cc: In function 'int mian()':
a.cc:22:25: error: expected '}' at end of input
   22 |   cout << "Yes" << endl;
      |                         ^
a.cc:3:12: note: to match this '{'
    3 | int mian() {
      |            ^
a.cc:22:25: warning: control reaches end of non-void function [-Wreturn-type]
   22 |   cout << "Yes" << endl;
      |                         ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <set>
int main()
{
    int N;
    std::cin >> N;

    std::vector<std::string> S(N);
    std::set<std::string> D;
    for (int i = 0; i < N; i++) {
        std::cin >> S[i];
        D.insert(S[i]);
    }

    if (D.size() != N) {
        std::cout << "No" << std::endl;
        return 0;
    }

    for (int i = 1; i < N; i++) {
        if (S[i-1].back() != S[i].front()) break;
    }

    if (i != N) {
        std::cout << "No" << std::endl;
    }

    std::cout << "Yes" << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'i' was not declared in this scope
   26 |     if (i != N) {
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(), (c).end());
const long long MOD = 1e9 + 7;
typedef long long ll;

int main(){
	int N;
	cin >> N;
	vector<string> S(N);
	rep(i, N)cin >> S[i];
	bool jg = true;
	for(int i = 1; i < N; i++){
		if(S[i - 1].at(S[i - 1].size() - 1) != S[i].at(0)){
			jd = false;
			break;
		}
	}
	if(jd) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: 'jd' was not declared in this scope; did you mean 'jg'?
   17 |                         jd = false;
      |                         ^~
      |                         jg
a.cc:21:12: error: 'jd' was not declared in this scope; did you mean 'jg'?
   21 |         if(jd) cout << "Yes" << endl;
      |            ^~
      |            jg
Language: C++

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

int main() {
  bool a = 1, b = 1;
  int n;
  cin >> n;
  vector<string> v(n);
  unordered_set<string> s;
  for(int i = 0; i < n; i++){
    cin >> v.at(i);
    s.insert(v.at(i));
  }
  if(s.size() != n)
    a = 0;
  for(int i = 0; i < n - 1; i++){
    if(v.at(i).at(v.at(i).aize() - 1) != v.at(i + 1).at(0)){
      b = 0;
      break;
    }
  }
  if(a && b)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'aize'; did you mean 'size'?
   17 |     if(v.at(i).at(v.at(i).aize() - 1) != v.at(i + 1).at(0)){
      |                           ^~~~
      |                           size
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <vector>
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))

int main() {
	char moji[101][120];
	int N;
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%s", moji[i]);
	}
	for (int i = 0; i < N; i++) {
		
		if(i<N-1){
			int len = strlen(moji[i]);
			if (moji[i][len - 1] != moji[i + 1][0])
			{
				printf("No");
				return 0;
			}
		}
		
		for (int j = i + 1; j < N; j++) {
			if ( !strcmp(moji[i], moji[j])) {
				printf("No");
				return 0;
			}

		}
	}


	printf("Yes");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:35: error: 'strlen' was not declared in this scope
   17 |                         int len = strlen(moji[i]);
      |                                   ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | #define MIN(a, b) ((a) < (b) ? (a) : (b))
a.cc:26:31: error: 'strcmp' was not declared in this scope
   26 |                         if ( !strcmp(moji[i], moji[j])) {
      |                               ^~~~~~
a.cc:26:31: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

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

int main() {
    int N;
    bool frag = true;
    cin >> N;
    vector<string> v (N);
    cin >> v.at(0);
    for  (int i = 1; i < N; i++) {
        cin >> v.at(i);
        for (int j = 0; j < i; j++)
        {
            if (v.at(j) == v.at(i)) {
                cout << "No" << endl;
                frag = false;
                break;
            }
        }
        if (v.at(i).at(0) != v.at(i-1).at(v.at(i-1).size())) {
            cout << "No" << endl;
            frag = false;
            break;
        
    }
    if (frag) {
        cout << "Yes" << endl;
    }
}


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