TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
a, b = int(input())
for c in range(1, 4):
    if (a * b * c) % 2 == 1:
        print('Yes')
        exit()
print('No')

a, b = map(int, input().split())
print('Yes' if a%2 and b%2 else 'No')

Verdicts: Runtime Error

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
a,b = map(int(),input().split)

if(a*b%2==0){
  print('NO')
}else{
  print('YES')
}

a,b=map(int, input().split())

if a*b%2==0:
  print('No')
else:
  print('Yes')


Verdicts: Runtime Error

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
import fractions

N,X = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x.sort()

if N != 1:
    A = [0]*(N-1)
    for i in range(N-1):
        A[i] = x[i+1]-x[i]

    a = A[0]
    for i in range(N-1):
        a = fractions.gcd(a,A[i])
    print(a)
else:
    print(x[1]-x[0])


a,b = map(int, input().split())
print ("Yes" if a*b%2==1 else “No”)

a,b = map(int, input().split())
print ("Yes" if a*b%2==1 else "No")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
a, b = (int(i) for i in input().split())  
if a%2 and b%2:
  	print("Yes")
  else:
    print("No")

a, b = (int(i) for i in input().split())
if a % 2 and b % 2:
    print("Yes")
else:
    print("No")


Verdicts: Runtime Error

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
A, B = map(int, input().split())
flag = False
for C in range(1, 4):
    if(A*B*C%2 == 1):
        flag = True
if(flag):
    print('YES')
else:
    print('NO')

A, B = map(int, input().split())
flag = False
for C in range(1, 4):
    if(A*B*C%2 == 1):
        flag = True
if(flag):
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
A=int() , B=int()
x=A*B
if x%2==0:
  print('Yes')
else:
  print('No')

A,B=int(input()) 
x=A*B
if x%2==0:
  print('No')
else:
  print('Yes')

input(A,B)
x=A*B
if x%2==0:
  return 'Yes'
else:
  returun 'No'

i=list(map(int,input().split())) 
A=i[0]
B=i[1]
if A*B%2==0:
  print('Yes')
else:
  print('No')

if A%2==0 or B%2==0:
  return 'Yes'
else:
  return 'No'

A,B=int(input()) 
x=A*B
if x%2==0:
  print('Yes')
else:
  print('No')

int A, int B
x=A*B
if x%2==0:
  print('Yes')
else:
  print('No')

i=list(map(int,input().split())) 

if i[0]*i[1]%2==0:
  print('Yes')
else:
  print('No')

int A, int B
x=A*B
if x%2==0:
  return 'Yes'
else:
  returun 'No'

A,B=list(map(int,input().split()))
x=A*B
if x%2==0:
  print('No')
else:
  print('Yes')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
a, b = map(int,input().split())
if (a * b * 3) % 2 == 0:
  print("No")
  
elif (a * b * 2) % 2 == 0:
  print("No")

elif (a * b * 1) % 2 == 0:
  print("No")

else:
  print("Yes")


a, b = map(int,input().split())
c for i in range(3)

if (a+b)+ i == 0:
  print("No")
else:
  print("Yes")

a, b = map(int,input().split())
if (a == 1 and b == 2) or (a == 2 and b == 1) or (a == 2 and b == 2) or (a == 3 and b == 2) or (a == 2 and b == 3):
  print("No")
else:
  print("Yes")


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
A = int(input())
B = int(input())

for i in range(1,4):
    if A * B * i % 2 == 1:
        print('Yes')
        break

print('No')

from itertools import product
 
H, W = map(int, input().split())
 
a = [ list(map(int, input().split())) for _ in range(H) ]
 
output = ''
direction = -1
idou = 0
last_i = 0
last_j = 0
count = 0
j = -1
for i in range(H):
    direction *= -1
    j += direction
    for _ in range(W):
        if idou == 1:
            count += 1
            output += '{} {} {} {}\n'.format(last_i+1, last_j+1, i+1, j+1)
        if (a[i][j] + idou) % 2 == 1:
            idou = 1
        else:
            idou = 0
        last_i = i
        last_j = j
        j += direction
 
output = str(count) + '\n' + output.strip()
print(output)

A, B = map(int, input().split())

