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

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

void test(int x){
  int a=mozi.at(x-1).size();
  if(mozi.at(x-1).at(a)!=mozi.at(x).at(0)) flag=0;
  for(int i=0;i<x;i++){
  if(mozi.at(i)==mozi.at(x)) flag=0;
  }


}

int main(){
int N;
  cin>>N;
  vector <string> mozi(N,"##");
  for(int i=0;i<N;i++) cin>>mozi.at(i);
  
   flag=1;
  
  for(int j=1;j<N;j++) test(j);
  
  if(flag==0) cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
  


return 0;}

Compiler output:
a.cc: In function 'void test(int)':
a.cc:8:9: error: 'mozi' was not declared in this scope
    8 |   int a=mozi.at(x-1).size();
      |         ^~~~
Language: C

#include <stdio.h>

int main()
{
    int n,i,j=0,num[11],judge=1;
    char w[101][11];

    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s",w[i]);
    }

    for(i=0;i<n;i++){
        j=0;
        while(w[i][j]!='\0'){
            j++;
        }
        num[i]=j;
    }
    
    for(i=0;i<n-1;i++){
        if(w[i][num[i]-1]!=w[i+1][0]){
            judge=0;
        }
    }

    printf()

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

    if(judge==1){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }


    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:5: error: too few arguments to function 'printf'
   27 |     printf()
      |     ^~~~~~
In file included from main.c:1:
/usr/include/stdio.h:363:12: note: declared here
  363 | extern int printf (const char *__restrict __format, ...);
      |            ^~~~~~
