problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p03261 | u480172743 | 2,000 | 1,048,576 | 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... | ['n = int(input())\n\ns = [input() for i in range(n)]\n\ndef shiritori(s):\n if len(s) != len(set(s)):\n return "No"\n \n for i in range(n-1):\n if s[i][-1] != s[i+1][0]:\n return "No"\n \n return "Yes"\n\nshiritori()', 'n = int(input())\n\ns_list = []\nfor i in range(n):\n s = input()\n s_list.append... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s790347199', 's949702102', 's705711502'] | [3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0] | [217, 255, 293] |
p03261 | u484856305 | 2,000 | 1,048,576 | 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... | ["N=int(input())\nS=[input() for i in range(N)]\nprint(S)\nans='Yes'\nif len(set(S))!=N:\n ans='No'\nfor i in range(N-1):\n if S[i][-1]!=S[i+1][0]:\n ans='No'\nprint(ans)", "N=int(input())\nS=[input() for i in range(N)]\nans='Yes'\nif len(set(S))!=N:\n ans='No'\nfor i in range(N-1):\n if S[i][-1]!=S[... | ['Wrong Answer', 'Accepted'] | ['s550147736', 's633543490'] | [3064.0, 3060.0] | [18.0, 17.0] | [172, 163] |
p03261 | u486251525 | 2,000 | 1,048,576 | 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... | ['N = int(input())\npast = []\nlast = ""\nfor i in range(N):\n W = input()\n print("past:", past)\n print("W[0]:", W[0])\n print("last[-1]:", last[-1:])\n if last == "":\n past.append(W)\n last = W\n elif W in past or W[0] != last[-1:]:\n print("No")\n exit()\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s895761254', 's847618174'] | [3060.0, 3060.0] | [19.0, 17.0] | [354, 411] |
p03261 | u494058663 | 2,000 | 1,048,576 | 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... | ["import sys\nimport collections\n\nN = int(input())\nList = [list(input()) for i in range(N)]\ntmp = []\n\nfor i in range(1,N-1):\n if (List[i][0] != List[i-1][-1]):\n print('No')\n sys.exit()\n tmp.append(str(List[i]))\n\n\nList_dict = collections.Counter(tmp)\nfor i,j in List_dict.items():\n i... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s190254474', 's249650539', 's378794624'] | [3316.0, 3060.0, 3316.0] | [21.0, 17.0, 22.0] | [363, 183, 302] |
p03261 | u497625442 | 2,000 | 1,048,576 | 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... | ['import collecions\n\nN = int(input())\nW = [input() for i in range(N)]\nc = collecions.Counter(W)\n\nfor i in range(N-1):\n if W[i][-1] != W[i+1][1]:\n print("No")\n exit()\nif len(c) != N:\n print("No")\n exit()\nprint("Yes")', 'import collections\n\nN = int(input())\nW = [input() for i in ran... | ['Runtime Error', 'Accepted'] | ['s788113453', 's838022981'] | [3064.0, 3444.0] | [17.0, 88.0] | [236, 238] |
p03261 | u502486340 | 2,000 | 1,048,576 | 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... | ["N = int(input())\n\nappeared = []\nprev = input()\nfor i in range(N-1):\n S = input()\n if prev[-1] != S[0] or S in appeared:\n print('No')\n exit()\n prev = S\n appeared += [S]\nprint('Yes')\n", "N = int(input())\n\nappeared = []\nprev = input()\nfor i in range(N-1):\n appeared += [prev]... | ['Wrong Answer', 'Accepted'] | ['s904823633', 's589381200'] | [2940.0, 2940.0] | [18.0, 18.0] | [207, 210] |
p03261 | u514894322 | 2,000 | 1,048,576 | 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... | ["n = int(input())\nsl = [input() for _ in [0]*n]\nans = 'Yes'\nfor i in range(1,n):\n if sl[i-1][-1] != sl[i][0]:\n ans = 'No'\nprint(ans)", "n = int(input())\nsl = [input() for _ in [0]*n]\nans = 'Yes'\nfor i in range(1,n):\n if sl[i-1][-1] != sl[i][0] or sl.count(sl[i]) != 1 :\n ans = 'No'\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s011056896', 's275552793'] | [3060.0, 3060.0] | [17.0, 17.0] | [135, 160] |
p03261 | u515952036 | 2,000 | 1,048,576 | 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... | ['n = int(input())\nword = []\nfor i in range(n):\n\tword.append(input())\n\nif is_unique(word) == False:\n\tprint("No")\n\texit()\n\nfor i in range(1,len(word)):\n\tif word[i-1][-1] != word[i][0]:\n\t\tprint("No")\n\t\texit()\n\nprint("Yes")', 'n = int(input())\nword = []\nfor i in range(n):\n\tword.append(input())\n\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s068815923', 's212215826', 's308846984'] | [3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0] | [218, 219, 221] |
p03261 | u518042385 | 2,000 | 1,048,576 | 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... | ['n=int(input())\nl=[list(input())]\nb=True\nfor i in range(n-1):\n w=list(input())\n if l[-1][-1]==w[0]:\n l.append(w)\n else:\n b=False\n break\nif len(set(l))=n and b==True:\n print("Yes")\nelse:\n print("No")\n \n\n ', 'i=int(input())\nl=[]\nc=True\nfor k in range(1,i+1):\n l.append(list(input())\n... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s319533601', 's686246627', 's803071839', 's930738616', 's539707813'] | [2940.0, 2940.0, 3060.0, 2940.0, 3060.0] | [17.0, 17.0, 19.0, 17.0, 17.0] | [218, 257, 220, 251, 205] |
p03261 | u523964576 | 2,000 | 1,048,576 | 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... | ['n=int(input())\na=[]\nfor i in range(n):\n a.append(input())\nflag=0\nfor i in range(n):\n s=a[i]\n \n if i==0:\n continue\n else:\n if last!=a[i][len(a[i])-1]:\n flag=1\n \n last=a[i][len(a[i])-1]\nif flag==1:\n print("No")\nelse:\n print("Yes")', 'n=int(input())\n... | ['Runtime Error', 'Accepted'] | ['s584064709', 's637027552'] | [3060.0, 3060.0] | [17.0, 17.0] | [280, 314] |
p03261 | u527261492 | 2,000 | 1,048,576 | 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... | ["import sys\nn=int(input())\nw=[input() for i in range(n)]\nif all(w[j][len(w[j])]==w[j+1][0] for j in range(n-1)) and len(set(w))==n:\n print('Yes')\n sys.exit()\nprint('No')", "import sys\nn=int(input())\nw=[input() for i in range(n)]\nif all(w[j][len(w[j])-1]==w[j+1][0] for j in range(n-1)) and len(set(w))==n:\n ... | ['Runtime Error', 'Accepted'] | ['s585345824', 's183018425'] | [3060.0, 3060.0] | [18.0, 17.0] | [170, 173] |
p03261 | u527464580 | 2,000 | 1,048,576 | 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... | ["N = int(input())\nword = []\nflag = True\nword.append(input())\nfor _ in range(N - 1):\n w = input()\n if w in word:\n flag = False\n elif word[-1][-1] != w[0]:\n flag = False\n else:\n word.append(w)\n\nif flag:\n print('YES')\nelse:\n print('NO')\n", "N = int(input())\nword = ... | ['Wrong Answer', 'Accepted'] | ['s359498512', 's112257761'] | [3060.0, 3060.0] | [18.0, 18.0] | [272, 272] |
p03261 | u527993431 | 2,000 | 1,048,576 | 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... | ['N=int(input())\nL=[]\ncount=0\nfor i in range (N):\n\tL.append(int(input()))\nif len(set(L))!=N:\n\tprint("No")\nelse:\n\tfor i in range (N-1):\n\t\tif L[i][-1]!=L[i+1][0]:\n\t\t\tcount+=1\n\tif count==0:\n\t\tprint("Yes")\n\telse:\n\t\tprint("No")', 'N=int(input())\nL=[]\ncount=0\nfor i in range(N):\n\tL.append(inpu... | ['Runtime Error', 'Accepted'] | ['s213339314', 's876814537'] | [3060.0, 3064.0] | [17.0, 18.0] | [220, 193] |
p03261 | u529725069 | 2,000 | 1,048,576 | 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... | ["import sys\n\na = []\nfor line in sys.stdin:\n a.append(int(line))\nN = len(a)\ncount = 0\nflag = True\nfor i in range(N):\n a_i = a[i]\n a_ii = a[i+1]\n if ai[-1] != a_ii[0]:\n flag = None\n break\n for j in range(i+1, N):\n if a[i] == a[j]:\n flag = None\n b... | ['Runtime Error', 'Accepted'] | ['s345660372', 's931722226'] | [3064.0, 3064.0] | [17.0, 18.0] | [353, 334] |
p03261 | u533885955 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nshiri = []\nflag = 0\nfor i in range(N):\n tugi = str(input())\n tlist = list(tugi)\n if i!=0:\n if tugi in shiri:\n flag = 1\n break\n else:\n mae = list(shiri[i-1])\n if tlist[0]!=mae[-1]:\n flag = 1\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s129108733', 's332842609', 's058491512'] | [3064.0, 3060.0, 3064.0] | [18.0, 18.0, 18.0] | [453, 345, 453] |
p03261 | u535827181 | 2,000 | 1,048,576 | 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... | ["N = int(input())\nA = []\nfor i in range(N):\n A.append(input())\n\nfor i in range(N-1):\n S = 0\n if A[i][-1] == A[i+1][0]:\n S += 1\nfor i in range(N):\n for j in range(N):\n if i != j:\n if A[i] == A[j]:\n A == 1\n else:\n A == 0\n\nif S == 1 and A == 0:\n print('Yes')... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s072618915', 's389926448', 's849106639', 's787622088'] | [2940.0, 2940.0, 3064.0, 3064.0] | [17.0, 17.0, 19.0, 20.0] | [306, 332, 352, 324] |
p03261 | u536377809 | 2,000 | 1,048,576 | 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... | ['n=int(input())\nw=[input() for _ in range(n)]\n\nif len(set(w))!=len(w):\n print("No")\nelse:\n for i in range(1,n):\n if w[i][0]!=w[i-1][-1]:\n print("No")\n exit()\n\nprint("Yes")', 'n=int(input())\nw=[input() for _ in range(n)]\n\nif len(set(w))!=len(w):\n print("No")\nelse:\n for i in range(1,n):... | ['Wrong Answer', 'Accepted'] | ['s845180248', 's481150858'] | [3060.0, 3060.0] | [17.0, 17.0] | [185, 193] |
p03261 | u538739837 | 2,000 | 1,048,576 | 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... | ['flag=True\nfor i in range(n):\n w.append(input())\n \nfor i in range(n-1):\n if w[i][-1]!=w[i+1][0]:\n #print(i,"out1")\n flag=False\n\nfor i in range(n-1):\n for j in range(i+1,n):\n if(w[i]==w[j]):\n #print(i,j,"out2")\n flag=False\n\nif flag==True:\n print(... | ['Runtime Error', 'Accepted'] | ['s447998382', 's680872350'] | [3060.0, 3060.0] | [17.0, 18.0] | [333, 353] |
p03261 | u538808095 | 2,000 | 1,048,576 | 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... | ['N = int(input())\n\nshiritori_set = set()\n\nshiritori = input()\nhead = shiritori[len(shiritori) -1]\n\nans = "Yes"\n\nfor i in range(N-1):\n shiritori = input()\n if (shiritori[0] == head and shiritori not in shiritori_set):\n head = shiritori[len(shiritori)-1]\n shiritori_set.add(shiritori)\n continue\n... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s760113097', 's978837026', 's948090228'] | [3060.0, 3188.0, 3064.0] | [19.0, 18.0, 18.0] | [355, 351, 360] |
p03261 | u545368057 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nws = [input()]\n\nflg = True\nfor i in range(N-1):\n Wi = input()\n if Wi in ws:\n flg = False\n elif ws[-1] != Wi[0]:\n flg = False\n ws.append(Wi)\n\n', 'N = int(input())\nws = [input()]\n\nflg = True\nfor i in range(N-1):\n Wi = input()\n if Wi in ws:\n flg ... | ['Wrong Answer', 'Accepted'] | ['s079000600', 's170806077'] | [2940.0, 3060.0] | [17.0, 17.0] | [184, 234] |
p03261 | u548303713 | 2,000 | 1,048,576 | 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... | ['n=int(input())\na=input()\nb=a[len(a)-1]\nword1=[a]\nword2=[b]\nc=0\n\nfor i in range(n-1):\n aa=input()\n bb=aa[0]\n if aa not in word1 and word2[i]==bb:\n word1.append(aa)\n top=aa[len(aa)-1]\n word2.append(top)\n else:\n c=1\n \nprint("Yes" if c==0 else "No")', 'n=int... | ['Runtime Error', 'Accepted'] | ['s412042950', 's090278303'] | [3064.0, 3064.0] | [18.0, 18.0] | [292, 306] |
p03261 | u548624367 | 2,000 | 1,048,576 | 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... | ['n=int(input())\nw=[input() for i in range(n)]\nflag=True\nfor s in w:\n if w.count(s) > 1:\n flag = False\nfor i in range(1,n)\n if w[i][0] != w[i-1][len(w[i-1])-1]:\n flag = False\nprint("Yes" if flag else "No")\n', 'n=int(input())\nw=[input() for i in range(n)]\nflag=True\nfor s in w:\n if w.... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s330042039', 's469292753', 's588512789'] | [2940.0, 2940.0, 3060.0] | [20.0, 17.0, 19.0] | [224, 233, 198] |
p03261 | u549383771 | 2,000 | 1,048,576 | 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... | ["n = int(input())\nword_list = []\nflag = True\nfor i in range(n):\n word = input()\n if word_list == []:\n word_list.append(word)\n else:\n if word_list[-1][-1] == word[0]:\n word_list.append(word)\n else:\n flag = False\n break\n \nif flag:\n ... | ['Wrong Answer', 'Accepted'] | ['s390298817', 's380149510'] | [3060.0, 3060.0] | [17.0, 17.0] | [340, 370] |
p03261 | u550943777 | 2,000 | 1,048,576 | 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... | ["N = int(input())\nword = [input() for _ in range(N)]\ns = set(word)\nif len(s) != N:\n print('No')\n exit\nok = True\nfor i in range(1,N):\n if word[i][0] != word[i-1][-1] :\n ok = False\nprint('Yes' if ok else 'No')\n", "N = int(input())\nword = [input() for _ in range(N)]\ns = set(word)\nok = True\nif len(s) ... | ['Wrong Answer', 'Accepted'] | ['s810479817', 's399231506'] | [3060.0, 3060.0] | [18.0, 19.0] | [213, 207] |
p03261 | u556589653 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nls = []\nw = []\nfor i in range(N):\n ls.append(str(input())\nfor j in range(1,N):\n if ls[j-1][(len(ls[j])-1):] and ls[j][(len(ls[j])-1):]\n if ls[j-1] in w:\n print("No")\n else:\n w.append(ls[j-1])\n else:\n print("No")\n break', 'N = int(input())\nw = []\nw1 = ""\nflag =... | ['Runtime Error', 'Accepted'] | ['s991535838', 's374251933'] | [2940.0, 9112.0] | [17.0, 25.0] | [260, 277] |
p03261 | u556594202 | 2,000 | 1,048,576 | 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... | ['n = int(input())\nw = [input() for _ in range(n)]\n\nflag=True\nif len(set(w))!=n:\n flag=False\n \nfor i in range(n-1):\n print(flag)\n if w[i][-1]!=w[i+1][0]:\n flag=False\n\nprint("Yes" if flag else "No")\n', 'n = int(input())\nw = [input() for _ in range(n)]\n\nflag=True\nif len(set(w))!=n:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s135750145', 's423708508', 's977570485'] | [9136.0, 9140.0, 9168.0] | [29.0, 30.0, 33.0] | [215, 215, 198] |
p03261 | u556712459 | 2,000 | 1,048,576 | 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... | ['n = int(input())\nflag = True\ns = []\nw1 = input()\ne = w1[-1]\nprint(e)\nfor i in range(n-1):\n wi = input()\n if e != wi[0]:\n flag = False\n e = wi[-1]\n print(e)\n\nif flag:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\nflag = True\ns = []\nwords = []\nw1 = input()\nwords.append(w... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s035444120', 's097018240', 's175086096', 's676327938'] | [3064.0, 3064.0, 3060.0, 3064.0] | [18.0, 19.0, 17.0, 18.0] | [219, 333, 191, 313] |
p03261 | u558782626 | 2,000 | 1,048,576 | 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... | ['N = int(input())\na = input()\nfor i in range(N-1):\n b = input()\n if a[-1] != b[0]:\n print("No")\n else:\n a = b\n\nprint("Yes")\n \n ', 'N = int(input())\nwords = [input() for _ in range(N)]\na = words[0]\nif len(set(words)) != N:\n print("No")\n exit()\nfor i in range(1, N):\n b = words[i]\n if a... | ['Wrong Answer', 'Accepted'] | ['s361823387', 's602971462'] | [2940.0, 3060.0] | [17.0, 17.0] | [138, 231] |
p03261 | u561828236 | 2,000 | 1,048,576 | 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... | ['import copy\nn = int(input())\n\nword = [input() for _ in range(n)]\nword2 = copy.deepcopy(word)\nword2.append("pogyaaaaaaaaaaaaaaaaaaa")\nflag = 0\n\n\nfor index, q in enumerate(word):\n for index2, w in enumerate(word):\n if index == index2:\n continue\n \n if q == w:\n ... | ['Wrong Answer', 'Accepted'] | ['s449721827', 's281301339'] | [3444.0, 3444.0] | [25.0, 25.0] | [559, 557] |
p03261 | u567124995 | 2,000 | 1,048,576 | 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... | ["N = int(input())\na = list(input() for i in range(N))\nfor i in range(N):\n\t\tif a[i+1] == a[i]:\n\t\t\tprint('No')\n\t\t\tbreak\n\t\telif a[i+1][0:1] != a[i][-1:]:\n\t\t\tprint('No')\n\t\t\tbreak\n\t\telif N == 1:\n\t\t\tprint('Yes')\n\t\t\tbreak\n\t\telse:\n\t\t\tprint('Yes')\n\t\t\tbreak", "N = int(input())\na = ... | ['Wrong Answer', 'Accepted'] | ['s916525883', 's931865535'] | [3060.0, 3060.0] | [17.0, 18.0] | [246, 345] |
p03261 | u575431498 | 2,000 | 1,048,576 | 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... | ["N = int(input())\nW = [input() for _ in range(N)]\n\nprev = ''\nif len(set(W)) != len(W):\n exit(0)\n\nprev = W[0]\nfor w in W[1:]:\n if prev[-1] != w[0]:\n print(prev[-1], w[0])\n print('No')\n exit(0)\n prev = w\nprint('Yes')", "N = int(input())\nW = [input() for _ in range(N)]\n\nprev... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s369690250', 's740856835', 's371677282'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0] | [243, 213, 219] |
p03261 | u576917603 | 2,000 | 1,048,576 | 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... | ['n=int(input())\nw=[input() for i in range(n)]\nlast=""\nwl=[]\nans="Yes"\nfor x,i in enumerate(w):\n if x==0:\n last=i[-1]\n continue\n if i in wl:\n ans="No"\n if i[0]!=last:\n ans="No"\n last=i[-1]\n wl.append(i)\nprint(ans)', 'n=int(input())\nw=[input() for i in range(n)]... | ['Wrong Answer', 'Accepted'] | ['s349820693', 's426983285'] | [3064.0, 3064.0] | [17.0, 17.0] | [254, 275] |
p03261 | u578489732 | 2,000 | 1,048,576 | 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... | ["# -*- coding: utf-8 -*-\nimport sys\nn = int(input());\nwords = []\n\nfor i in range(n):\n words.append(input())\n\n\n if (len(words) > len(set(words))):\n print('No')\n sys.exit(0)\n\nbefore_word = words.pop(0)\nwhile( len(words) > 0 ):\n after_word = words.pop(0)\n \n if... | ['Runtime Error', 'Accepted'] | ['s263858750', 's559108134'] | [2940.0, 3064.0] | [18.0, 18.0] | [513, 385] |
p03261 | u580362735 | 2,000 | 1,048,576 | 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... | ["import collections\n\nN = int(input())\nW = [input() for i in range(N)]\nw = collections.Counter(W)\nprint(w)\nif len(w.values()) != len(W):\n print('No')\nelse:\n for i in range(len(W)-1):\n s = W[i]\n tmp = s[len(s)-1]\n s_next = W[i+1]\n if tmp != s_next[0]:\n print('No')\n break\n else:\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s777732703', 's994702848', 's638888346'] | [3316.0, 3316.0, 3316.0] | [22.0, 21.0, 21.0] | [318, 307, 309] |
p03261 | u581403769 | 2,000 | 1,048,576 | 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... | ["n=int(input)\nflag=True\na=0\nl=[]\nfor i in range(n):\n b=a\n l.append(b)\n a=list(input())\n if i>0:\n if a[0]!=b[-1] or a in l:\n flag=False\nif flag:\n print('Yes')\nelse:\n print('No')", "n=int(input())\nflag=True\na=0\nl=[]\nfor i in range(n):\n b=a\n l.append(b)\n a... | ['Runtime Error', 'Accepted'] | ['s391797979', 's970062692'] | [2940.0, 3060.0] | [17.0, 18.0] | [211, 213] |
p03261 | u585101972 | 2,000 | 1,048,576 | 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... | ['\n\n#include <utility>\n#include <numeric>\n#include <functional>\n#include <stdio.h>\n#include <math.h>\n#include <string>\n#include <algorithm>\n#include <deque>\n\n#include <map>\n\n#define rep(i, m, n) for (int (i)(m); (i)<(n); ++(i))\n#define repr(i, m, n) for (int (i)(m - 1); (i)>=(n); --(i))\n#define repv(i, v... | ['Runtime Error', 'Accepted'] | ['s879893857', 's589183909'] | [2940.0, 3064.0] | [17.0, 19.0] | [1657, 352] |
p03261 | u588081069 | 2,000 | 1,048,576 | 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... | ['N = int(input())\n\nw = str(input())\nw_end = w[-1]\n\ntmp = []\ntmp.append(w)\nresult = False\n\nfor i in range(N - 1):\n w = str(input())\n if w[0] == w_end and w not in tmp:\n result = True\n else:\n print("not ok: {}".format(w))\n result = False\n w_end = w[-1]\n\nif result is Tru... | ['Wrong Answer', 'Accepted'] | ['s372692317', 's113837561'] | [3064.0, 3060.0] | [19.0, 19.0] | [342, 265] |
p03261 | u589381719 | 2,000 | 1,048,576 | 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... | ['N=int(input())\nwords=[]\nflg=True\n\nbefore=input()\nN=N-1\n\nfor i in range(N):\n s=input()\n if before[-1] != s[0]:\n flg=False\n words.append(s)\n if len(words) != len(set(words)):\n flg=False\n before=s\nprint("Yes" if flg else "No")', 'N=int(input())\nwords=[]\nflg=True\n\nbefore=in... | ['Wrong Answer', 'Accepted'] | ['s680210460', 's381476074'] | [3064.0, 3060.0] | [17.0, 18.0] | [252, 265] |
p03261 | u598530761 | 2,000 | 1,048,576 | 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... | ["N = int(input())\n\nword = [word.append(input()) for i in range(N)]\n\n\nfor i in range(1, N):\n if word[i][0] != word[i - 1][-1] or word.count(word[i]) != 1:\n print('No')\n exit()\n\nprint('Yes')\n\n", "N = int(input())\n\nword = [input() for i in range(N)]\n#word = []\n\n\n\nfor i in range(1, N):\... | ['Runtime Error', 'Accepted'] | ['s409152631', 's979478552'] | [3056.0, 2940.0] | [17.0, 18.0] | [206, 249] |
p03261 | u600402037 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nW = [input() for _ in range(N)]\nbl = True\nif len(W) != len(set(W)):\n bl = False\nfor i in range(N-1):\n if W[i][-1] != W[i+1][0]:\n bl = False\nprint(bl)\n', "N = int(input())\nW = [input() for _ in range(N)]\nbl = True\nif len(W) != len(set(W)):\n bl = False\nfor i in range(N-1):... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s139517823', 's718499398', 's756995564'] | [3060.0, 3060.0, 3064.0] | [17.0, 17.0, 18.0] | [180, 199, 319] |
p03261 | u606033239 | 2,000 | 1,048,576 | 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... | ['n = int(input())\nw = []\na = input()\nw.append(a)\n\nfor i in range(n):\n b = input()\n if b[0] != a[-1] or b in count:\n print("No")\n quit()\n count.append(b)\n a=b\nprint("Yes")', 'n = int(input())\nw=[input() for _ in range(n)]\nfor i in range(n-1):\n if w[i][-1] != w[i+1][0]:\n ... | ['Runtime Error', 'Accepted'] | ['s486544062', 's416094602'] | [3060.0, 2940.0] | [18.0, 18.0] | [195, 174] |
p03261 | u607865971 | 2,000 | 1,048,576 | 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... | ['N = int(input())\n\nW = []\nfor n in range(N):\n W.append(input())\n\nret = "Yes"\n\ndict = {}\nfor w in W:\n if w in dict:\n dict[w] += 1\n if dict[w] >= 2:\n # print("Duplicated!")\n print("No")\n exit\n else:\n dict[w] = 1\n# print(dict)\n\ncurrent = W... | ['Wrong Answer', 'Accepted'] | ['s407560335', 's726709891'] | [3064.0, 3060.0] | [18.0, 21.0] | [511, 197] |
p03261 | u609814378 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nshiritori = [str(input())]\n\nshiritori.append(w)\n\nans = "Yes"\n\nfor i in shiritori:\n if shiritori.count(i) != 1:\n ans = "No"\n break\n \nfor k in range(N-1):\n first = shiritori[k]\n second = shiritori[k+1]\n if first[-1] != second[0]:\n ans = "No"\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s226648972', 's253639272', 's454079330', 's457666487', 's145477628'] | [3064.0, 3064.0, 3060.0, 3064.0, 3064.0] | [18.0, 17.0, 17.0, 17.0, 18.0] | [324, 324, 318, 337, 342] |
p03261 | u614710626 | 2,000 | 1,048,576 | 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... | ["N = int(input())\nlist = []\nfor n in range(0, N):\n input = input()\n if n == 0:\n list.append(input)\n else:\n if input in list:\n print('No')\n break\n else:\n list.append(input)\n if n == N-1:\n print('Yes')\n", "N = int(input())\nls = []\nflag = True\nfor n in range(0, N):\n char ... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s062482382', 's557620617', 's582120477', 's783253620', 's119701480'] | [2940.0, 3060.0, 3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0, 17.0, 17.0] | [230, 262, 285, 286, 270] |
p03261 | u620846115 | 2,000 | 1,048,576 | 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... | ['n = int(input())\nalist = [input() for i in range(n)]\n \nif len(set(alist))==n:\n if all(alist[i][-1]==alist[i+1][0])for i in range(n-1):\n print("Yes")\n else:\n print("No")', 'n = int(input())\nalist = [input() for i in range(n)]\n\nfor i in range(n):\n if all(alist[i][-1]==alist[i+1][0]):\n if len(set... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s284802039', 's650368362', 's878229023', 's974708819'] | [8932.0, 9184.0, 9116.0, 9176.0] | [24.0, 23.0, 27.0, 29.0] | [176, 185, 177, 176] |
p03261 | u620945921 | 2,000 | 1,048,576 | 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... | ["def is_unique(seq):\n return len(seq) == len(set(seq))\n\nn=int(input())\nw=[input() for i in range(n)]\n\nflag=0\n\nif is_unique(w)=='false':\n flag=1\n\nfor j in range(n-1):\n if w[j][-1] != w[j+1][0]:\n flag=1\n\nif flag==1:\n print('No')\nelse:\n print('Yes')\n", "def is_unique(seq):\n return len(seq... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s005297685', 's151796433', 's153732995', 's344630018', 's586762327', 's694569919', 's836061156'] | [3060.0, 3060.0, 3060.0, 3064.0, 3060.0, 3060.0, 3060.0] | [18.0, 18.0, 18.0, 17.0, 18.0, 17.0, 19.0] | [256, 274, 273, 274, 255, 276, 231] |
p03261 | u623349537 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nword_set = set()\nvalid = True\nwords = ["" for i in range(N)]\nfor i in range(N):\n words[i] = input()\n \nfor i in range(1, N):\n if words[i-1][-1] != words[i][0] or words[i] in word_set:\n valid = False\n break\n word_set.add(words[i])\n \nif valid:\n print("Yes")\... | ['Wrong Answer', 'Accepted'] | ['s219697286', 's790845937'] | [3064.0, 3064.0] | [18.0, 17.0] | [325, 344] |
p03261 | u623687794 | 2,000 | 1,048,576 | 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... | ['n = int(input())\nshiritori = [list(input()) for i in range(n)]\nfor i in range(n-1):\n if shiritori[i][-1] != shiritori[i+1][0]:\n print("No")\n break\n if i =n-2:\n print("Yes")', 'n = int(input())\nshiritori = [list(input()) for i in range(n)]\nfor i in range(n-1):\n if shiritori[i][-1] != shiritori[i+... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s418544800', 's935038003', 's207924581'] | [2940.0, 2940.0, 3064.0] | [17.0, 18.0, 17.0] | [183, 184, 289] |
p03261 | u626228246 | 2,000 | 1,048,576 | 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... | ['import sys\nN = int(input())\nS = [input() for s in range(N)]\ns = set(S)\nif len(S) != len(s):\n print("No")\nfor i in range(N-1):\n if S[i][-1] != S[i+1][0]:\n print("No")\n sys.exit()\nprint("Yes")\n \n\n ', 'import sys\nN = int(input())\nS = [input() for s in range(N)]\ns = set(S)\nif len(S) != len(s):\... | ['Wrong Answer', 'Accepted'] | ['s132342667', 's951485931'] | [8940.0, 9076.0] | [27.0, 25.0] | [205, 204] |
p03261 | u627530854 | 2,000 | 1,048,576 | 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... | ['def valid(words):\n used = set()\n last = ""\n\n for w in words:\n if w in used:\n return False\n if last != "" and last[-1] != w[0]:\n return False\n last = w\n used.append(w)\n return True\n\nn = int(input())\nwords = [input() for _ in range(n)]\nprint("Yes" if valid(words) else "No")', 'd... | ['Runtime Error', 'Accepted'] | ['s891863786', 's970087885'] | [3060.0, 3060.0] | [18.0, 17.0] | [298, 298] |
p03261 | u629350026 | 2,000 | 1,048,576 | 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... | ['n=int(input())\ntemp=str(input())\ntempl=list(temp)\ntempb=templ[len(templ)-1]\nw=[0]*n\nw[0]=temp\nfor i in range(0,n-1):\n temp=str(input())\n templ=list(temp)\n if temp in w or tempb!=templ[0]:\n print("No")\n break\n tempb=templ[len(templ)-1]\n w[i]=temp\nelse:\n print("Yes")\n ', 'n=int(input())\nte... | ['Wrong Answer', 'Accepted'] | ['s493749708', 's534007469'] | [3064.0, 3064.0] | [18.0, 18.0] | [280, 282] |
p03261 | u629540524 | 2,000 | 1,048,576 | 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... | ["n = int(input())\nw = [input() for i in range(n)]\nif n == len(set(w)) and w[i-1][-1] == w[i][0] for i in range(1,n):\n print('Yes')\nelse:\n print('No')", "n = int(input())\nw = [input() for i in range(n)]\nif all(n == len(set(w)) and w[i-1][-1] == w[i][0] for i in range(1,n)):\n print('Yes')\nelse:\n ... | ['Runtime Error', 'Accepted'] | ['s078494929', 's947090016'] | [2940.0, 3060.0] | [17.0, 17.0] | [154, 165] |
p03261 | u630657312 | 2,000 | 1,048,576 | 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... | ["n = int(input())\n*w,=open(0).read().split()\nfor i in range(1,n):\n if w.count(w[i]) == 1 and w[i-1][-1] == w[i][0]:\n pass\n else:\n print('No')\n break\n if i == n-1:\n print('Yes')\n else:\n pass", "n = int(input())\n*w, = open(0).read().split()\nfor i in range(1,n):\n if w.count(w[i]) > 1 or ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s574588542', 's690681965', 's979857299', 's977757559'] | [2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [207, 167, 189, 253] |
p03261 | u635974378 | 2,000 | 1,048,576 | 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... | ["already = {}\nn = int(input())\nlast = ''\nfor i in range(n):\n s = input()\n if i != 0 and s[0] != last[-1]:\n print('No')\n break\n last = s\nelse:\n print('Yes')", "already = {}\nn = int(input())\nlast = ''\nfor i in range(n):\n s = input()\n if (i != 0 and s[0] != last[-1]) or (s in already) :\n pr... | ['Wrong Answer', 'Accepted'] | ['s180080168', 's409911362'] | [3060.0, 3060.0] | [18.0, 17.0] | [164, 202] |
p03261 | u636775911 | 2,000 | 1,048,576 | 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... | ['#coding;utf-8\nn=int(input())\ndata=[]\ncheck=True\ndata.append(input())\nfor i in range(1,n-1):\n data.append(input())\n for j in range(1,i):\n if(data[i]==data[j]):\n check=False\n if(data[i-1][len(data[i-1])-1]!=data[i][0]):\n check=False\nif(check==False):\n print("No")\nelse:\n print("Yes")', '#c... | ['Wrong Answer', 'Accepted'] | ['s833457600', 's333046798'] | [3064.0, 3060.0] | [18.0, 18.0] | [297, 294] |
p03261 | u640922335 | 2,000 | 1,048,576 | 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... | ["N=int(input())\nA=[]\nfor _ in range(N):\n W=input()\n if W in A:\n print('No')\n exit()\n else:\n W.append(A)\n\nfor i in range(N-1):\n if A[i][-1]!=A[i+1][-1]:\n print('No')\n exit()\nprint('Yes')", "N=int(input())\nA=[]\nfor _ in range(N):\n W=input()\n if W in ... | ['Runtime Error', 'Accepted'] | ['s164365475', 's446538776'] | [3060.0, 3060.0] | [17.0, 17.0] | [231, 230] |
p03261 | u642528832 | 2,000 | 1,048,576 | 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... | ["N = int(input())\nW = [input() for _ in range(N)]\nWs =[]\nans = 'Yes'\n\nfor i in range(N):\n Ws.append(W[i])\n for j in range(1,N+1)\n if W[i][-1] == W[j][0]:\n break\n else:\n ans = 'No'\n break\n \n\n\nif len(set(W)) != len(Ws):\n ans = 'No'\nprint(an... | ['Runtime Error', 'Accepted'] | ['s848388087', 's669914258'] | [8964.0, 9172.0] | [24.0, 27.0] | [314, 167] |
p03261 | u650909164 | 2,000 | 1,048,576 | 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... | ['x = int(input())\n\nANS = "Yes"\ns = []\ndef se(s):\n\treturn \nfor i in range(x):\n\ts.append(input())\n\nprint(s)\nfor i in range(x-1):\n\tif s[i+1][0] != s[i][-1]:\n\t\tprint(s[i][-1],s[i][0],s[i+1][-1])\n\t\tANS = "No"\n\t\tbreak\nif len(s) == len(set(s)):\n\tprint(ANS)\nelse:\n\tprint("No")', 'x = int(input())\n... | ['Wrong Answer', 'Accepted'] | ['s650319976', 's854938553'] | [3064.0, 3060.0] | [18.0, 17.0] | [267, 200] |
p03261 | u655048024 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nw = []\nans = "Yes"\nfor i in range(N):\n s = str(input())\n if(i>0):\n if(s[0]==w[-1][-1]):\n None\n else:\n ans = "No"\n break\n w.append(s)\nj = set(N)\nl = len(list(j))\nif(len(N)==l):\n None\nelse:\n ans="No"\nprint(ans)', 'N = int(input())\nw = []\nans = "Yes"\nfor i ... | ['Runtime Error', 'Accepted'] | ['s158892108', 's076430473'] | [3064.0, 3060.0] | [18.0, 17.0] | [251, 247] |
p03261 | u657611449 | 2,000 | 1,048,576 | 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... | ["N = int(input())\nw = []\nfor i in range(N):\n w.append(input())\n if i ==0:\n continue\n if w[i][0] != w[i-1][-1]:\n print('No')\n return\n\nif N == len(set(w)):\n print('Yes')\nelse:\n ", "N = int(input())\nw = []\nfor i in range(N):\n w.append(input())\n if i ==0:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s538051485', 's716557477', 's860012757'] | [2940.0, 2940.0, 2940.0] | [18.0, 18.0, 18.0] | [211, 223, 294] |
p03261 | u657818166 | 2,000 | 1,048,576 | 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... | ['import sys\n\nn=int(input())\nl=[]\nfor x in range(n):\n\tl.append(str(input()))\n\tif x>0:\n\t\tif not(l[x-1][-1] == l[x][0]) or (l[:x] in l):\n\t\t\tprint("No")\n\t\t\tsys.exit()\nprint("Yes")\n', 'import sys\n\nn=int(input())\nl=[]\nfor x in range(n):\n\tl.append(str(input()))\n\tif x>0:\n\t\tif not(l[x-1][-1] == ... | ['Wrong Answer', 'Accepted'] | ['s224819704', 's192064020'] | [2940.0, 2940.0] | [17.0, 17.0] | [175, 178] |
p03261 | u663014688 | 2,000 | 1,048,576 | 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... | ['N = int(input())\n\nl = []\nfor i in range(N):\n l.append(input())\n\n\nif len(set(l)) != n:\n print("No")\n exit()\n\n\nfor i in range(n-1):\n if l[i][-1] != l[i+1][0]:\n print("No")\n exit()\n\nprint("Yes")\n\n\n \n', 'N = int(input())\n\nl = []\nfor i in range(N):\n l.append(input()... | ['Runtime Error', 'Accepted'] | ['s660599812', 's472521116'] | [3060.0, 3060.0] | [17.0, 18.0] | [269, 269] |
p03261 | u663101675 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nW = []\nfor i in range(N):\n X = input()\n W.append(X)\n if i >= 1:\n if W[i-1][len(W[i-1])-1] != W[i][0]:\n print("No1")\n exit()\n for j in range(i):\n if W[i] == W[j]:\n print("No2")\n exit()\nelse:\n print("Yes")\n', 'N = i... | ['Wrong Answer', 'Accepted'] | ['s274330856', 's174120277'] | [3060.0, 3060.0] | [19.0, 18.0] | [294, 292] |
p03261 | u666844906 | 2,000 | 1,048,576 | 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... | ["N = int(input())\nW = list(input() for _ in range(N))\n\ncnt = 0\nfor i in range(N-1):\n\tfirst = W[i]\n\tnext = W[i+1]\n\tif first[-1] == next[0]:\n\t\tcnt += 1\n\telse:\n\t\tcnt = cnt\n\nif cnt == N-1:\n\tprint('Yes')\nelse:\n\tprint('No')\n\t\t", "N = int(input())\nW = list(input() for _ in range(N))\n\ncnt = 0\ni... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s621308109', 's704034344', 's780353702'] | [9184.0, 9164.0, 9128.0] | [33.0, 29.0, 32.0] | [219, 239, 215] |
p03261 | u667084803 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nword = []\nflag = 1\nfor i in range(N):\n st = input()\n if i > 0 :\n if final != st[0]:\n flag = 0\n elif st in word:\n flag = 0\n else:\n final = st[-1]\n word += [st]\nif flag:\n print("Yes")\nelse :\n print("No")', 'N = int(input())\nword = []\nflag = 1\nfor i in... | ['Runtime Error', 'Accepted'] | ['s108917517', 's894699488'] | [3060.0, 3064.0] | [17.0, 18.0] | [251, 295] |
p03261 | u668503853 | 2,000 | 1,048,576 | 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... | ['n=int(input())\nw=[input() for i in range(n)]\na=0\nfor i in range(1,n):\n if w[i-1][-1] == w[i][0]:\n if w[i] not in w[:i]:\n a=a\n else:\n a+=1\nif a==0:print("Yes")\nelse:print("No")', 'n=int(input())\nw=[input() for i in range(n)]\na=0\nfor i in range(1,n): \n if w[i-1][-1] == w[i][0]:\n if w[i]... | ['Wrong Answer', 'Accepted'] | ['s417277576', 's366810861'] | [3060.0, 3064.0] | [18.0, 18.0] | [188, 211] |
p03261 | u669770658 | 2,000 | 1,048,576 | 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... | ["# -*- coding: utf-8 -*-\nimport collections\n\n\nN = int(input())\n\ni = 0\nW = []\nwhile i < N:\n W.append(str(input()))\n i += 1\n\nfor i in range(len(W)):\n if W[i][0] != W[i+1][-1]:\n print('No')\n break\n\nc = collections.Counter(W)\n\nif c.values() in range(2, N+1):\n print('No')\n\nel... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s609223038', 's906338752', 's483635255'] | [3316.0, 3316.0, 3064.0] | [21.0, 21.0, 19.0] | [316, 316, 608] |
p03261 | u674588203 | 2,000 | 1,048,576 | 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... | ['N=int(input())\nWs=[]\nfor n in range(N):\n W=input()\n Ws.append(W)\n\nfor w in range(len(Ws)):\n if Ws.count(w)>1:\n print(\'No\')\n exit()\n\nfor x in range (1,N):\n if Ws[x][0] != Ws[x-1][-1]:\n print("No")\n exit()\nprint("Yes")\n', 'N=int(input())\nWs=[]\nfor n in range(N... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s087570887', 's153755572', 's246475865', 's645764803', 's553994437'] | [3060.0, 3060.0, 2940.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0, 18.0, 17.0] | [257, 260, 258, 263, 276] |
p03261 | u677705680 | 2,000 | 1,048,576 | 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... | ['N = int(input())\n\nW = [input() for n in range(N)]\n\nap = []\nflag = "No"\na = 0\nfor n in range(N - 1):\n \n if W[n + 1][0] == W[n][-1] and W[n] not in ap:\n a = 0\n else:\n flag = "Yes" \n ap.append(W[n])\n\nprint(flag)', 'N = int(input())\n\nW = [input() for n in range(N)]\n\nflag = "Ye... | ['Wrong Answer', 'Accepted'] | ['s569953925', 's882123138'] | [3064.0, 3060.0] | [17.0, 17.0] | [234, 170] |
p03261 | u680851063 | 2,000 | 1,048,576 | 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... | ["n = int(input())\nl = [input() for _ in [0]*n]\nprint(l)\nif len(set(l)) != n:\n print('No')\nelse:\n for i in range(n-1):\n print(i)\n print(list(l[i])[-1])\n print(list(l[i+1])[0])\n if list(l[i])[-1] != list(l[i+1][0]):\n print('No')\n #else:\n #print(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s300721304', 's594535146', 's549026079'] | [3064.0, 3060.0, 3060.0] | [18.0, 18.0, 17.0] | [359, 362, 397] |
p03261 | u681110193 | 2,000 | 1,048,576 | 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... | ["n=int(input())\ns=input()\nlast=s[-1]\n\nfor i in range(n-1):\n s=input()\n if s[0]!=last:\n print(s[0])\n print(last)\n print('No')\n break\n last=s[-1]\n if i==n-2:\n print('Yes')", "n=int(input())\ns=input()\na=[]\nlast=s[-1]\na.append(s)\n\nfor i in range(n-1):\n s=input()\n a.append(s)\n if... | ['Wrong Answer', 'Accepted'] | ['s701937266', 's337561497'] | [3060.0, 3060.0] | [18.0, 18.0] | [187, 246] |
p03261 | u692746605 | 2,000 | 1,048,576 | 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... | ["n=int(input())\ns=set()\nwp=input()\ns.add(wp)\n\nf=True\nfor i in range(n-1):\n wn=input()\n if wp[-1]!=wn[0]:\n f=False\n elif s.issubset(set(wp))==True:\n f=False\n wp=wn\n s.add(wn)\n\nprint('Yes' if f==True else 'No')\n", "n=int(input())\ns=set()\nwp=input()\ns.add(wp)\n\nf=True\nfor i in range(n-1):\... | ['Wrong Answer', 'Accepted'] | ['s335616255', 's855839991'] | [3060.0, 3060.0] | [17.0, 17.0] | [219, 201] |
p03261 | u695079172 | 2,000 | 1,048,576 | 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... | ['def main():\n n = int(input())\n word_lst = [""] * n\n previous_word = input()\n ok = True\n for i in range(1,n):\n now_word = input()\n if not (now_word[0] == previous_word[-1]):\n ok = False\n break\n previous_word = now_word\n\n print("Yes" if ok else "N... | ['Wrong Answer', 'Accepted'] | ['s117799061', 's569552735'] | [3060.0, 3064.0] | [17.0, 18.0] | [354, 554] |
p03261 | u695811449 | 2,000 | 1,048,576 | 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... | ['N=int(input())\n\nW=[input() for i in range(N)]\n\ncheck=1\n\nfor i in range(2,N):\n if W[i-1][-1] != W[i][0]:\n check=0\n\n \n\n\n\n\nW.sort()\n\n\n\nfor i in range(2,N):\n if W[i]==W[i-1]:\n check=0\n print(i)\n\n\n\n\n\n\nif check==1:\n print("Yes")\n\nelse:\n print("No")\n', 'i... | ['Wrong Answer', 'Accepted'] | ['s176987426', 's456788038'] | [3064.0, 3316.0] | [19.0, 21.0] | [279, 271] |
p03261 | u698479721 | 2,000 | 1,048,576 | 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... | ["import sys\nN = int(input())\nk = input()\na = []\nfor i in range(N-1):\n a.append(input())\nlis = []\nfor words in a:\n if words in lis:\n print('No')\n sys.exit()\n elif k[-1] != words[0]:\n print('No')\n sys.exit()\n else:\n lis.append(words)\n k = words\nprint('Yes')", "import sys\nN = int... | ['Wrong Answer', 'Accepted'] | ['s046367734', 's411028571'] | [3064.0, 3064.0] | [17.0, 17.0] | [278, 279] |
p03261 | u702208001 | 2,000 | 1,048,576 | 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... | ["n = int(input())\nz = list(input() for _ in range(n))\nif len(set(z)) == len(z):\n if all([z[i][-1] == z[i+1][0] for i in range(len(z)-1)]):\n print('Yes')\n else:\n print('No')\n", 'n=int(input())\nw=[input() for i in range(n)]\nflag=False\nif n==len(set(w)):\n if all([w[i-1][-1]==w[i][0] for i in range(1... | ['Wrong Answer', 'Accepted'] | ['s403634481', 's291272533'] | [3060.0, 3060.0] | [17.0, 17.0] | [180, 178] |
p03261 | u706695185 | 2,000 | 1,048,576 | 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... | ["n = int(input())\n\nlastch = ''\nanswer = 'Yes'\nwords = []\nfor i in range(n):\n word = list(input())\n words.append(word)\n if lastch != word[0] and i != 0:\n answer = 'No'\n lastch = word[-1]\n\nif len(set(words)) != len(words):\n answer = 'No'\n\nprint(answer)\n", "n = int(input())\n\nlastch... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s390476171', 's727843178', 's939802274', 's801240080'] | [3060.0, 2940.0, 3060.0, 3060.0] | [17.0, 18.0, 18.0, 17.0] | [272, 185, 312, 267] |
p03261 | u711295009 | 2,000 | 1,048,576 | 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... | ['n = int(input())\nindex = 0\nlist1 = []\nlistForWord=[]\nlists = []\nflag =0\nwhile index <n:\n word = input()\n list1.append(list(word))\n if index!= 0:\n length = len(lists[index-1])\n if lists[index-1][length-1] == list1[index][0]:\n if word in listForWord == False:\n ... | ['Wrong Answer', 'Accepted'] | ['s176242521', 's225202812'] | [3064.0, 3064.0] | [18.0, 18.0] | [566, 467] |
p03261 | u711539583 | 2,000 | 1,048,576 | 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... | ["n = int(input())\np = ''\nd = []\nfor _ in range(n):\n w = input()\n if p and p[-1] == w[0]\n print('No')\n exit()\n if w in d:\n print('No')\n exit()\n p = w[-1]\n d[w] = 1\nprint('Yes')\n ", "n = int(input())\np = ''\nd = {}\nfor _ in range(n):\n w = input()\n if p and p[-1] != w[0]:\n print(... | ['Runtime Error', 'Accepted'] | ['s649885136', 's623649317'] | [2940.0, 2940.0] | [18.0, 17.0] | [194, 196] |
p03261 | u712975113 | 2,000 | 1,048,576 | 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... | ["N=int(input())\nW=[]\nfor _ in range(N):\n W.append(input())\nc=1\nfor i in range(N-1):\n if W[i][-1]!=W[i+1][0]:\n c=0\n break\nif c:\n print('Yes')\nelse:\n print('No')", "N=int(input())\nW=[]\nfor _ in range(N):\n W.append(input())\nc=1\nfor i in W:\n d=W.count(i)\n if d... | ['Wrong Answer', 'Accepted'] | ['s223575076', 's532251765'] | [3060.0, 3064.0] | [17.0, 17.0] | [193, 260] |
p03261 | u721316601 | 2,000 | 1,048,576 | 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... | ["\nn = int(input())\nw = []\n\nfor i in range(n):\n s = input()\n if s in w:\n flag = 0\n break\n else:\n w.append(s)\n\nfor i in range(1, n-1):\n if w[i][-1] != w[i+1][0]:\n flag = 0\n break\n\nif flag == 0:\n print('No')\nelse:\n print('Yes')", "N = int(input())\n... | ['Runtime Error', 'Accepted'] | ['s560267120', 's759175978'] | [3060.0, 3060.0] | [17.0, 18.0] | [276, 294] |
p03261 | u721776301 | 2,000 | 1,048,576 | 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... | ['num_word = int(input())\nword_list=[]\nword_list = [str(input()) for i in range(num_word)]\n \nword_list_temp=[]\nfor j in range(len(word_list)):\n if j == len(word_list)-1:\n print ("Yes")\n break\n else:\n old_word=word_list[j]\n old_word_sep=list(old_word)\n word_list_temp.append(old_word)\n ne... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s148937646', 's287616449', 's220962983'] | [3064.0, 3064.0, 3064.0] | [18.0, 17.0, 18.0] | [364, 563, 550] |
p03261 | u727787724 | 2,000 | 1,048,576 | 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... | ['import fractions\nn,x=map(int,input().split())\na=list(map(int,input().split()))\nans=abs(x-a[0])\ncnt=abs(a[1]-a[0])\nfor j in range(n-1):\n cnt=min(abs(a[j+1]-a[j]),cnt)\nfor i in range(n):\n ans=min(abs(x-a[i]),ans)\nprint(min(ans,cnt))\n ', "n=int(input())\nw=[]\nans='Yes'\nfor i in range(n):\n w.appe... | ['Runtime Error', 'Accepted'] | ['s755350576', 's953710777'] | [5048.0, 3060.0] | [35.0, 18.0] | [241, 285] |
p03261 | u729119068 | 2,000 | 1,048,576 | 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... | ["N=int(input())\nA=list(input()for i in range(N))\nif len(A)==len(set(A)):\n if all(A[i][-1]==A[i+1][0]) for i in range(N-1):\n print('Yes')\n else:print('No')\nelse:print('No')", "N=int(input())\nA=list(input()for i in range(N))\nif len(A)==len(set(A)):\n if all(A[i][-1]==A[i+1][0]) for i in range(N-2... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s249853091', 's561325677', 's874641222', 's161321124'] | [8864.0, 9008.0, 8900.0, 8868.0] | [25.0, 25.0, 23.0, 30.0] | [183, 183, 182, 183] |
p03261 | u736729525 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nwords = [input().strip() for _ in range(N)]\n\ndef solve(words):\n s = set(words[0])\n for p, w in zip(words, words[1:]):\n if p[-1] != w[0]:\n return "No"\n if w in s:\n return "No"\n s.add(w)\n return "Yes"\n\nprint(solve(words))', 'N = int(input()) ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s606733811', 's666948003', 's893517058'] | [3060.0, 2940.0, 3060.0] | [17.0, 19.0, 17.0] | [258, 418, 255] |
p03261 | u747873993 | 2,000 | 1,048,576 | 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... | ['N=int(i)\nW=[int(input()) for i in range(N)]\nfor i in range(N-1):\n if W[i:].find(W[i])==True:\n print("No")\n elif W[i][-1]!=W[i+1][0]:\n print("No")\nelse:\n print("Yes")', 'N=int(input())\nW=[input() for i in range(N)]\nfor i in range(N-1):\n if W[i] in W[i+1:]:\n print("No")\n break\n ... | ['Runtime Error', 'Accepted'] | ['s805637297', 's019809428'] | [3060.0, 3064.0] | [17.0, 17.0] | [174, 210] |
p03261 | u748377775 | 2,000 | 1,048,576 | 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... | ['N=int(input())\nanswer=[]\n\nfor i in range(N):\n answer.append(input())\n\nfor j in range(N-1):\n if(answer[j][-1]==answer[j+1][0]):\n if(j==N-2):\n print("Yes")\n else:\n continue\n else:\n print("No")\n break', 'N=int(input())\nanswer=[]\n\nfor i in range(... | ['Wrong Answer', 'Accepted'] | ['s245374145', 's738333305'] | [3060.0, 3060.0] | [20.0, 18.0] | [256, 353] |
p03261 | u759412327 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nW = list(input() for i in range(N))\nf = True\n\nfor i in range(N-1):\n if W[i][-1]!=W[i+1][0]:\n f = False\n \nif N!=len(set(W)) and f:\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nW = [input() for n in range(N)]\na = "Yes"\n\nfor n in range(N-1):\n if W[n][-1]!=W[n+1][0] or W... | ['Wrong Answer', 'Accepted'] | ['s827152083', 's882710890'] | [3060.0, 9172.0] | [18.0, 33.0] | [188, 149] |
p03261 | u760794812 | 2,000 | 1,048,576 | 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... | ["N = int(input()) \nt = [input() for i in range(N)] \n\ndef is_unique(seq):\n return len(seq) == len(set(seq))\n\nif is_unique(t) == False:\n print('No')\n\ncount = 0 \n\nwhile count < N-1:\n if t[count][-1] != t[count+1][0]:\n print('No')\n break\n else:\n count += 1\nprint('Yes')\n", "N = in... | ['Wrong Answer', 'Accepted'] | ['s298778091', 's962713256'] | [3060.0, 3064.0] | [17.0, 17.0] | [290, 339] |
p03261 | u763115743 | 2,000 | 1,048,576 | 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... | ['def solve(words):\n word = words[0]\n uniq_words = {word: True}\n print(words)\n\n ans = "Yes"\n for key in range(1, len(words)):\n next_word = words[key]\n if next_word in uniq_words:\n ans = "No"\n break\n uniq_words[next_word] = True\n if word[-1] !=... | ['Wrong Answer', 'Accepted'] | ['s947236943', 's881027547'] | [3064.0, 3064.0] | [17.0, 18.0] | [551, 587] |
p03261 | u764956288 | 2,000 | 1,048,576 | 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... | ["N = int(input())\nwords = [input() for _ in range(N)]\n\nans = 'Yes'\nif len(words) != len(set(words)):\n ans = 'No1'\nelse:\n next_words = words[1:]+['']\n for s1,s2 in zip(words,next_words):\n if s2 and s1[-1] != s2[0]:\n ans = 'No2'\n break\n\nprint(ans)", "N = int(input())\nw... | ['Wrong Answer', 'Accepted'] | ['s514691261', 's849633467'] | [3060.0, 3064.0] | [17.0, 18.0] | [282, 280] |
p03261 | u770009793 | 2,000 | 1,048,576 | 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... | ['N = int(input())\nl = list()\nal = list()\nbl = list()\n\nfor n in N:\n a = input()\n\u3000 l.append(a)\n al.append(a[:1])\n bl.append(a[-1:])\n\nl_unq = list(set(l))\nif len(l) == len(l_unq):\n for i in N-1:\n if al[i+1] != bl[i]:\n print("No")\n break\n print("Yes")\nelse:\n... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s138442759', 's718999842', 's833561629', 's940464730'] | [2940.0, 3192.0, 2940.0, 3060.0] | [17.0, 18.0, 17.0, 17.0] | [311, 331, 330, 292] |
p03261 | u771167374 | 2,000 | 1,048,576 | 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... | ["n = int(input())\nlist = [input() for _ in range(n)]\na = 'Yes'\nif len(set(list))!=n:\n ans = 'No'\nfor i in range(n-1):\n if list[i][-1]!=list[i+1][0]:\n a = 'No'\nprint(a)", "n = int(input())\nlist = [input() for _ in range(n)]\na = 'Yes'\nif len(set(list))!=n:\n a = 'No'\nfor i in range(n-1):\n ... | ['Wrong Answer', 'Accepted'] | ['s780170200', 's888139041'] | [3060.0, 3060.0] | [17.0, 17.0] | [179, 177] |
p03261 | u771532493 | 2,000 | 1,048,576 | 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... | ["N=int(input())\nL=[]\na=True\nfor i in range(n):\n L.append(input())\nif len(L)!=len(set(L)):\n print('No')\nelse:\n for i in range(1,len(L)):\n if L[i][0]==L[i-1][-1]:\n continue\n else:\n a=False\n if a is True:\n print('Yes')\n else:\n print('No')\n\n", "n=int(input())\nL=[]\na=True\nfor... | ['Runtime Error', 'Accepted'] | ['s192414253', 's444485239'] | [3060.0, 3064.0] | [18.0, 19.0] | [263, 261] |
p03261 | u773686010 | 2,000 | 1,048,576 | 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... | ['\nimport collections\nN = int(input())\nWord_List = []\nSP = ""\nfor i in range(N):\n CW = str(input())\n if i == 0:\n Word_List.append(CW)\n SP = CW[-1]\n elif SP != CW[0]:\n break\n else:\n Word_List.append(CW)\n SP = CW[-1]\nelse:\n Word_List = collections.Counter(... | ['Runtime Error', 'Accepted'] | ['s700017120', 's585040139'] | [8988.0, 9388.0] | [24.0, 31.0] | [442, 461] |
p03261 | u774539708 | 2,000 | 1,048,576 | 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... | ['import sys\nn=int(input())\nnow=input()\nfor i in range(n-1):\n w=input()\n if now[-1]!=w[0]:\n print("No")\n sys.exit()\n now=w\nprint("Yes")', 'import sys\nn=int(input())\nnow=input()\nD=[now]\nfor i in range(n-1):\n w=input()\n if now[-1]!=w[0] or w in D:\n print("No")\n ... | ['Wrong Answer', 'Accepted'] | ['s801987170', 's443708523'] | [3060.0, 3064.0] | [17.0, 19.0] | [156, 191] |
p03261 | u776190305 | 2,000 | 1,048,576 | 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... | [' n = int(input())\n \n last = None\n seen = set()\n for _ in range(n):\n w = input()\n if w in seen or (last and last[-1] != w[0]):\n print("No")\n break\n seen.add(w)\n else:\n print("Yes")', 'n = int(input())\n\nlast = None\nseen = set()\nfor _ in range(n):\n w ... | ['Runtime Error', 'Accepted'] | ['s771621244', 's335551081'] | [2940.0, 3060.0] | [17.0, 19.0] | [232, 195] |
p03261 | u777028980 | 2,000 | 1,048,576 | 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... | ['n=int(input())\nhoge=[]\nno=0\n\na=input()\nhoge.append(a)\nsaigo=a[-1]\n\nfor i in range(n-1):\n a=input()\n hoge.append(a)\n if(hoge.count(a)>1):\n no=1\n break\n if(saigo==a[-1]):\n no=1\n break\n saigo=a[-1]\n \nif(no==0):\n print("YES")\nelse:\n print("NO")', 'n=int(input())\nhoge=[]\nno=0\n\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s318707511', 's562846917', 's155132390'] | [3064.0, 3064.0, 3064.0] | [18.0, 17.0, 18.0] | [260, 269, 269] |
p03261 | u778814286 | 2,000 | 1,048,576 | 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... | ["n = int(input())\nw = []\n\nw.append(input())\n\nans = 'Yes'\nfor i in range(1,n,1):\n w.append(input())\n l = len(w[j])\n if w[i][0:1] != w[j][l-1:l]: ans = 'No'\n for j in range(i):\n if w[i] == w[j]: ans = 'No'\n\nprint(ans)", "n = int(input())\nw = []\n\nw.append(input())\n\nans = 'Yes'\nfor i in range(1... | ['Runtime Error', 'Accepted'] | ['s561580954', 's955803320'] | [3064.0, 3060.0] | [18.0, 18.0] | [222, 259] |
p03261 | u782685137 | 2,000 | 1,048,576 | 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... | ["N=int(input())\nb=input()\nd={b}\nf=1\nfor _ in [0]*~-N:s=input();f=b[-1]==s[0]and s not in d;b=s;d|={s}\nprint('Yes'if f else'No', d)", "N=int(input())\nb=input()\nd={b}\nf=1\nfor _ in [0]*~-N:s=input();f=b[-1]==s[0]and s not in d;b=s;d|={s}\nprint('Yes'if f else'No')", "N=int(input())\nb=input()\nd={b}\nf=1\nfor _ ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s199140955', 's571700245', 's119152049'] | [3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0] | [129, 126, 139] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.