if A * B % 2 == 1:
    print('Yes')
else:
 print('No')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
a,b = map(int,input().split())
for i in range(1,4) :
    if (a*b*c)%2 == 1 :
        print('Yes')
    else :
        print('No')

a,b = map(int,input().split())
for i in range(1,4) :
    if (a*b*i)%2 == 1 :
        print('Yes')
    else :
        print('No')

a,b = map(int,input().split())
if (a*b)%2 == 1 :
    print('Yes')
else :
    print('No')

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
import math
from functools import reduce

c, d = (int(i) for i in input().split())  
a = [int(i) for i in input().split()]
b = a.copy()

k = 0
for i in a:
    b[k] = abs(i - d)
    k += 1

m = min(b) 

lo = []

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


                
print(gcd_list(b))

a, b = (int(i) for i in input().split())

if a%2 ==0 or b%2 ==0: 
    print("NO") 
else: 
    print("YES")

a, b = (int(i) for i in input().split())

if a%2 ==0 or b%2 ==0: 
    print("No") 
else: 
    print("Yes")

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
a, b = map(int, input().slice())
if a == 2 or b == 2:
    print('No')
else:
    print('Yes')


a, b = map(int, input().split())
if a == 2 or b == 2:
    print('No')
else:
    print('Yes')


Verdicts: Runtime Error

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
N = int(input())
 
W = [[list(input())]]
 
def shiritori(N):
  for i in range(N):
    if any(W[i]):
      return "No"
    else:
    	if W[i-1][-1] == W[i][0]:
          return "Yes"
    	else:
          return "No"
    

        
print(shiritori(N))

A,B = map(int, input().split())

if A*B % 2 == 0:
  print("No")
else:
  print("Yes")

Verdicts: Runtime Error

Accepted
Problem: You are given integers A and B, each between 1 and 3 (inclusive).  Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Submission attempts (in order):
A,B=map(int,input().split())
while True:
    for i in range(1,4):
        if A*B*C%2==1:
            print('Yes')
    print('No')

# coding: utf-8
# Your code here!
A,B=map(int,input().split())
while True:
    for i in range(1,4):
        if A*B*i%2==1:
            print('Yes')
            break
    print('No')
    break

# coding: utf-8
# Your code here!
A,B=map(int,input().split())
if A%2==1 and B%2==1:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
import sys

n = int(input())
l = []
p = None

for i in range(n):
  s = input()
  if s in l && (p == None || p[-1:] == s[1:]):
    l.append(s)
    p = s
  else:
    print("No")
    sys.exit()
print("Yes")

import sys
 
n = int(input())
l = []
p = None
 
for i in range(n):
  s = input()
  if s not in l and (p == None or p[-1:] == s[:1]):
    l.append(s)
    p = s
  else:
    print("No")
    sys.exit()
print("Yes")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
#! /usr/bin/python
n = int(input())
w = list(map(int, stdin.read().splitlines()))
print("Yes" if n == len(set(w)) else "No")


#! /usr/bin/python
from sys import stdin
n = int(input())
w = list(map(int, stdin.read().splitlines()))
print("Yes" if n == len(set(w)) else "No")


#! /usr/bin/python
from sys import stdin
n = int(input())
W = stdin.read().splitlines()
if n != len(set(W)):
    print("No")
    exit()
for i in range(n-1):
    if W[i][-1] != W[i+1][0]:
        print("No")
        exit()
print("Yes")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
n=[input() for _ in range(int(input()))];if len(set(n))!=len(n): print('No');exit()
print('NYoe s'[all([1 if n[i-1][-1]==n[i][0] else 0 for i in range(1,len(n))])::2])

n=[input() for _ in range(int(input()))]
if len(set(n))!=len(n): print('No');exit()
print('NYoe s'[all([1 if n[i-1][-1]==n[i][0] else 0 for i in range(1,len(n))])::2])

Verdicts: Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
n=int(input())
W=[input() for i in range(n)]
cnt=0
for i in range(1,n):
    if W[i-1][-1]==W[i][0]:
        cnt+=1
if cnt==n-1:
    print("Yes")
else:
    print("No")