main.c:27:13: error: expected ';' before 'if'
   27 |     printf()
      |             ^
      |             ;
   28 | 
   29 |     if(judge==1){
      |     ~~
Language: C++

#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;

vector<string> input()
{
	int i, n;
	cin >> n;
	vector<string> word_input(n);

    for (i = 0; i < n; i++) 
		cin >> word_input[i];

	return word_input;
}

int main(int argc, char *argv[])
{
    int i, j, n;
	char input[16];
	vector<string> word;

	word = input();
	n = word.size();

	for (i = 0; i < n - 1; i++) {
		if (word[i].end() != word[i + 1].begin()) {
			cout << "No" << endl;
			return 0;
		}
	}

	for (i = 0; i < n; i++) {
		for (j = i + 1; j < n; j++) {
			if (word[i] == word[j]) {
				cout << "No" << endl;
				return 0;
			}
		}
	}

	cout << "Yes" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:26:21: error: 'input' cannot be used as a function
   26 |         word = input();
      |                ~~~~~^~
Language: C++

#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;

int main(int argc, char *argv[])
{
    int i, j, n;
	char input[16];
	vector<string> word;

	for (i = 0; i < n; i++) {
		cin >> input;
		word.push_back(input);
	    for (i = 0; i < 16; i++)
			input[i] = '\0';
	}

	for (i = 0; i < n; i++) {
		for (j = i + 1; j < n; j++) {
			if (word[i] == word[j]) {
				cout << "No" << endl;
				return 0;
			}
		}
	}

	for (i = 0; i < n - 1; i++) {
		if (*(word[i].end()) == *(word[i + i].front())) {
			continue;
		} else {
			break;
		}
	}
	
	if (i == n - 1) 
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:31:41: error: invalid type argument of unary '*' (have '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
   31 |                 if (*(word[i].end()) == *(word[i + i].front())) {
      |                                         ^~~~~~~~~~~~~~~~~~~~~~
Language: Java

import java.util.Scanner;

public class Main1 {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		String[] str = new String[N];
		for (int i = 0; i < str.length; i++) {
			String compare = str[0];
			if(compare.equalsIgnoreCase(str[i])){
				System.out.println("No");
			}
			else{
				System.out.println("Yes");
			}
		}
		scan.close();
	}
}

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

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

Compiler output:
main.c: In function 'main':
main.c:10:26: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   10 |       for(j=0;j<i;j++)if(strcmp(W[j],W[i])==0)ans++;
      |                          ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | int main(void) {
main.c:11:29: error: lvalue required as left operand of assignment
   11 |       for(j=0;j<10 && length=10;j++)if(W[i-1][9-j]!=0)length=9-j;
      |                             ^
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();scan.nextLine();
        String[] str = new String[n];
        for(i = 0; i < n; i++) {
            str[i] = scan.nextLine();
        }
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                if (i != j && str[i].equals(str[j])) {
                    System.out.println("No");
                    return;
                }
            }
        }
        for(int i = 0; i < n-1; i++) {
            if (str[i].charAt(str[i].length()-1) != str[i+1].charAt(0)) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
        for(i = 0; i < n; i++) {
            ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
        for(i = 0; i < n; i++) {
                   ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
        for(i = 0; i < n; i++) {
                          ^
  symbol:   variable i
  location: class Main
Main.java:9: error: cannot find symbol
            str[i] = scan.nextLine();
                ^
  symbol:   variable i
  location: class Main
4 errors
Language: C++

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


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

#include <iostream>
#include <string>

using namespace std;

int main(){
  int N,flag = 0;string W[100];
  cin >> N;for(int i=0;i<N;i++)cin >> W[i];
  for (int i=0;i < N-1;i++){
    if (W[i].substr(W[i].length()-1,1) != W[i+1].substr(0,1)){
      flag ++;
      break
    }
  }
  if (flag == 0){
    for(int i=0;i<N;i++){
      for(int j=1;j<N-1;j++){
        if(i+j <= N){
          break;
        }else{
          if(W[i] == W[i+j]){
            flag ++;
          }
        }
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected ';' before '}' token
   12 |       break
      |            ^
      |            ;
   13 |     }
      |     ~
Language: C

#include <iostream>
#include <string>

using namespace std;

int main(){
  int N,flag = 0;string W[100];
  cin >> N;for(int i=0;i<N;i++)cin >> W[i];
  for (int i=0;i < N-1;i++){
    if (W[i].substr(W[i].length()-1,1) != W[i+1].substr(0,1)){
      flag ++;
      break
    }
  }
  if (flag == 0){
    for(int i=0;i<N;i++){
      for(int j=1;j<N-1;j++){
        if(i+j <= N){
          break;
        }else{
          if(W[i] == W[i+j]){
            flag ++;
          }
        }
      }
    }
  }
}


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

#include <iostream>
#include <string>
#include <vector>
#include <set>
using namespace std;
set<string> s;
string solveMeFirst(vector<string> list){
    for (int i = 0; i<list.size()-1; i++){
        if (!(list[i].back() == list[i+1].front() && !s.find(list[i]))){
           return "No"
        }
        return "Yes"
    }
}

int main(){
    int a;
    string b;
    vector<string> c;
    cin >> a ;
    while(cin >> b){
        c.push_back(b);
    }
    string d = solveMeFirst(c);
    cout << d;
    return 0;
}

Compiler output:
a.cc: In function 'std::string solveMeFirst(std::vector<std::__cxx11::basic_string<char> >)':
a.cc:9:54: error: no match for 'operator!' (operand type is 'std::set<std::__cxx11::basic_string<char> >::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::__cxx11::basic_string<char> > >::const_iterator'})
    9 |         if (!(list[i].back() == list[i+1].front() && !s.find(list[i]))){
      |                                                      ^~~~~~~~~~~~~~~~
a.cc:9:54: note: candidate: 'operator!(bool)' (built-in)
a.cc:9:54: note:   no known conversion for argument 1 from 'std::set<std::__cxx11::basic_string<char> >::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::__cxx11::basic_string<char> > >::const_iterator'} to 'bool'
a.cc:10:23: error: expected ';' before '}' token
   10 |            return "No"
      |                       ^
      |                       ;
   11 |         }
      |         ~              
a.cc:12:21: error: expected ';' before '}' token
   12 |         return "Yes"
      |                     ^
      |                     ;
   13 |     }
      |     ~                
a.cc:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <set>
using namespace std;
set<string> s;
string solveMeFirst(vector<string> list){
    for (int i = 0; i<list.size()-1; i++){
        if (!(list[i].back() == list[i+1].front() && !s.find(list[i]))){
           return "No";
        }
        return "Yes";
    }
}

int main(){
    int a;
    string b;
    vector<string> c;
    cin >> a ;
    while(cin >> b){
        c.push_back(b);
    }
    string d = solveMeFirst(c);
    cout << d;
    return 0;
}

Compiler output:
a.cc: In function 'std::string solveMeFirst(std::vector<std::__cxx11::basic_string<char> >)':
a.cc:9:54: error: no match for 'operator!' (operand type is 'std::set<std::__cxx11::basic_string<char> >::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::__cxx11::basic_string<char> > >::const_iterator'})
    9 |         if (!(list[i].back() == list[i+1].front() && !s.find(list[i]))){
      |                                                      ^~~~~~~~~~~~~~~~
a.cc:9:54: note: candidate: 'operator!(bool)' (built-in)
a.cc:9:54: note:   no known conversion for argument 1 from 'std::set<std::__cxx11::basic_string<char> >::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::__cxx11::basic_string<char> > >::const_iterator'} to 'bool'
a.cc:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^
Language: Java

import java.util.Scanner;

public class Test {
	
	public static void main(String[] args){
	
	Scanner in = new Scanner(System.in);
	int a=0,b=0,sum=0;	
	a = in.nextInt();	
	b= in.nextInt();
	if(a==b & a%2==0){
		System.out.println("Yes");
	}else{
		System.out.println("No");
	}
	if((a-b==1 || a-b==-1)&& (a*b*a)%2==0 ){
		System.out.println("Yes");
		
		
	}else{
		System.out.println("No");
	}
	if((a-b==2 || a-b==-2)&& ((a*b*a)%2==0 )||((a*b*a)%2==0 )||((a*b*b)%2==0 )||((a*b*(b-1))%2==0 )||((a*b*(b+1))%2==0 )||((a*b*(a-1))%2==0 )||((a*b*(a+1))%2==0 )){
		System.out.println("Yes");
		
		
	}else{
		System.out.println("No");
	}
	
}


	
}
//#17024858 | chen_fei's solution for [AtCoder-4252] [Problem B]

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

#include <iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
    int n;
    bool a;
    cin >> n;
    string w[105];
    for (int i = 0; i < n; i++) {
        cin >> w[i];
        if (i != 0) {
            for (int k = 0; k < i; k++) {
                if (w[i] == w[k]) {
                    a = true;
                    break;
                }
            }
        }
    }
    for (int i = 1; i < n; i++) {
      
            if (w[i].back != w[i--].front()) {
                a = true;
            }
        
    }
    if (a == true)cout << "No" << endl;
    else cout << "Yes" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: invalid operands of types '<unresolved overloaded function type>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to binary 'operator!='
   23 |             if (w[i].back != w[i--].front()) {
      |                 ~~~~~~~~~ ^~ ~~~~~~~~~~~~~~
      |                      |                   |
      |                      |                   __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
      |                      <unresolved overloaded function type>
Language: C++

#include <iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
    int n;
    bool a;
    cin >> n;
    string w[105];
    for (int i = 0; i < n; i++) {
        cin >> w[i];
        if (i != 0) {
            for (int k = 0; k < i; k++) {
                if (w[i] == w[k]) {
                    a = true;
                    break;
                }
            }
        }
    }
    for (int i = 1; i < n; i++) {
      
            if (w[i].back != w[i--].front) {
                a = true;
            }
        
    }
    if (a == true)cout << "No" << endl;
    else cout << "Yes" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator!='
   23 |             if (w[i].back != w[i--].front) {
      |                 ~~~~~~~~~ ^~ ~~~~~~~~~~~~
      |                      |              |
      |                      |              <unresolved overloaded function type>
      |                      <unresolved overloaded function type>
Language: C++

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

int main() {

int N;

cin >>N;

string W[N];
char ini[N];
char ter[N];

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

ini[i]=W[i][0];
ter[i]=W[i][W[i].size()-1];
}

string ans("Yes");//しりとりかどうか

for(int i=0; i<N-1;i++){
if(ter[i]=!=ini[i+1]){ans="No";}
}

for(int i=0; i<N;i++){

for(int j=0; j<N; j++){
if(W[i]==W[j]&&i!=j){ans="No";}
}

}

cout <<ans;


}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:11: error: expected primary-expression before '!=' token
   26 | if(ter[i]=!=ini[i+1]){ans="No";}
      |           ^~
Language: C++

import sys
n = int (input())
words = []
for i in range (n) :
    words.append(input())
for x in range(len(words)):
    if words.count(words[x]) > 1 or words[x+1][0] != words[x][-1]:
        print("No")
        sys.exit()
    else:
        "Yes"

Compiler output:
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'
Language: Java

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] W = new String[N];

		for(int i=0; i<N; i++) {
			W[i] = sc.next();
		}

		int judge1 = 0;

		for(int j=0; j<N-1; j++) {
			char c1 = W[j].charAt(W[j].length()-1);
			char c2 = W[j+1].charAt(0);

			if(c1 == c2) {
				judge1 += 1;
			}
		}

		int judge2 = 0;

		for(int k=0; k<N-1; k++) {
			for(int l=1; l<N-k; l++) {
				if(W[k] == W[k+l]) {
					judge2 += 1;
				}
			}
		}

		if(judge1 == N-1 && judge2 == 0) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}

	}


Compiler output:
Main.java:40: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

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

char last(int x,char y[])
{
	int count=0;
	while(y[count]!=0){
		count++;
	}
	return y[count-1];
}

int main() {
	pair ;
	int check=0,i,j,n;
	char p[100][1];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",&s[i]); 
		for(j=0;j<n;j++){
			if(s[i]==s[j])check=1;
		}
		if(i>0){
			p[i-1][0]=last(i-1,s[i-1]);
			if(p[i-1][0]!=s[i][0]){
				check=1;
			}
		}
	}
	if(check){
		printf("No");
	}else{
		printf("Yes");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'auto' can only be specified for variables or function declarations
   14 |         pair ;
      |         ^~~~
a.cc:19:29: error: 's' was not declared in this scope
   19 |                 scanf("%s",&s[i]);
      |                             ^
Language: C++

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

bool solve(const vector<string>& w){
  const int n = w.size();

  for(int i = 0; i < n-1; ++i){
    if(w[i].back() != w[i+1].front()){
      return false;
    }
  }

  set<string> v;
  for(int i = 0; i < n; ++i){
    v.insert(w[i]);
    if(v.size() != w.size()) 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:22:3: error: expected unqualified-id before 'return'
   22 |   return true;
      |   ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
a.cc: In function 'bool solve(const std::vector<std::__cxx11::basic_string<char> >&)':
a.cc:21:3: warning: control reaches end of non-void function [-Wreturn-type]
   21 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
int n;
cin>>n;
string s[n];
cin>>s[0];
FOR(i,1,n){
cin>>s[i];
if(s[i-1][s[i-1].size()-1]!=s[i][0]){
cout<<"No"<<endl;
return 0;
}
REP(j,i){
if(s[i]==s[j]){
cout<<"No"<<endl;
return 0;
}
}
cout<<"Yes"<<endl;

    return 0;
}

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

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
int n;
cin>>n;
string s[n];
cin>>s[0];
FOR(i,1,n){
cin>>s[i];
if(s[i-1][s[i-1].size-1]!=s[i][0]){
cout<<"No"<<endl;
return 0;
}
REP(j,i){
if(s[i]==s[j]){
cout<<"No"<<endl;
return 0;
}
}
cout<<"Yes"<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   27 | if(s[i-1][s[i-1].size-1]!=s[i][0]){
      |           ~~~~~~~^~~~
      |                      ()
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:20:11: note: to match this '{'
   20 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
    vector<string> word;
    string temp;
    bool flag = true;
    int n;

    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> temp;
        word.push_back(temp);
    }
    for (int i = 1; i < n; i++)
    {
        if ((word[i-1][word[i-1].size()-1]) != (word[i][0]))
        {
            cout << "No" << endl;
            return 1;
        }
        else;
    }
    sort(word.begin(), word.end());
    for (int i = 1; i < n; i++)
    {
        if (word[i-1] == word[i])
        {
            cout << "No" << endl;
            return 1;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

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

#include<stdio.h>
#include <string.h>
#define N 100
#define LIMIT 11

int main(void)
{
	char s[N][LIMIT];
	int n;

	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		scanf("%s", s[i]);
	}

	for (int j = 0; j < n; j++) {
		for (int k = j + 1; k < n; k++) {
			if (strcmp(s[j], s[k]) == 0) {
				printf("No\n");
				return 0;
			}
		}
	}

	for (int x = 1; x < n; x++) {
		if (s[x][0] != s[x - 1][strlen(s[x - 1]) - 1] {
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:27:62: error: expected ')' before '{' token
   27 |                 if (s[x][0] != s[x - 1][strlen(s[x - 1]) - 1] {
      |                    ~                                         ^~
      |                                                              )
main.c:31:9: error: expected expression before '}' token
   31 |         }
      |         ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

int main(void){
  int n;
  cin >> n;
  map<string, int> srtr;
  string str;
  cin >> str;
  srtr[str] = 1;

  for(int i = 1; i < n; i++){
    string temp;
    cin >> temp;
    if(srtr[temp] == 1 || str.back() != temp.back()){
      cout << "No" << endl;
      return 0;
    }
    srtr[temp] = 1;
    str = temp;
  }

  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'map' was not declared in this scope
   18 |   map<string, int> srtr;
      |   ^~~
a.cc:6:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    5 | #include <cmath>
  +++ |+#include <map>
    6 | using namespace std;
a.cc:18:13: error: expected primary-expression before ',' token
   18 |   map<string, int> srtr;
      |             ^
a.cc:18:15: error: expected primary-expression before 'int'
   18 |   map<string, int> srtr;
      |               ^~~
a.cc:21:3: error: 'srtr' was not declared in this scope; did you mean 'str'?
   21 |   srtr[str] = 1;
      |   ^~~~
      |   str
Language: C++


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


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

	std::vector<std::string> vs;
	bool ok = true;
	for (int i{}; i < N; ++i) {
		
		std::string x{}; std::cin >> x;
		
		if (!vs.empty()) 
			ok &= vs.back().back() == x[0];
	
		auto exist = std::find(vs.begin(), vs.end(), x) != vs.end();
		ok &= !exist;
		if (!exist)
			vs.emplace_back(x);

		if (!ok)
			break;

	}

	std::cout << (ok ? "Yes" : "No") << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:39: 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&)'
   20 |                 auto exist = std::find(vs.begin(), vs.end(), x) != vs.end();
      |                              ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
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:2:
/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:20:39: 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>'
   20 |                 auto exist = std::find(vs.begin(), vs.end(), x) != vs.end();
      |                              ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++


int main(){
  int N;
  cin >> N;
  vector<string> vec(N);
  string W;
  
  for(int i; i<N; i++){
    cin >> W;
    vec.at(i) = W;
  }
  
  string word, wordmae;
  bool shiri = true;
  
  for(int i = 0; i<N; i++){
    word = vec.at(i);
    
    if(i != 0){
      wordmae = vec.at(i-1);
      for(int j=0; j < i; j++){//初出の単語かどうか
        if(word == vec.at(j)){
          shiri = false;
        }
      }
      if(shiri == false){break;}
      
      if(word.at(0) != wordmae.at(wordmae.size()-1)){//しりとりできてるかどうか
        shiri = false;
        break;
      }
      
    }
    if(i == N-1){
      shiri = true;
    }
    
  }
  if(shiri == true){
    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:5:3: error: 'vector' was not declared in this scope
    5 |   vector<string> vec(N);
      |   ^~~~~~
a.cc:5:10: error: 'string' was not declared in this scope
    5 |   vector<string> vec(N);
      |          ^~~~~~
a.cc:5:18: error: 'vec' was not declared in this scope
    5 |   vector<string> vec(N);
      |                  ^~~
a.cc:6:9: error: expected ';' before 'W'
    6 |   string W;
      |         ^~
      |         ;
a.cc:9:12: error: 'W' was not declared in this scope
    9 |     cin >> W;
      |            ^
a.cc:13:9: error: expected ';' before 'word'
   13 |   string word, wordmae;
      |         ^~~~~
      |         ;
a.cc:17:5: error: 'word' was not declared in this scope
   17 |     word = vec.at(i);
      |     ^~~~
a.cc:20:7: error: 'wordmae' was not declared in this scope
   20 |       wordmae = vec.at(i-1);
      |       ^~~~~~~
a.cc:40:5: error: 'cout' was not declared in this scope
   40 |     cout << "Yes"<< endl;
      |     ^~~~
a.cc:40:21: error: 'endl' was not declared in this scope
   40 |     cout << "Yes"<< endl;
      |                     ^~~~
a.cc:42:5: error: 'cout' was not declared in this scope
   42 |     cout << "No" << endl;
      |     ^~~~
a.cc:42:21: error: 'endl' was not declared in this scope
   42 |     cout << "No" << endl;
      |                     ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  int i = 0;
  while(i < N){
    string W_i;
    cin >> W_i;
    char a_i = W_i[0];
    char b_i = W_i.back();
    i++;
  }
  int c = 1;
  i = 0;
  while(i < N-1){
    c *= (b_i == a_i+1);
    i++;
  }
  i = 0;
  int j;
  while (i < N-1){
    for(j = i+1;j < N; j++){
      c *= (W_i != W_j);
    }
    i++;
  }
  if(c){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'b_i' was not declared in this scope
   18 |     c *= (b_i == a_i+1);
      |           ^~~
a.cc:18:18: error: 'a_i' was not declared in this scope
   18 |     c *= (b_i == a_i+1);
      |                  ^~~
a.cc:25:13: error: 'W_i' was not declared in this scope
   25 |       c *= (W_i != W_j);
      |             ^~~
a.cc:25:20: error: 'W_j' was not declared in this scope
   25 |       c *= (W_i != W_j);
      |                    ^~~
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 ;
}
3
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 <bits/stdc++.h>
using namespace std ;
bool solve ( const vector < string >& W ) {
const int n = W . size ();
for ( int i = 0; i < n -1; ++ i ) {
if (W[i].back() !=W[i+1].front()) {
return false ;
	}
}
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 ;
}
3
int main () {
const vector < string > W = input ();
if ( solve ( W )) {
cout << " Yes " << endl ;
}
else {
cout << "No" << endl ;
}
}


Compiler output:
a.cc:27:1: error: expected unqualified-id before numeric constant
   27 | 3
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'bool judge(std::vector<std::__cxx11::basic_string<char> >)':
a.cc:10:10: error: expected '(' before 'W'
   10 |       if W[i] == W[j] return false;
      |          ^
      |          (
Language: C++

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

Compiler output:
a.cc: In function 'bool judge(std::vector<std::__cxx11::basic_string<char> >)':
a.cc:10:10: error: expected '(' before 'W'
   10 |       if W[i] == W[j] return false;
      |          ^
      |          (
a.cc:15:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 | int main(){
      |         ^~
a.cc:15:9: note: remove parentheses to default-initialize a variable
   15 | int main(){
      |         ^~
      |         --
a.cc:15:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:15:11: error: a function-definition is not allowed here before '{' token
   15 | int main(){
      |           ^
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:5:29: note: to match this '{'
    5 | bool judge(vector<string> W){
      |                             ^
a.cc:28:2: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      |  ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<string> W(n);
  for(int i=0; i < n; i++){
  	cin >> W[i];
  }
  if(judge(W)){
    cout<< "Yes"<< endl;
  }else{
    cout << "No" <<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool judge(std::vector<std::__cxx11::basic_string<char> >)':
a.cc:10:10: error: expected '(' before 'W'
   10 |       if W[i] == W[j] return false;
      |          ^
      |          (
a.cc:12:16: error: expected ';' before '}' token
   12 |     return true
      |                ^
      |                ;
   13 |   }
      |   ~             
a.cc:15:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 | int main(){
      |         ^~
a.cc:15:9: note: remove parentheses to default-initialize a variable
   15 | int main(){
      |         ^~
      |         --
a.cc:15:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:15:11: error: a function-definition is not allowed here before '{' token
   15 | int main(){
      |           ^
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:5:29: note: to match this '{'
    5 | bool judge(vector<string> W){
      |                             ^
a.cc:28:2: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      |  ^
Language: C++

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

int main(){
  int n;
  vector<string> vec;

  for(int i = 0;i < n;i++){
    int tmp;
    cin >> tmp;
    vec.push_back(tmp);
  }

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

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(int&)'
   12 |     vec.push_back(tmp);
      |     ~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Language: C++

function Main(input){
    input = input.split("\n");
    var N = parseInt(input[0],10);
    input.shift();
    var W = input;

    for(var i = 0;i < N;i++) {
        for(var j = i + 1;j < N;j++) {
            if(W[i] === W[j]) {
                console.log("No");
                return;
            }
        }
    }

    for (var i = 0;i < N - 1;i++) {
        if(W[i].slice(-1) !== W[i + 1].slice(0,1)) {
            console.log("No");
            return;
        }
    }

    console.log("Yes");
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));

Compiler output:
a.cc:1:1: error: 'function' does not name a type; did you mean 'union'?
    1 | function Main(input){
      | ^~~~~~~~
      | union
a.cc:25:5: error: expected constructor, destructor, or type conversion before '(' token
   25 | Main(require("fs").readFileSync("/dev/stdin","utf8"));
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
string s;
map<string, int> mp;
int N;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL):
        cin >>N;
    string bef = "";
    for(int i = 1; i <= N; i++){
        cin >>s;
        if(i == 1){
            mp[s] = 1;
        }
        else{
            if(mp[s] || bef[bef.length() - 1] != s[0]){
                puts("No");
                return 0;
            }
            mp[s] = 1;
        }
        bef = s;
    }
    puts("Yes");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:34: error: expected ';' before ':' token
    8 |     cin.tie(NULL); cout.tie(NULL):
      |                                  ^
      |                                  ;
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
int len,i,a,b[];
scanf("%d",&a);
for(i=0;i<a;i++){
scanf("%s",b[i]);
}
for(i=0;i<a-1;i++){
len=strlen(b[i]);
if(b[i]==b[i+1]){
printf("No");
break;
}

}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:13: error: array size missing in 'b'
    4 | int len,i,a,b[];
      |             ^
main.c:10:13: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   10 | len=strlen(b[i]);
      |            ~^~~
      |             |
      |             int
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'int'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;

int main()
{
	int n;
	string w[110];
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> w[i];
	}
	bool ans = true;
	for (int i = 0; i < n - 1; i++) {
		if (w[i][w[i].length() - 1] != w[i + 1][0])
			ans = false;
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < i; j++) {
			if (w[i] == w[j]) {
				ans = false;
			}
		}
	}
	if (ans) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
    return 0;
}



Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
    int n;
    string w[100];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> w[i];

    bool flg = true;
    string p_w = w[0];
    for (int i = 1; i < n; i++) {
        if (p_w.end() != w[i].start()) {
            flg = false;
            break;
        }
        p_w = w[i];
    }

    if (flg)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
        
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'start'
   14 |         if (p_w.end() != w[i].start()) {
      |                               ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define  rep(i,n) for(ll i = 0; i < (n); ++i)
#define  yn(a)    cout << ( (a)?"Yes\n":"No\n" )

int main()
{
    int n;
    string s,t;
    set<string> x;
    cin>>n>>s;
    x.insert(s);
    rep(i,n-1){
        cin>>t;
        x.insert(t);
        if(s[s.size()-1]!=t[0])yn(0),exit(0);
        s=t;
    }
    if(x.size()!=n)yn(0);
    else yn(1);
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:23: error: 'll' was not declared in this scope
    3 | #define  rep(i,n) for(ll i = 0; i < (n); ++i)
      |                       ^~
a.cc:13:5: note: in expansion of macro 'rep'
   13 |     rep(i,n-1){
      |     ^~~
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     rep(i,n-1){
      |         ^
a.cc:3:33: note: in definition of macro 'rep'
    3 | #define  rep(i,n) for(ll i = 0; i < (n); ++i)
      |                                 ^
Language: C++

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

int main(){
	int N,flag = 0;
	string W[100];
	cin >> N;
	for (int i = 0;i< N;i++){
		getline(cin,W[i]);
	}
	for (int i = 0;i< N;i++){
		flag = 0;
		for (int j = 0;j< N;j++){
			if (W[i] == W[j] && i != j){
				flag = 1;
			} 
		}
		if (W[i].substr(W[i].length(),1) != W[i+1].substr(0,1)){
				flag = 1;
		}
		if flag == 1 : break;
	}
	if (flag != 1){
		cout << "Yes" <<endl;
	}else{
		cout << "No" <<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: expected '(' before 'flag'
   22 |                 if flag == 1 : break;
      |                    ^~~~
      |                    (
Language: C++

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

int main(){
	int N,flag = 0;
	string W[100];
	cin >> N;
	for (int i = 0;i< N;i++){
		getline(cin,W[i]);
	}
	for (int i = 0;i< N;i++){
		flag = 0;
		for (int j = 0;j< N;j++){
			if (W[i] == W[j] && i != j){
				flag = 1;
			} 
		}
		if (W[i].substr(W[i].length(),1)) != W[i+1].substr(0,1){
				flag = 1;
		}
		if flag == 1 : break;
	}
	if (flag != 1){
		cout << "Yes" <<endl;
	}else{
		cout << "No" <<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:32: error: could not convert 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int](W[i].std::__cxx11::basic_string<char>::length(), 1)' from 'std::__cxx11::basic_string<char>' to 'bool'
   19 |                 if (W[i].substr(W[i].length(),1)) != W[i+1].substr(0,1){
      |                     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      |                                |
      |                                std::__cxx11::basic_string<char>
a.cc:19:51: error: expected primary-expression before '!=' token
   19 |                 if (W[i].substr(W[i].length(),1)) != W[i+1].substr(0,1){
      |                                                   ^~
a.cc:22:20: error: expected '(' before 'flag'
   22 |                 if flag == 1 : break;
      |                    ^~~~
      |                    (
Language: C++

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

int main(){
	int N,flag = 0;
	string W[100];
	cin >> N;
	for (int i = 0;i< N;i++){
		getline(cin,W[i]);
	}
	for (int i = 0;i< N;i++){
		flag = 0;
		for (int j = 0;j< N;j++){
			if (W[i] == W[j] && i != j){
				flag = 1;
			} 
		}
		if (W[i].substr(W[i].length(),1)) != W[i+1].substr(0,1){
				flag = 1;
		}
		if flag == 1 : break;
	}
	if (flag != 1){
		cout << "Yes" <<endl;
	}else{
		cout << "No" <<endl;
	}
}

Compiler output:
a.cc:2:10: fatal error: String: No such file or directory
    2 | #include <String>
      |          ^~~~~~~~
compilation terminated.
Language: C

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

int main(void){
    int N;
    scanf("%d",&N);
    char w[N][11];
    scanf("%s",w[0]);
    for(int i=1; i<N; i++){
        scan("%s",w[i]);
        if(w[i-1][strlen(w[i-1])-1] != w[i][0]){puts("No"); return 0;}
    }

    for(int i=0; i<N-1; i++){
        for(int j=i+1; j<N; j++){
            if(!strcmp(w[i], w[j])){puts("No"); return 0;}
        }
    }
    
    puts("Yes");
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'scan'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   11 |         scan("%s",w[i]);
      |         ^~~~
      |         scanf
Language: C++

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

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

    vector<string> w(n);
    cin >> w[0];

    for (int i = 1; i < n; i++) {
        string wi;
        cin >> wi;
        if (wi[0] != w[i - 1].back() || find(w.begin(), w.end(), wi) != w.end()) {
            cout << "No" << endl;
            return 0;
        }
        w[i] = wi;
    }
    cout << "Yes" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:45: 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&)'
   16 |         if (wi[0] != w[i - 1].back() || find(w.begin(), w.end(), wi) != w.end()) {
      |                                         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
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:16:45: 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>'
   16 |         if (wi[0] != w[i - 1].back() || find(w.begin(), w.end(), wi) != w.end()) {
      |                                         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~