n=int(input())
W=[input() for i in range(n)]
cnt=0
for i in range(1,n):
    if W[i-1][-1]==W[i][0] and W[i] not in W[:i]:
        cnt+=1
if cnt==n-1:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
import sys
n = int(input())
yetlist = []
for i in range(n):
    word = input()
    if word in yetlist:
        print("No")
        sys.exit()
    if word[0] != yetlist[-1][-1]:
        print("No")
        sys.exit()
    yetlist.append(word)
print("Yes")

import sys
n = int(input())
yetlist = []
for i in range(n):
    word = input()
    if word in yetlist:
        print("No")
        sys.exit()
    if yetlist:
        if word[0] != yetlist[-1][-1]:
            print("No")
            sys.exit()
    yetlist.append(word)
print("Yes")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
if __name__ == '__main__':
  
  flag = 1
  
  wordNum = int(input())
  wordAll = []

  for i in range(wordNum) :

    word = input()
    wordAll.append(word)
    wordLen = len(word)
    
    if i > 0 and wordLast != word[0]:
      flag = 0
      break
    
    for j in range(len(wordAll)):
      if wordAll[j] == word:
        flag == 0
        break
    
    wordLast = word[wordLen - 1]

  if flag == 1 :
    print("Yes")
    
  else :
    print("No")

if __name__ == '__main__':
  
  flag = 1
  
  wordNum = int(input())
  wordAll = []

  for i in range(wordNum) :

    word = input()
    wordAll.append(word)
    wordLen = len(word)
    
    if i > 0 and wordLast != word[0]:
      flag = 0
      break
    
    
    for j in range(len(wordAll)-1):
      if wordAll[j] == word:
        print(j, wordAll[j], word)
        flag = 0
        break
    
    
    wordLast = word[wordLen - 1]
    print(wordAll)
    
  if flag == 1 :
    print("Yes")
    
  else :
    print("No")


if __name__ == '__main__':
  
  flag = 1
  
  wordNum = int(input())
  wordAll = []

  for i in range(wordNum) :

    word = input()
    wordAll.append(word)
    wordLen = len(word)
    
    if i > 0 and wordLast != word[0]:
      flag = 0
      break
    
    
    for j in range(len(wordAll)-1):
      if wordAll[j] == word:
        flag = 0
        break
    
    
    wordLast = word[wordLen - 1]

    
  if flag == 1 :
    print("Yes")
    
  else :
    print("No")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
#-*- coding:utf-8 -*-

def check(words):
    answer = "Yes"
    for i in range(0, len(words)):
        for j in range(i, len(words)):
            if(words[i] == words[j]):
                answer = "No"

    return answer


def main(str):
    words = str.split()
    answer = check(words)
    print(answer)


if __name__ == "__main__":
    num = int(input())  
    str = [input() for i in range(0, num)]  
    main(str)

#-*- coding:utf-8 -*-

def check(words):
    answer = "Yes"

    
    for i in range(0, len(words)):
        for j in range(i+1, len(words)):
            if(words[i] == words[j]):
                answer = "No"

    
    for i in range(0, len(words)-1):
        if(words[i][-1] != words[i+1][0]):
            answer = "No"

    return answer


def main(words):
    answer = check(words)
    print(answer)


if __name__ == "__main__":
    num = int(input())  
    str = [input() for i in range(0, num)]  
    main(str)


Verdicts: Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
N = int(input())
words = []
for _ in range(N):
    words.append(input())
print('Yes' if all(w[i].startswith(w[i-1][-1]) for i in range(1, N)) and len(set(words)) == N else 'No')

N = int(input())
words = []
for _ in range(N):
    words.append(input())
print('Yes' if all(words[i].startswith(words[i-1][-1]) for i in range(1, N)) and len(set(words)) == N else 'No')

Verdicts: Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
n = int(input())
list = []
for i in range(n):
    a = input()
    list.append(a)
def is_unique(seq):
    return len(seq) == len(set(seq))

if is_unique(a) == False:
    print('No')

else:
    for k in range(n-1):
        a = list[k]
        b = list[k + 1]
        if a[-1] == b[0]:
            pass
        else:
            print('No')
            break
    print('Yes')


n = int(input())
list = []
for i in range(n):
    a = input()
    list.append(a)
def is_unique(seq):
    return len(seq) == len(set(seq))

if is_unique(list) == False:
    print('No')

else:
    s = 0
    for k in range(n-1):
        a = list[k]
        b = list[k + 1]
        if a[-1] == b[0]:
            s += 1
        else:
            print('No')
            break
    if (s+1) == n:
        print('Yes')
    else:
        pass


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
import sys
n = int(input())
w = []
for i in range(n):
  word = input()
  if word in w:
    print('No')
    sys.exit()
cur = w[0][-1]
for x in w[1:]:
  if cur != x[0]:
    print('No')
    sys.exit()
  cur = x[-1]
print('Yes')

import sys
n = int(input())
w = []
for i in range(n):
  word = input()
  if word in w:
    print('No')
    sys.exit()
  w.append(word)
cur = w[0][-1]
for x in w[1:]:
  if cur != x[0]:
    print('No')
    sys.exit()
  cur = x[-1]
print('Yes')

Verdicts: Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
n = int(input())
w = [""] * n 
result = "Yes"

for i in range(n):
    tmp = input()
    if tmp in w:
        result = "No"
        break
    w[i] = tmp 
for i in range(n-1):
    if w[i][-1] == w[i+1][0]:
        pass
    else:
        result = "No"
print(result)

n = int(input())
w = [0] * n 
result = "Yes"

for i in range(n):
    w[i] = int(input())
for i in range(n-1):
    if w[i][-1] == w[i+1][0]:
        pass
    else:
        result = "No"
print(result)

n = int(input())
w = [0] * n 
result = "Yes"

for i in range(n):
    tmp = input()
    if tmp in w:
        result = "No"
        break
    w[i] = tmp 
for i in range(n-1):
    if w[i][-1] == w[i+1][0]:
        pass
    else:
        result = "No"
print(result)

n = int(input())
w = [""] * n 
result = "Yes"

for i in range(n):
    tmp = input()
    if tmp in w:
        result = "No"
    w[i] = tmp 
for i in range(n-1):
    if w[i][-1] == w[i+1][0]:
        pass
    else:
        result = "No"
print(result)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
import sys
n=input()
w=input()
l=[]
l.append(w)
for i in range(1,n):
    w=input()
    if w[0]!=l[-1][-1] or w in l:
        print("No")
        sys.exit()
    else:
        l.append(w)
print("Yes")

import sys
n=int(input())
w=input()
l=[]
l.append(w)
for i in range(1,n):
    w=input()
    if w[0]!=l[-1][-1] or w in l:
        print("No")
        sys.exit()
    else:
        l.append(w)
print("Yes")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
N = int(input())

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

def alg1(W):
  list = []
  point = W[0]
  for i in range(1,N):
    if W[i] not in list and W[i][0] == point[-1]:
      list.append(W[i])
      point = W[i]
      pass
    else:
      return 'No'
  return 'Yes'

print(alg1(W))

N = int(input())

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

def alg1(W):
  list = [W[0],]
  point = W[0]
  for i in range(1,N):
    if W[i] not in list and W[i][0] == point[-1]:
      list.append(W[i])
      point = W[i]
    else:
      return 'No'
  return 'Yes'

print(alg1(W))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
N=int(input())
W={}
A={}
count=0
for i in range(N):
	A=W[i]=str(input())
for i in range(N):
	a=A.count(W[i])
	if a>=2:
		print("No")
		count=1
for i in range(N-1):
	s=0
	for j in W[i+1]:
		s=s+1
		if s==1:
			t=j
		for k in W[i]:
			r=k
	if t!=r and count==0:
		print("No")
		count=1
if count==0:
	print("Yes")

N=int(input())
W=[]
count=0
for i in range(N):
	w=str(input())
	W.append(w)
for i in range(N):
	c=0
	for j in range(N):
		if W[i]==W[j]:
			c=c+1
		if c>=2 and count==0:
			print("No")
			count=1
for i in range(N-1):
	s=0
	for j in W[i+1]:
		s=s+1
		if s==1:
			t=j
		for k in W[i]:
			r=k
	if t!=r and count==0:
		print("No")
		count=2
if count==0:
	print("Yes")

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
num_word = int(input())
word_list = []
flag = True

for i in range(num_word):
    word_list.append(input())

for j in range(num_word - 1):
    word1 = word_list[j]
    word2 = word_list[j + 1]
    if word1[len(word1) - 1] != word2[0]:
        flag = False
        break

if flag:
    print("Yes")
else:
    print("No")

num_word = int(input())
word_list = []
flag = True

for i in range(num_word):
    word_list.append(input())

for j in range(num_word - 1):
    word1 = word_list[j]
    word2 = word_list[j + 1]
    for k in range(j):
        if word1 == word_list[k]:
            flag = False
            break
    if word1[len(word1) - 1] != word2[0]:
        flag = False
        break
for l in range(num_word  - 1):
    if word_list[num_word - 1] == word_list[l]:
        flag = False

if flag:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
import sys

input = sys.stdin.readline

N = int(input())
W = []
for _ in range(N):
    W.append(input().strip())

check = set()
flag = True
before = W[0][-1]
for i in range(1, N):
    if before != W[i][0] or W[i] in check:
        flag = False
        break
    else:
        before = W[i][-1]
        check.add(W[i])

if flag:
    print('Yes')
else:
    print('No')



import sys

input = sys.stdin.readline

N = int(input())
W = []
for _ in range(N):
    W.append(input().strip())

check = set(W[0])
flag = True
before = W[0][-1]
for i in range(1, N):
    if before != W[i][0] or W[i] in check:
        flag = False
        break
    else:
        before = W[i][-1]
        check.add(W[i])

if flag:
    print('Yes')
else:
    print('No')



import sys

input = sys.stdin.readline

N = int(input())
W = []
for _ in range(N):
    W.append(input().strip())

check = set()
flag = True
before = W[0][-1]
for i in range(1, N):
    if before != W[i][0] or W[i] in check:
        flag = False
    else:
        before = W[i][-1]
        check.add(W[i])

if flag:
    print('Yes')
else:
    print('No')



import sys

input = sys.stdin.readline

N = int(input())
W = []
for _ in range(N):
    W.append(input().strip())

check = set([W[0]])
flag = True
before = W[0][-1]
for i in range(1, N):
    if before != W[i][0] or W[i] in check:
        flag = False
        break
    else:
        before = W[i][-1]
        check.add(W[i])

if flag:
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
n=int(input())
s=[input() for i in range(n)]
p=list(s[0])[0]
from collections import Counter
c=Counter(s)
if sum(c.values())!=n:
    print("No")
    exit()
else:
    for i in s:
        a=list(i)[0]
        b=list(i)[-1]
        if p==a:
            p=b
        else:
            print("No")
            exit()
print("Yes")
        

n=int(input())
s=[input() for i in range(n)]
p=list(s[0])[0]
from collections import Counter
c=Counter(s)
if [1 for i in range(n)]!=list(c.values()):
    print("No")
    exit()
else:
    for i in s:
        a=list(i)[0]
        b=list(i)[-1]
        if p==a:
            p=b
        else:
            print("No")
            exit()
print("Yes")
        

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
num = int(input())
lis = [input() for i in range(num)]
li = []
end = lis[0][-1]
for n in range(1,num):
    if end == lis[n][0]:li.append(lis[n])
    end = lis[n][-1]
if len(set(li)) == num-1:print("Yes")
else:print("No")

num = int(input())
lis = [input() for i in range(num)]
li = []
end = lis[0][-1]
for n in range(1,num):
    if end == lis[n][0]:li.append(lis[n])
    end = lis[n][-1]
if len(set(li)) == num-1:print("Yes")
else:print("No")

num = int(input())
lis = [input() for i in range(num)]
li = [lis[0]]
end = lis[0][-1]
for n in range(1,num):
    if end == lis[n][0]:li.append(lis[n])
    end = lis[n][-1]
if len(set(li)) == num-1:print("Yes")
else:print("No")

num = int(input())
lis = [input() for i in range(num)]
for n in range(0,num-1):
    if lis[n][-1] != lis[n+1][0]:print("No");exit()
if len(set(lis)) == num:print("Yes")
else:print("No")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
x = input().split('\n')
n = int(x[0])
w = [x[i] for i in range(1, n+1)]

def chk_shiri(w):
    for i in range(n - 1):
        if w[i][-1] == w[i + 1][0]:
            continue
        else:
            return False
    return True
    
if len(w) != len(set(w)):
    print('No')
elif chk_shiri(w):
    print('Yes')
else:
    print('No')
    

x = input().split('\n')
n = int(x[0])
w = [x[i] for i in range(1, n+1)]

def chk_shiri(w):
    for i in range(n - 1):
        if w[i][-1] == w[i + 1][0]:
            continue
        else:
            return False
    return True
    
if len(w) != len(set(w)):
    print('No')
elif chk_shiri(w):
    print('Yes')
else:
    print('No')
    

n = int(input())
w = []
for i in range(n):
    w.append(input())

def chk_shiri(w):
    for i in range(n - 1):
        if w[i][-1] == w[i + 1][0]:
            continue
        else:
            return False
    return True
    
if len(w) != len(set(w)):
    print('No')
elif chk_shiri(w):
    print('Yes')
else:
    print('No')
    
    
    

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
N = int(input())
S = [input() for _ in range(N)]

if len(S) != len(set(S)):
    print("No")

next_s = ""
for s in S:
    if next_s == "":
        next_s = s[-1]
        continue
    
    if next_s != s[0]:
        print("No")
        break
    
    next_s = s[-1]
else:
    print("Yes")



N = int(input())
S = [input() for _ in range(N)]

if len(S) != len(set(S)):
    print("No")

next_s = S[0][0]
for s in S:
    if next_s != s[0]:
        print("No")
        break
    
    next_s = s[-1]
else:
    print("Yes")



N = int(input())
S = [input() for _ in range(N)]

if len(S) != len(set(S)):
    print("No")
    
else:
    next_s = S[0][0]
    for s in S:
        if next_s != s[0]:
            print("No")
            break
        
        next_s = s[-1]
    else:
        print("Yes")
    


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
n = int(input())
last = ""
flg = 0
li = []
for i in range(n):
    s = input()
    str = list(s)  
    if last == "":
        last = str[-1]
        continue

    if str[0] != last or s in li:
        flg = 1

    last = str[-1]
    li.append(s)


if flg == 0:
    print("Yes")
else:
    print("No")


n = int(input())
last = ""
flg = 0
li = []
for i in range(n):
    s = input()
    str = list(s)  
    if last == "":
        last = str[-1]
        li.append(s)
        continue

    if str[0] != last or s in li:
        flg = 1

    last = str[-1]
    li.append(s)


if flg == 0:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
# coding:utf-8
def main():
    N = int(input())
    d = {}
    stack = []
    result = 'Yes'
    if N == 0: result = 'No'
    for i,n in enumerate(range(N),start=0):
        stack.append(input().strip())
        if i == 0: continue
        if result == 'No': continue
        if stack[-1] not in d and stack[-2][-1]==stack[-1][0]:
            d[stack[-1]] = True
        else:
            result = 'No'
    print(result)

if __name__ == '__main__':
    main()

# coding:utf-8
def main():
    N = int(input())
    d = {}
    stack = []
    result = 'Yes'
    for i,n in enumerate(range(N),start=0):
        stack.append(input().strip())
        if i == 0: continue
        if result == 'No': continue
        if stack[-1] not in d and stack[-2][-1]==stack[-1][0]:
            d[stack[-1]] = True
        else:
            result = 'No'
    print(result)

if __name__ == '__main__':
    main()

# coding:utf-8
N = int(input())
d = {}
stack = []
result = 'Yes'
for i,n in enumerate(range(N),start=0):
    stack.append(input())
    if i == 0: continue
    if result == 'No': continue
    if stack[-1] not in d and stack[-2][-1]==stack[-1][0]:
        d[stack[-1]] = True
    else:
        result = 'No'
print(result)

# coding:utf-8
N = int(input())
d = {}
stack = []
result = 'Yes'
for i,n in enumerate(range(N),start=0):
    stack.append(input().strip())
    if i == 0: continue
    if result == 'No': continue
    if stack[-1] not in d and stack[-2][-1]==stack[-1][0]:
        d[stack[-1]] = True
    else:
        result = 'No'
print(result)

n=int(input())
s=[input()for _ in[0]*n]
f=0
for i in range(1,n):
    f+=s[i-1][-1]!=s[i][0]
print("No"if f or len(set(s))<n else"Yes")


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
import sys
if __name__ == '__main__':
    N = int(input())
    W = [str(input()) for _ in range(N)]
    for i in range(1,N):
        if W[i-1][-1] != W[i][0]:
            print('No')
            sys.exit(0)
    print('Yes')

import sys
if __name__ == '__main__':
    N = int(input())
    W = [int(input()) for _ in N]
    for i in range(1,N):
        if W[i-1][-1] != W[i][0]:
            print('No')
            sys.exit()
    print('Yes')

import sys
if __name__ == '__main__':
    N = int(input())
    W = [int(input()) for _ in range(N)]
    for i in range(1,N):
        if W[i-1][-1] != W[i][0]:
            print('No')
            sys.exit()
    print('Yes')

import sys
if __name__ == '__main__':
    N = int(input())
    W = [str(input()) for _ in range(N)]
    if len(W) != len(set(W)):
        print('No')
        sys.exit(0)
    for i in range(1,N):
        if W[i-1][-1] != W[i][0]:
            print('No')
            sys.exit(0)
    print('Yes')

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
N = int(input())

tmpW = input()
past = set()
flag = True
for i in range(N-1):
  W = input()
  if(tmpW[-1:] != W[0:1]):
    flag = False
  elif(W in past):
    flag = False
  tmpW = W
  
  past.add(W)

if(flag is True):
  print("Yes")
else:
  print("No")

N = int(input())

tmpW = input()
past = set()
past.add(tmpW)
flag = True
for i in range(N - 1):
    W = input()
    if(tmpW[-1:] != W[0:1]):
        flag = False
    elif(W in past):
        flag = False
    tmpW = W

    past.add(W)
    # print(past)

if(flag is True):
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is practicing _shiritori_ alone again today.  Shiritori is a game as follows:    * In the first turn, a player announces any one word.   * In the subsequent turns, a player announces a word that satisfies the following conditions:     * That word is not announced before.     * The first character of that word is the same as the last character of the last word announced.  In this game, he is practicing to announce as many words as possible in ten seconds.  You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Submission attempts (in order):
n=int(input())
Y=input()
y=list(Y)
p=len(y)-1
last=y[p]
m=[]
v=1
for i in range(n-1):
    x=input()
    if x in m:
        v=0
    m.append(x)
    z=list(x)
    if last!=z[0]:
        v=0
    p = len(z) - 1
    last = z[p]
if v==0:
    print('No')
else:
    print('Yes')

import sys
n = int (input())
words = []
No=" "
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]:
        No="No"
        print (No)
        sys.exit() 
If No != "No":
     print ("Yes")

a=int(input())
c=0
z=[]
y=[]
b=[]
for i in range(a):
    x=str(input())
    z.append(x[0])
    y.append(x[-1])
    if i==0:
        b.append(x)
    if x not in b and z[i]==y[i-1]:
        b.append(x)
        c+=1
if c==a-1:
    print("YES")
else:
    print("NO")

from collections import Counter
f = open('pokemon', 'r')
names = []
for line in f:
    names.append(line)
max_length = 0
pokemon = ''
for i in range(len(names)):
    p = [names[i]]
    start = names[i][-2]
    shiritori = True
    count = 1
    while shiritori == True:
        shiritori = False
        for j in range(len(names)):
            if i != j and names[j][0] == start and not names[j] in p:
                count += 1
                start = names[j][-2]
                shiritori = True
                p.append(names[j])
                if count > max_length:
                    max_length = count
                    pokemon = names[i]
                break
    print (p)
print (pokemon + str(max_length))

n = int(input())
W = [ input() for _ in range(n) ]
if sorted(W) != sorted(list(set(W))):
  print("No")
else:
  for i in range(n-1):
    if W[i][-1] != W[i+1][0]:
      print("No")
      exit()
  print("Yes")

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Accepted