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 | u097708290 | 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... | ['loop=int(input())\nword=input()\nword_list=list()\nword_list.append(word)\n\nfor i in range(loop-1):\n word=input()\n for j in range(len(word_list)):\n print(word_list[j],word)\n if word_list[j]==word:\n print("No")\n break\n if word_list[i][-1]!=word[0]:\n print("No")\n break\n if j!=len(wo... | ['Wrong Answer', 'Accepted'] | ['s555251401', 's515678539'] | [3188.0, 3064.0] | [22.0, 18.0] | [383, 354] |
p03261 | u102242691 | 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 = []\na = []\nstatus = True\n\nfor _ in range(n):\n w.append(input())\n\na.append(w[0])\n\nfor i in range(1,n):\n a.append(w[i])\n if a.count(w[i]) == 1 and (a[i-1])[-1] == (a[i])[0]:\n pass\n else:\n status == False\n print(status)\n break\n\nif status:\n... | ['Wrong Answer', 'Accepted'] | ['s102607361', 's351425655'] | [3064.0, 3064.0] | [17.0, 17.0] | [336, 275] |
p03261 | u113255362 | 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... | ['Row = int(input())\nflag = True\nList = []\nfor i in range (Row):\n List.append(int(input()))\ns_l = set(List)\nif len(List) != len(s_l):\n print("No")\nfor i in range(Row-1):\n n = len(List[i])-1\n if List[i][n] != List[i+1][0]:\n flag = False\nif flag:\n print("Yes")\nelse:\n print("No")', 'Row = int(input... | ['Runtime Error', 'Accepted'] | ['s680981759', 's362093478'] | [9136.0, 9152.0] | [21.0, 25.0] | [284, 301] |
p03261 | u114920558 | 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()\ncnt = 0\nA.append(input())\nfor i in range(N-1):\n x = input()\n if x in A:\n cnt = 1\n elif A[i][-1:] != x[0]:\n cnt = 1\n else:\n A.append(x)\nprint('Yes' if cnt == 0 else 'No')", "N = int(input())\nA = list()\ncnt = 0\nA.append(input())\nfor i in range(N-1):\n x = input(... | ['Runtime Error', 'Accepted'] | ['s014341647', 's135685596'] | [3060.0, 3060.0] | [19.0, 17.0] | [210, 200] |
p03261 | u116328320 | 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... | ["input_lines = int(input())\nlastchar = ''\nfor i in range(input_lines):\n s = input().rstrip()\n if len(lastchar) > 0 and not s[0] in lastchar:\n print('No')\n break\n lastchar = s[-1]\nelse:\n print('Yes')\n ", "input_lines = int(input())\ntango=[]\nlastchar = ''\nfor i in range(input_li... | ['Wrong Answer', 'Accepted'] | ['s899674058', 's102134889'] | [2940.0, 3060.0] | [18.0, 20.0] | [228, 267] |
p03261 | u117545210 | 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\nlist=[]\nfor i in range(n):\n list.append(input())\n \nimport collections\nc=collections.Counter(list)\nt=0\nfor i in range(n-1):\n\n if list[i][len(list[i])-1]==list[i+1][0]:\n \n t += 1\n else:\n pass\n\nprint(t)\n\nif t == n-1 and len(c) == n:\n print("Yes")\nelse:\n print("No")',... | ['Wrong Answer', 'Accepted'] | ['s021613743', 's653926066'] | [3316.0, 3436.0] | [20.0, 26.0] | [294, 284] |
p03261 | u118211443 | 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())\nvo=[]\nflag=1\nfor i in range(N):\n vo.append(input())\n \nif len(vo) != len(set(vo)):\n flag=0\n \nfor i in range(N-1):\n a=vo[i]\n b=vo[i+1]\n #print(a[len(a)-1],b[0]) \n if a[len(a)-1] != b[0]:\n flag=0 \nif flag == 0:\n print("NO")\nelse:\n print("YES")', ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s028710131', 's932305777', 's692467272'] | [3064.0, 3064.0, 3064.0] | [18.0, 19.0, 18.0] | [297, 270, 282] |
p03261 | u118642796 | 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 = []\nW.append(input())\nfor _ in range(N-1):\n W.append(input())\n if W[-1] in W[:-2]\n print("No")\n break\n if W[-1][0] != W[-2][-1]:\n print("No")\n break\nelse:\n print("Yes")', 'N = int(input())\nW = []\nW.append(input())\nfor _ in range(N-1):\n W.a... | ['Runtime Error', 'Accepted'] | ['s004589464', 's699161035'] | [2940.0, 3060.0] | [17.0, 17.0] | [228, 194] |
p03261 | u123872895 | 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 = []\nfor i in range(n):\n words.append(input())\n\nans = "Yes"\n \n\nif len(words) != len(set(words)):\n ans = "No"\nelse:\n for i in range(n-1):\n if words[i][-1] != words[i+1][0]:\n ans = "No"\n break\n print(ans)', 'n = int(input())\nl = [input()]\n\nflag = True\n\nfor i ... | ['Wrong Answer', 'Accepted'] | ['s642027661', 's250068595'] | [3060.0, 9040.0] | [17.0, 25.0] | [243, 236] |
p03261 | u124592621 | 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\ncorrect = True\nend = w[0][-1]\nfor i in range(1, len(w)):\n word = w[i]\n if word in w[i + 1:]:\n correct = False\n break\n start = word[0]\n if start != end:\n correct = False\n break\n end = word[-1]\n\nif correct:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s019582208', 's481251868', 's825302109'] | [3060.0, 3060.0, 3064.0] | [17.0, 18.0, 17.0] | [337, 288, 285] |
p03261 | u130900604 | 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)];print(s)\nif (len(s) == len(set(s))) == 0:\n print("No")\n exit()\nfor c,d in zip(s[1:],s[0:]):\n if c[-1] == d[0]:\n pass\n else:\n print("No")\n exit()\nprint("Yes")', 'n=int(input())\ns=[input() for i in range(n)]\nif len(s) != len(set(s)):\n print("No");... | ['Wrong Answer', 'Accepted'] | ['s937554705', 's775028816'] | [3064.0, 3060.0] | [17.0, 17.0] | [215, 176] |
p03261 | u131406572 | 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() for i in range(n)]\ns=0\nfor i in raneg(n-1):\n if a[i][-1]!=a[i+1][0]:\n s+=1\na.sort()\nfor i in raneg(n-1):\n if a[i]==a[i+1]:\n s+=1\nif s==0:\n print("Yes")\nelse:\n print("No")', 'n=int(input())\na=[input() for i in range(n)]\ns=0\nfor i in range(n-1):\n i... | ['Runtime Error', 'Accepted'] | ['s066190601', 's519924366'] | [3064.0, 3064.0] | [18.0, 18.0] | [222, 222] |
p03261 | u131464432 | 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()\nW_list = [w]\nfor i in range(N-1):\n W = input()\n if w[-1] == W[0] and W not in W.list:\n W_list.append(w)\n w = W\n else:\n print("No")\n exit()\nprint("Yes")', 'N = int(input())\nw = input()\nW_list = [w]\nfor i in range(N-1):\n W = input()\n if w[-1] == W[0] and W n... | ['Runtime Error', 'Accepted'] | ['s878673786', 's423387034'] | [9120.0, 9108.0] | [27.0, 26.0] | [195, 195] |
p03261 | u132583371 | 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 = []\nfor i in range(n):\n w = input()\n l.append(w)\nfor k in range(n):\n if l[k-1][-1] == l[k][0]:\n for j in range(i):\n if l[k] == l[j]:\n flag = 0\n break\n else:\n flag = 1\n else:\n flag = 0\nif(fl... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s084582263', 's570156371', 's933376475'] | [9196.0, 9124.0, 8976.0] | [31.0, 31.0, 25.0] | [351, 289, 316] |
p03261 | u138486156 | 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() for i in range(n)]\nfor i in range(n-1):\n if a[i][-1] == a[i+1][0]:\n continue\n else:\n print('No')\n exit()\nprint('Yes')\n ", "n = int(input())\na = [input() for i in range(n)]\nfor i in range(n):\n num = a.count(a[i])\n if num > 1:\n print('No')\n ... | ['Wrong Answer', 'Accepted'] | ['s007204825', 's013131080'] | [2940.0, 3060.0] | [17.0, 18.0] | [163, 270] |
p03261 | u141642872 | 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)]\nL = []\nans = "Yes"\nfor i in range(1,N):\n if W[i] in L:\n ans = "No"\n if W[i][0] != W[i-1][-1]:\n ans = "No"\n L.append(W[i])\nprint(ans)\n', 'N = int(input())\nW = [input() for i in range(N)]\nS = set([W[0]])\nans = "Yes"\nfor i in range(1,N):\n if W[i]... | ['Wrong Answer', 'Accepted'] | ['s649349476', 's525696038'] | [3064.0, 3060.0] | [17.0, 17.0] | [191, 197] |
p03261 | u159335277 | 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\nwords = {}\nw = ''\nok = True\nfor i in range(n):\n nw = input()\n if nw in words:\n ok = False\n break\n words.add(w)\n if w && w[-1] != nw[0]:\n ok = False\n w = nw\n\nif ok:\n print('Yes')\nelse:\n print('No')\n", "n = int(input())\n\nwords = {}\nw = ''\nok = True\nfor i in rang... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s016666975', 's328070908', 's533612412', 's940164237'] | [2940.0, 2940.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [231, 230, 232, 234] |
p03261 | u166696759 | 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() for i in range(n)]\nb = []\nb.append(a[0])\nres = True\nfor i in range(1,n):\n if a[i-1][-1] != a[i][0]:\n res = False\n break\n if a[i] in b:\n res = False\n break\n b.append(a[i])\n\nif res:\n print('Yes')\nelse:\n print('NO')", "n = int(inpu... | ['Wrong Answer', 'Accepted'] | ['s384178820', 's275737192'] | [3064.0, 3064.0] | [22.0, 17.0] | [285, 285] |
p03261 | u167523937 | 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)]\nrule = 'No'\nfor x in range(1, N):\n if w[x-1][len(w[x-1])-1] == w[x][0]:\n rule = 'Yes'\n for y in range(x):\n if w[y]==w[x]:\n rule='No'\n break\nprint(rule)", "N=int(input())\nw=[input() for i in range(N)]\nrule = 'Yes'\nsame ... | ['Wrong Answer', 'Accepted'] | ['s773833795', 's362727812'] | [3064.0, 3064.0] | [19.0, 19.0] | [238, 346] |
p03261 | u169138653 | 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 range(n)]\nd={}\nfor i in range(n):\n if w[i] not in d:\n d[w[i]]=1\n else:\n print('No')\n exit()\nfor i in range(n-1):\n if w[i][len(w[i])-1]!=w[i+1][0]:\n print('No')\n exit()\nprint('Yes')", "n=int(input())\nw=[input() for i in range(n)]\nd={}\nfor i in range(n):... | ['Runtime Error', 'Accepted'] | ['s524841869', 's641488494'] | [2940.0, 3060.0] | [17.0, 17.0] | [230, 234] |
p03261 | u175034939 | 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())\naa = []\nfor i in range(n):\n a = input()\n aa.append(a)\nprint(aa)\n\nbb = []\nif len(set(aa)) != len(aa):\n print('No')\nelse:\n for i in range(n-1):\n if aa[i][-1] == aa[i+1][0]:\n bb.append(True)\n else:\n bb.append(False)\n if all(bb):\n ... | ['Wrong Answer', 'Accepted'] | ['s322498341', 's576129409'] | [3064.0, 3064.0] | [18.0, 17.0] | [344, 334] |
p03261 | u180656055 | 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())\nli=[]\nfor i in range(0,n):\n n=input()\n li.append(n)\nflag=0\nchck=1\ntemp=li[0]\nfor j in li:\n t=li.count(j)\n if(t>1):\n flag=1\n break\n if(chck!=1):\n p=len(temp)\n ch=temp[p-1]\n \n ch1=j[0]\n if(ch==ch1):\n flag=0\n ... | ['Wrong Answer', 'Accepted'] | ['s920205285', 's545678748'] | [3064.0, 3064.0] | [18.0, 17.0] | [432, 432] |
p03261 | u183840468 | 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 range(n)]\n\nif len(l) != len(set(l)):\n print('No')\n\nflg = True\nfor i in range(len(l)-1):\n if l[i][-1] != l[i+1][0]:\n print('No')\n flg = False\n break\n\nif flg:\n print('Yes')\n", "n = int(input())\nl = [input() for _ in range(n)]\n\nflg = ... | ['Wrong Answer', 'Accepted'] | ['s850391203', 's144427654'] | [3060.0, 2940.0] | [19.0, 17.0] | [240, 226] |
p03261 | u185037583 | 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=[int(x) for x in input().split()]\nans='Yes'\nfor i in range(1,n):\n if w[i-1][-1]!=w[i][0]:\n ans='No'\n break\n for j in range(i):\n if w[i]==w[j]:\n ans='No'\n break\nprint(ans)\n", "n=int(input())\nw=[input() for _ in range(n)]\nans='Yes'\nfor i in range(1,n):\n if w[i-1][-... | ['Runtime Error', 'Accepted'] | ['s585118387', 's739808619'] | [3060.0, 3060.0] | [18.0, 18.0] | [209, 203] |
p03261 | u186838327 | 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 = [str(input())]\nfor i in range(1, N):\n x = str(input())\n if x[0] != s[i-1][-1]:\n print('No')\n break\n s.append(x)\nif len(set(s)) == len(s):\n print('Yes')\nelse:\n print('No')", "n = int(input())\ns = set()\nfor i in range(n):\n w = str(input())\n if i == 0:\n... | ['Wrong Answer', 'Accepted'] | ['s010112768', 's288887802'] | [3060.0, 3064.0] | [18.0, 18.0] | [216, 277] |
p03261 | u188244611 | 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... | ["# ABC 109, B - shiritori\n\nn = int(input())\nw = []\nfor i in range(n):\n w.append(input())\nprint(w)\n\n\nused = []\n\nfor i in range(n):\n print(i)\n if i == 0:\n used.append(w[i])\n tail = w[i][-1]\n else:\n # no if the same word is used\n if w[i] in used:\n prin... | ['Wrong Answer', 'Accepted'] | ['s898483638', 's824897443'] | [3064.0, 3064.0] | [17.0, 17.0] | [547, 525] |
p03261 | u189575640 | 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# N,M = [int(n) for n in input().split()]\n# S = str(input())\n# T = str(input())\n\nN = int(input())\nSS = [0]*N\ns = set()\nSS[0] = str(input())\nfor i in range(1,N):\n SS[i] = str(input())\n if(SS[i] in s):\n print('No')\n sys.exit()\n s.add(SS[i])\nfor i in range(1,N):\n if(S... | ['Wrong Answer', 'Accepted'] | ['s806412476', 's455795068'] | [3064.0, 3064.0] | [18.0, 18.0] | [379, 392] |
p03261 | u190907730 | 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\ndef is_unique(seq):\n return len(seq) == len(set(seq))\n\nN = int(input())\nW = []\nfor i in range(N):\n w.append((input()))\nif is_unique(W):\n for i in range(N-1):\n if W[i][-1] != W[i+1][0]:\n print("No")\n sys.exit()\n print("Yes")\n\nelse:\n print("No")\n',... | ['Runtime Error', 'Accepted'] | ['s519958957', 's100123994'] | [3060.0, 3060.0] | [17.0, 17.0] | [299, 300] |
p03261 | u192541825 | 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()\nflag=True\nfor i in range(n):\n buf=""\n str=input()\n if buf!="" and str[0]!=buf[-1:]:\n flag=False\n if str in s:\n flag=False\n s.add(str)\n buf=str\n print(buf[-1:])\n\nif flag:\n print("Yes")\nelse:\n print("No")\n', 'n=int(input())\ns=set()\nflag... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s467461673', 's843993203', 's616405221'] | [3060.0, 3060.0, 3060.0] | [19.0, 19.0, 17.0] | [267, 263, 243] |
p03261 | u201234972 | 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... | ['4\nhoge\nenglish\nhoge\nenigma\n', "N = int(input())\nW = input()\nL = []\nL.append(W)\nlast = W[-1]\nans = 'Yes'\nfor _ in range(N-1):\n w = input()\n if w in L:\n ans = 'No'\n if last == w[0]:\n last = w[-1]\n L.append(w)\n else:\n ans = 'No'\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s703720120', 's272963690'] | [2940.0, 3064.0] | [17.0, 18.0] | [27, 245] |
p03261 | u203383537 | 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\na=[input() for i in range(n)]\n\nans=True\nif all(a.count(w) == 1 for w in a):\n for i in range(n-1):\n if a[i][-1]!=a[i+1][0]:\n ans=False\n \nif ans: \n print('Yes')\nelse:\n print('No')", "n=int(input())\n\na=[input() for i in range(n)]\n\nans=True\nif all(a.count... | ['Wrong Answer', 'Accepted'] | ['s273012369', 's206137009'] | [3060.0, 3064.0] | [18.0, 18.0] | [226, 245] |
p03261 | u212228253 | 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... | ["a = input()\n\ndef main():\n ed = []\n for i in range(int(a)-1):\n neww = input()\n print(i)\n if i != 0:\n if ed[i-1][-1] != neww[0] or neww in ed:\n return 'No'\n ed.append(neww)\n print(ed)\n\n return 'Yes'\n \n\nif __name__ == '_... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s033467466', 's734816395', 's931007142', 's621856386'] | [3064.0, 2940.0, 3060.0, 2940.0] | [19.0, 17.0, 17.0, 18.0] | [331, 172, 321, 294] |
p03261 | u214547877 | 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())\ndic = dict()\nfor i in range(N):\n S = input()\n if S in dic:\n dic[S] += 1\n else:\n dic[S] = 1\n Start = S[0]\n if i != 0:\n if Start != End or dic[S] > 1:\n print("No")\n exit\n End = S[len(S)-1]\nprint("Yes")', 'N = int(input())\ndic ... | ['Wrong Answer', 'Accepted'] | ['s098646558', 's420727080'] | [9056.0, 9176.0] | [29.0, 26.0] | [278, 280] |
p03261 | u214617707 | 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())\nrec = []\nflag = True\nt = input()\npre = t[-1]\nfor i in range(1, n):\n s = input()\n if s in rec:\n flag = False\n elif s[0] != pre:\n flag = False\n else:\n rec.append(s)\n pre = s[-1]\n\nif flag:\n print("Yes")\nelse:\n print("No")\n', 'N = int(input... | ['Wrong Answer', 'Accepted'] | ['s937107562', 's041621810'] | [3060.0, 3064.0] | [17.0, 17.0] | [282, 369] |
p03261 | u217627525 | 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... | ['3\nabc\narc\nagc', 'n=int(input())\nw_before=input()\nword=[w_before]\nans="Yes"\nfor i in range(1,n):\n w=input()\n if w[0]!=w_before[-1] or w in word:\n ans="No"\n break\n else:\n w_before=w\n word.append(w)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s578677970', 's944703548'] | [2940.0, 3060.0] | [17.0, 17.0] | [13, 227] |
p03261 | u227082700 | 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,w=int(input()),[input()for i in range(n)]\ndef sortex(X):\n b=sorted(X)\n b.append("null")\n a=[]\n for i in range(len(X)):\n if b[i]!=b[i+1]:a.append(b[i])\n return a\nif len(w)!=len(sortex(w)):\n print("No")\n exit()\nfor i in range(len(w)-1):\n if w[i][-1]!=w[i+1][0]:\n print("No")\n exit()\npri... | ['Runtime Error', 'Accepted'] | ['s112650807', 's192982681'] | [3064.0, 3060.0] | [17.0, 17.0] | [312, 143] |
p03261 | u228294553 | 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())\nused=[]\nused.append(input())\nchain=used[0][-1]\nres="Yes"\nfor i in range(n-1):\n s=input()\n c=s[0]\n if s in used or chain!=c:\n res="No"\n break\n used.append(s)\n chain=s[-1]\n \n', 'n=int(input())\nused=[]\nused.append(input())\nchain=used[0][-1]\nres="Yes"\nfor ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s240904524', 's864522718', 's944447537'] | [2940.0, 3060.0, 3060.0] | [17.0, 18.0, 17.0] | [219, 252, 231] |
p03261 | u230531330 | 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())\nx=[]\nlast_char=''\nfirst_char=''\nx.append(input())\nlast_char=x[0][-1]\nprint(last_char)\nf_l_checker=True\n\nfor i in range(1,n):\n x.append(input())\n if f_l_checker==True:\n first_char=x[i][0]\n if first_char!=last_char:\n f_l_checker=False\n else:\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s014352436', 's125790400', 's335981518', 's407634512', 's429339014', 's586144221', 's601484021', 's602572119', 's979246107', 's258643730'] | [3064.0, 3064.0, 3064.0, 3060.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0, 18.0, 18.0, 17.0, 17.0, 17.0, 17.0, 17.0] | [457, 421, 598, 349, 355, 407, 328, 448, 595, 406] |
p03261 | u234189749 | 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())\na = 'Yes'\n\ns = W[0]\n\nfor i in range(N-1):\n k = input()\n if s[-1]==k[0] and k not in W:\n W.append(k)\n s = W[-1]\n else:\n a = 'No'\n for j in range(N-i):\n k = input()\n break\n\n\nprint(a)", "N = int(input())\nW =[ inp... | ['Runtime Error', 'Accepted'] | ['s255033679', 's576581288'] | [3060.0, 3060.0] | [17.0, 18.0] | [270, 181] |
p03261 | u236042710 | 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 elt in range(n)]\nx =0\nfor elt in range(len(l)):\n if l.count(l[elt]) > 1 :\n\n x=1\n break\nfor elt in range (len(l )-1):\n if l[elt][-1] != l[elt+1][0]:\n\n x = 1\n break\nif x == 0:\n print("YES")\nelse:\n print("NO")\n\n', 'n = int(input()... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s096408206', 's295586363', 's940910922', 's650690868'] | [3060.0, 3060.0, 3060.0, 3060.0] | [17.0, 18.0, 17.0, 18.0] | [281, 281, 372, 372] |
p03261 | u239316561 | 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 = []\ncount = 0\n\nfor i in range(n):\n w.append(input())\n\nfor i in range(n):\n if len(w) >= 2:\n print(w[count-1][-1] , w[count][0])\n if w[count-1][-1] != w[count][0]:\n print('No')\n exit()\n\n for j in range(count-1):\n if w[count] ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s327459273', 's750098893', 's664214062'] | [3064.0, 3064.0, 3060.0] | [18.0, 18.0, 18.0] | [391, 380, 311] |
p03261 | u240630407 | 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())\nary = []\ns = 'Yes'\nfor i in range(N):\n w = input()\n if w in ary:\n s = 'No'\n break\n if len(ary) > 0 and w[0] != ary[-1][-1]:\n s = 'No'\n break\n \nprint(s)", "N = int(input())\nary = []\ns = 'Yes'\nfor i in range(N):\n w = input()\n if w in ary:\n s = 'No'\n break\n ... | ['Wrong Answer', 'Accepted'] | ['s590219054', 's760070326'] | [2940.0, 3064.0] | [17.0, 18.0] | [186, 202] |
p03261 | u246392883 | 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 -*-\n\nn = input()\nn = int(n)\n\nw = []\nfor i in range(n):\n _w = input()\n w.append(_w)\nans = "YES"\nfor i in range(0,len(w)-1):\n for j in range(i+1,len(w)):\n if w[i] == w[j]:\n ans = "NO"\nfor i in range(0,len(w)-1):\n if w[i][-1] != w[i+1][0] :\n ans ="N... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s117258851', 's134624893', 's949927188', 's668756043'] | [3064.0, 2940.0, 3064.0, 3064.0] | [18.0, 17.0, 18.0, 18.0] | [316, 52, 316, 316] |
p03261 | u254871849 | 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# created: 2019-11-10 12:28:14(JST)\nimport sys\n# import collections\n# import math\n# from string import ascii_lowercase, ascii_uppercase, digits\n# from bisect import bisect_left as bi_l, bisect_right as bi_r\n# import itertools\n# from functools import reduce\n# import operator as op\n# ... | ['Runtime Error', 'Accepted'] | ['s000817454', 's255333946'] | [2940.0, 3060.0] | [17.0, 17.0] | [719, 362] |
p03261 | u270681687 | 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)]\n\ns = set(w[0])\nword = w[0][-1]\n\nfor i in range(1, n):\n if w[i] in s:\n print("No")\n exit()\n if w[i][0] != word:\n print("No")\n exit()\n s.add(w[i])\n word = w[i][-1]\n\nprint("Yes")', 'n = int(input())\nw = [input() for... | ['Wrong Answer', 'Accepted'] | ['s741840284', 's841290642'] | [3064.0, 3064.0] | [17.0, 17.0] | [264, 274] |
p03261 | u272557899 | 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 = input()\nw = []\nfor i in range(N):\n w.append(input())\n# [a1, a2, a3, ..., aN]\np = 0\nfor i in range(N):\n for j in range(i+1,N):\n if w[i] == w[j]:\n p = 1\n break\n \nv = []\nfor j in range(N):\n v[j] = list(w[j])\n\nfor k in range(N):\n if k != 0:\n if v[k - 1][len(v[k - 1]) - 1] !=... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s282098944', 's749352318', 's630308917'] | [3064.0, 3064.0, 3064.0] | [17.0, 17.0, 19.0] | [381, 379, 442] |
p03261 | u276204978 | 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\na = []\npre = W[0]\nflag = False\nfor wi in W[1:]:\n if wi in a or pre[-1] != wi[0]:\n flag = True\n break\n pre = wi\n a.append(wi)\n \nif flag:\n print('No')\nelse:\n print('Yes')", "N = int(input())\nW = [input() for _ in rang... | ['Wrong Answer', 'Accepted'] | ['s481354605', 's795870947'] | [3064.0, 3064.0] | [17.0, 17.0] | [254, 268] |
p03261 | u278622837 | 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 = []\ne = ["_"]\nans = "Yes"\nfor i in range(n):\n w = input()\n if w[-1] in e or w in l : ans = "No" \n l.append(i)\n e[0] = w[-1]\nprint(ans)', 'n = int(input())\nl = []\ne = "abcdefghijklmnopqrstuvwxyz"\nans = "Yes"\nfor i in range(n):\n w = input()\n if w[0] not in e or w in l : ans = "N... | ['Wrong Answer', 'Accepted'] | ['s431333767', 's710660641'] | [3060.0, 2940.0] | [18.0, 18.0] | [158, 181] |
p03261 | u279493135 | 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... | ['from colecctions import defaultdict\n\nN = int(input())\nW = [input().strip() for _ in range(N)]\n\ndic = defaultdict(int)\n\nfor i in range(N):\n if i == 0:\n tmp = W[i][-1]\n dic[W[i]] = 1\n else:\n if tmp != W[i][0] or dic[W[i]]:\n print("No")\n break\n else:\n tmp = W[i][-1]\nelse:\n ... | ['Runtime Error', 'Accepted'] | ['s608757486', 's557303707'] | [3060.0, 3316.0] | [17.0, 21.0] | [318, 338] |
p03261 | u280016524 | 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())\ncount = 0\nlistA=[]\nwhile (count <= N-1):\n try:\n listA.append(str(input()))\n count+=1\n except:\n break;\nprint(set(listA))\nprint(listA)\nif(len(listA) != len(set(listA))):\n print("No")\nelse:\n for i in range(N-1):\n if(listA[i][-1]!=listA[i+1][0]):\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s180623627', 's436810391', 's791591605'] | [3064.0, 3064.0, 3064.0] | [18.0, 17.0, 17.0] | [384, 374, 353] |
p03261 | u292814514 | 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=[]\nword=input()\nlist.append(word)\nkey=word[-1]\nflag=True\nfor i in range(1,n):\n word=input()\n if key==word[0] and (word not in list):\n list.append(word)\n key=word[-1]\n else:\n print("No")\n flag=False\nif flag:\n print("Yes")', '\nn=int(input())\nl... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s104206031', 's234932059', 's494092552', 's569909080', 's583064683', 's665459964', 's847672553', 's892454729', 's745471086'] | [3064.0, 3060.0, 3060.0, 2940.0, 3060.0, 2940.0, 3060.0, 3060.0, 3064.0] | [18.0, 17.0, 18.0, 17.0, 17.0, 18.0, 18.0, 17.0, 17.0] | [280, 226, 220, 160, 251, 163, 239, 224, 294] |
p03261 | u295811595 | 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=input()\n W.append(w)\n last=W[0][-1]\n S=set()\n S.add(w[0])\nfor i in range(1,N):\n if W[i][0]==last and not W[i] in S:\n pass\n else:\n print("No")\n exit()\n S.add(W[i])\n last=W[i][-1] \nprint("Yes")', 'N=int(input())\nW... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s062296997', 's381448732', 's541630817', 's791590462', 's862687213', 's204902060'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 17.0, 19.0, 18.0, 18.0, 17.0] | [300, 292, 288, 288, 268, 268] |
p03261 | u299730702 | 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)]\n\nf = True\nfor i in range(len(W)-1):\n if W[i][-1] != W[i+1][0]:\n f = False\n break\n\nprint(f)\n\nif f and N==len(set(W)):\n print('Yes')\nelse:\n print('No')\n", "N = int(input())\nW = [input() for i in range(N)]\n\nf = True\nfor i in range... | ['Wrong Answer', 'Accepted'] | ['s189840141', 's949744142'] | [3060.0, 2940.0] | [17.0, 17.0] | [222, 212] |
p03261 | u305965165 | 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 = [int(input()) for i in range(n)] \n\nused = [a[0]]\npre = a[0]\nfor i in a[1:]:\n if i not in used and pre[-1] == i[0]:\n used.append(i)\n pre = i\n else:\n print("No")\n exit()\n\nprint("Yes")', 'n = int(input()) \na = [input() for i in range(n)] \n\nused = [a... | ['Runtime Error', 'Accepted'] | ['s906327016', 's429255634'] | [3064.0, 3060.0] | [18.0, 18.0] | [237, 232] |
p03261 | u318427318 | 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\ninput=sys.stdin.readline\n\ndef main():\n words=[]\n n = int(input())\n words=[input().rstrip() for _ in range(n)]\n print(words)\n\n if len(set(words))!=n:\n print("No")\n exit()\n\n endstring=""\n for word in words:\n if len(endstring)==0:\n... | ['Wrong Answer', 'Accepted'] | ['s374671119', 's047993144'] | [9100.0, 9188.0] | [27.0, 30.0] | [539, 522] |
p03261 | u327466606 | 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... | ["from itertools import tee\nN = int(input())\nw0, w1 = tee((int(input()) for _ in range(N)), 2)\nnext(w1)\nfor a,b in zip(w0,w1):\n if a[-1] != b[0]:\n print('No')\n break\nelse:\n print('Yes')", "from itertools import tee\nN = int(input())\nw0, w1 = tee((input() for _ in range(N)), 2)\n\nwords = {next(w1)}\nf... | ['Runtime Error', 'Accepted'] | ['s267889656', 's587882727'] | [3060.0, 3060.0] | [19.0, 17.0] | [191, 221] |
p03261 | u328510800 | 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())\nm = dict()\n\nprev = input()\nm[prev] = True\nflg = True\n\nfor _ in range(N - 1):\n s = input()\n flg = all(flg, s not in m, prev[len(prev) - 1] == s[0])\n m[s] = True\n prev = s\n\nprint("Yes" if flg else "No")', 'N = int(input())\nm = dict()\n\nprev = input()\nm[prev] = True\nflg = True\n\nfo... | ['Runtime Error', 'Accepted'] | ['s570421369', 's336313238'] | [9124.0, 9120.0] | [29.0, 29.0] | [221, 223] |
p03261 | u329058683 | 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... | ['L=[]\nfor i in range(N):\n L.append(input())\nif not len(L)==len(set(L)):\n print("NO")\nn=0\nwhile n<=N:\n if n==N-1:\n print("Yes")\n break\n elif L[n][-1]==L[n+1][0]:\n n=n+1\n else:\n print("NO")\n break', 'N=int(input())\nL=[]\nfor i in range(N):\n L.append(input())\nif not len(L)==len(set(L... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s104762659', 's172576385', 's381239098', 's181689592'] | [3060.0, 3064.0, 3064.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [213, 228, 228, 250] |
p03261 | u332906195 | 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\nWs = set([W[0]])\nfor i in range(1, N):\n if not W[i - 1][-1] == W[i][0] or W[i] in Ws:\n print("No", W[i])\n exit()\n else:\n Ws.add(W[i])\n\nprint("Yes")\n', 'N = int(input())\n\nW, OK = ["-"], True\nfor i in range(N):\n W.append(inp... | ['Wrong Answer', 'Accepted'] | ['s395252397', 's337310699'] | [3060.0, 2940.0] | [19.0, 18.0] | [225, 196] |
p03261 | u333629593 | 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=[]\nfla=True\ns.append(input())\nfor i in range(1,n):\n s.append(input())\n if fla :\n if s[i][0]==s[i-1][len(s[i-1])-1]:\n for j in range(i):\n if s[j]==s[i]:\n fla=False\n else:\n fla=False\nif fla:\n print("YES")\nelse... | ['Wrong Answer', 'Accepted'] | ['s995240152', 's162111330'] | [3064.0, 3064.0] | [18.0, 18.0] | [321, 321] |
p03261 | u339523379 | 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\nwords=[input() for _ in range(N)]\n\ntmp=set(words)\nprint(tmp)\nc=1\nif len(words)!=len(tmp):\n c=0\nelse:\n for i in range(N):\n print(words)\n if i==0:\n continue\n elif words[i][0]!=words[i-1][-1]:\n c=0\n break\n\n\nprint(c)\nif c:\n ... | ['Wrong Answer', 'Accepted'] | ['s237318386', 's566124357'] | [3188.0, 3060.0] | [19.0, 17.0] | [333, 336] |
p03261 | u339550873 | 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... | ["#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\nN = int(input())\nwls =[]\nfor i in range(N):\n wls.append(input())\ncount =0\nif len(wls) != len(set(wls)):\n print('No')\nelse:\n for i in range(N):\n if i == 0:\n continue\n else:\n if wls[i][0] != wls[i-1][-1]:\n ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s333181289', 's559534250', 's132764713'] | [3064.0, 2940.0, 3060.0] | [19.0, 17.0, 18.0] | [402, 405, 418] |
p03261 | u343671593 | 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... | ['words = []\nfor inp in range(N):\n\twords.append(input())\n\nfrst = words[0]\nfor i in range(1,len(words)):\n\tif words[i-1][-1] != words[i][0]:\n\t\tprint("No")\n\t\tbreak\n\telse:\n\t\tflag = 0\n\t\tif words[i] in words[:i-1]:\n\t\t\tprint("No")\n\t\t\tbreak\n\t\telse:\n\t\t\tflag = 1\nif flag == 1:\n\tprint("Yes")... | ['Runtime Error', 'Accepted'] | ['s797395351', 's997091556'] | [3060.0, 3060.0] | [17.0, 17.0] | [280, 301] |
p03261 | u344462910 | 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\nstring_list=[input() for i in range(N)]\ni = 0\nstring_list2 = list(set(string_list))\nif(len(string_list2)==N):\n check = 1\nelse:\n check = 0\n\nwhile(i < N-1):\n string1 = string_list[i]\n string2 = string_list[i+1]\n print(string1)\n print(string2)\n str1 = string1[-1]\n ... | ['Wrong Answer', 'Accepted'] | ['s753529129', 's904367307'] | [3064.0, 3064.0] | [17.0, 17.0] | [427, 389] |
p03261 | u345778634 | 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 A = [input()]\n for i in range(1, N):\n W = input()\n if A[-1][-1] == W[0]:\n for j in range(i-1):\n if A[j] == W:\n print("No:重複")\n return\n A.append(W)\n else:\n prin... | ['Wrong Answer', 'Accepted'] | ['s689899715', 's796283162'] | [3060.0, 2940.0] | [18.0, 18.0] | [371, 352] |
p03261 | u346028292 | 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)]\n\natama=[]\noshiri=[]\n\nfor i in s:\n atama.append(i[0])\n oshiri.append(i[-1])\n\n\n\noshiri=oshiri[-1:]+oshiri[:-1]\n\natama.pop(0)\noshiri.pop(0)\n\nif oshiri==atama:\n print("Yes")\nelse:\n print("No")', 'N=int(input())\ns = [input() for i in range(N)]... | ['Wrong Answer', 'Accepted'] | ['s968354850', 's149264571'] | [3064.0, 3064.0] | [17.0, 17.0] | [247, 331] |
p03261 | u346194435 | 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\ncache = []\nabc = ''\nngflag = False\nfor i in range(N):\n word = input()\n if abc != '':\n if word[0] != abc:\n print(word)\n ngflag = True\n if word in cache:\n print(word)\n ngflag = True\n abc = word[-1]\n cache.append(word)\n\nif ngfla... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s490678688', 's972794282', 's532101926'] | [3064.0, 3060.0, 3060.0] | [26.0, 18.0, 18.0] | [342, 342, 306] |
p03261 | u353919145 | 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=[]\na.append(input())\nl=1\nfor i in range(n-1):\n s=input()\n if s not in a and a[i][-1]==s[0]:\n a.append(s)\n else:\n l=0\n break\nif l==1:\n print("YES")\nelse:\n print(\'NO\')', 'n = int(input())\nlist_words = []\nfor q in range(n):\n list_words.append(in... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s086332011', 's188911199', 's395809739', 's441286338', 's610787527', 's616047164', 's404373332'] | [3060.0, 3060.0, 3060.0, 3316.0, 3060.0, 2940.0, 2940.0] | [17.0, 17.0, 19.0, 22.0, 20.0, 17.0, 17.0] | [219, 325, 319, 367, 308, 279, 496] |
p03261 | u363118893 | 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())\nans = "Yes"\narr = []\nfor i in range(N)\n arr.append(input())\n if not i == 1:\n if arr[i] in arr and arr[i-1][-1] == arr[i][0]\n pass\n else:\n ans = "No"\n break\n\nprint(ans)\n', 'N = int(input())\nans = "Yes"\narr = []\nfor i in range(N):\n ... | ['Runtime Error', 'Accepted'] | ['s744349652', 's721918044'] | [2940.0, 2940.0] | [18.0, 17.0] | [238, 249] |
p03261 | u366939485 | 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_w = [input() for s in range(0, n)]\nfor i in range(0, n):\n if i == 0 or (list_w[i - 1][-1] == list_w[i][0]) and list_w[i] not in list_w[:i]:\n print(list_w[i])\n continue\n else:\n print("No")\n exit()\nprint("Yes")', 'n = int(input())\nlist_w = [input() for s... | ['Wrong Answer', 'Accepted'] | ['s403675233', 's017103307'] | [9000.0, 9072.0] | [29.0, 28.0] | [264, 239] |
p03261 | u367130284 | 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... | ['_,a=open(0).readlines()\nif len(set(a))<len(a):\n print("No")\n exit()\nb=[(i[0],i[-2]) for i in a]\nfor k in range(len(b)-1):\n if b[k][1]!=b[k+1][0]:\n print("No")\n exit()\nprint("Yes")', 'n,*a=open(0).read().split()\nif len(a)>len(set(a)):\n print("No")\n exit()\nelse:\n s=a[0][-1]\n for i in... | ['Runtime Error', 'Accepted'] | ['s376735162', 's390513651'] | [3060.0, 3060.0] | [17.0, 18.0] | [188, 268] |
p03261 | u371467115 | 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(w)]\nans="Yes"\nfor j in range(1,len(w)):\n if w[j-1][len(w[j-1])-1]!=w[j][0]:\n ans="No"\nprint(ans)', 'n=int(input())\nw=[input() for i in range(n)]\nans="Yes"\nfor j in range(1,len(w)):\n if w[j-1][len(w[j-1])-1]!=w[j][0]:\n ans="No"\nprint(ans)', 'n=int(input())\n... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s001996236', 's867712025', 's018192085'] | [2940.0, 3060.0, 3060.0] | [18.0, 19.0, 18.0] | [141, 141, 161] |
p03261 | u374802266 | 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())\nfor i in range(n):\n a.append(input())\nif len(a)!=len(set(a)):\n print('No')\n exit()\nfor i in range(n-1):\n if a[i][-1]!=a[i+1][0]:\n print('No')\n exit()\nprint('Yes')", "n=int(input())\na=[]\nfor i in range(n):\n a.append(input())\nif len(a)!=len(set(a)):\n print('... | ['Runtime Error', 'Accepted'] | ['s935166194', 's166422358'] | [3060.0, 3060.0] | [17.0, 17.0] | [203, 208] |
p03261 | u384679440 | 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)]\nans = 'Yes'\nW_set = set(W)\nif len(W) == len(W_set):\n for i in range(1, N - 1):\n if W[i][0] != W[i-1][-1]:\n ans = 'No'\n break\nelse:\n ans = 'No'\nprint(ans)", "N = int(input())\nW = [input() for _ in range(N)]\nans = 'Yes'\nW_set = set(W)\n... | ['Runtime Error', 'Accepted'] | ['s996806206', 's739181633'] | [3060.0, 3060.0] | [17.0, 17.0] | [223, 213] |
p03261 | u385244248 | 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,*W = map(str,open(0).read().split())\nN = int(N)\nfor i in range(N-1):\n if list(W[i])[-1] != list(W[i+1])[0]:\n print("No")\n sys.exit()\nprint("Yes")', 'import sys\nN,*W = map(str,open().read().split())\nN = int(N)\nfor i in range(N-1):\n if list(N[i])[-1] != list(N[i+1])[0]:\n ... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s335569538', 's596740309', 's858360240', 's552943044'] | [2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 18.0, 17.0] | [175, 174, 174, 232] |
p03261 | u393512980 | 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... | ['from collections import defaultdict\ndic = defaultdict(str)\nn = int(input())\nlst = [input() for _ in range(n)]\nlast = lst[0]\nflag = True\nfor i in range(1, n):\n if lst[i][0] != last[-1]:\n \tflag = False\n break\n dic[lst[i]] += 1\n if dic[lst[i]] > 1\n \tflag = False\n break\nif flag:\n print("Yes")... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s339957371', 's567620802', 's389406122'] | [2940.0, 3316.0, 3316.0] | [18.0, 23.0, 23.0] | [324, 340, 354] |
p03261 | u395620499 | 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()\n\nok = True\nt = input()\np = t[-1]\nfor i in range(n-1):\n t = input()\n if t in s:\n ok = False\n s.add(t)\n if t[0] != p:\n ok = False\n p = t[-1]\n \nprint('Yes' if ok else 'No')", "n = int(input())\ns = set()\n\nok = True\nt = input()\np = t[-1]\ns.add(t)\nfor i in range(... | ['Wrong Answer', 'Accepted'] | ['s126362235', 's043139251'] | [9032.0, 9128.0] | [30.0, 30.0] | [208, 234] |
p03261 | u396495667 | 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(x) for x in range(n)]\ns = set(w)\nans ='Yes'\nif len(s) !=n:\n ans ='No'\nelse:\n for i in range(n):\n if w[i][0] != w[i-1][-1]:\n ans ='No'\n else:\n ans ='Yes'\nprint(ans)\n", "n = int(input())\ns =[input() for _ in range(n)]\nans =0\nif len(s) != len(set(s)):\n ans ... | ['Wrong Answer', 'Accepted'] | ['s497856363', 's934944950'] | [3064.0, 3064.0] | [18.0, 18.0] | [210, 184] |
p03261 | u400221789 | 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... | ["from sys import exit\nn=int(input())\ns=input()\nw=[]\nw.append(s)\nfor i in range(n-1):\n s=input()\n if w[i][-1]!=a[0] or s in w:\n print('No')\n exit()\n else:\n w.append(s)\nprint('Yes')\n ", "from sys import exit\nn=int(input())\ns=input()\nw=[]\nw.append(s)\nfor i in range(n-1):\n s=input()\n if ... | ['Runtime Error', 'Accepted'] | ['s971477050', 's996979861'] | [3060.0, 3060.0] | [17.0, 17.0] | [193, 190] |
p03261 | u406109688 | 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... | ['c = int(input())\nw = []\nfor i in range(c):\n w.append(input())\nif len(set(w)) != len(w):\n print("No")\n return\nfor i in range(len(w) - 1):\n if w[i][-1] != w[i+1][0]:\n print("No")\n return\nprint("Yes")', 'falsify = "Yes"\nc = int(input())\nw = []\nfor i in range(c):\n w.append(input())\nif len(set(w... | ['Runtime Error', 'Accepted'] | ['s186606876', 's654229689'] | [3060.0, 3060.0] | [17.0, 18.0] | [207, 211] |
p03261 | u410118019 | 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 aa=input()\n if aa in a or aa[0] != a[-1][0]:\n print("No")\n break\n if i == n-1:\n print("Yes")\n a.append(aa)', 'n=int(input())\na=[input()]\nfor i in range(n-1):\n aa=input()\n if aa in a or aa[0] != a[-1][-1]:\n print("No")\n break\n if i == n-2:\n... | ['Runtime Error', 'Accepted'] | ['s240330676', 's119622525'] | [2940.0, 2940.0] | [17.0, 18.0] | [159, 170] |
p03261 | u417794477 | 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 = []\nans = "Yes"\npreword = input()\n\nfor i in range(n-1):\n w = input()\n if w in word_list:\n ans = "No"\n if preword[-1] != w[0]:\n ans = "No"\n word_list.append(w)\n preword = w\nprint(ans)', 'n = int(input())\nword_list = []\nans = "Yes"\npreword = input... | ['Wrong Answer', 'Accepted'] | ['s270818781', 's905706749'] | [3060.0, 3060.0] | [17.0, 18.0] | [239, 264] |
p03261 | u419963262 | 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()\nans=0\nfor i in range(n):\n keep=s[-1]\n s=input()\n if keep != s[0]:\n ans=1\n else:\n continue\nprint(["Yes","No"][ans])\n \n ', 'n=int(input())\ns=input()\nans=0\nfor i in range(n-1):\n keep=s[-1]\n s=input()\n if keep != s[0]:\n ans=1\n else:\n continue\nprint(["... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s253923041', 's772474907', 's056157869'] | [9112.0, 9152.0, 9124.0] | [22.0, 28.0, 27.0] | [157, 160, 217] |
p03261 | u426108351 | 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())\nused = [input()]\nflag = 1\nfor i in range(N-1):\n now = input()\n if now not in used and used[-1][-1] == now[0]:\n used.append(now)\n else:\n flag = 0\n \tbreak\nif flag == 1:\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nused = [input()]\nflag = 1\nfor i in range(N-1):\n n... | ['Runtime Error', 'Accepted'] | ['s213215064', 's853112226'] | [2940.0, 2940.0] | [18.0, 17.0] | [229, 223] |
p03261 | u432453907 | 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=[str(input())]\nans="Yes"\nfor i in range(n-1):\n x=str(input())\n w.append(x)\n y=w[i]\n if x[0]!=y[-1]:\n ans="No"\n break\nprint(ans)', 'n=int(input())\nw=[str(input())]\nans="Yes"\nfor i in range(n-1):\n x=str(input())\n if x in w:\n ans="No"\n break... | ['Wrong Answer', 'Accepted'] | ['s272824830', 's796119119'] | [9188.0, 9164.0] | [31.0, 28.0] | [170, 216] |
p03261 | u432805419 | 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 = 1\n\n\n\nfor i in range(n):\n for j in range(i+1,n-i+1):\n if w[i] == w[j]:\n flag = flag *0\n break\n \nfor i in range(n):\n if i == 0:\n continue\n if w[i-1][-1] == w[i][0]:\n flag = flag * 1\n else:\n flag = flag * 0\n \nif fla... | ['Wrong Answer', 'Accepted'] | ['s303360469', 's211183955'] | [3064.0, 3060.0] | [17.0, 19.0] | [347, 372] |
p03261 | u433380437 | 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=[]\nw=''\nfor i in range(n):\n if i !=0 and w[-1] !=str(input())[0]:\n print('No')\n exit()\n else:\n w=str(input())\n W.append(w)\nif len(W) != len(list(set(W))):\n print('No')\n exit()\nprint('Yes')", "n =int(input())\nW=[]\nw=''\nfor i in range(n):\n s=... | ['Runtime Error', 'Accepted'] | ['s862309142', 's919459976'] | [9184.0, 9184.0] | [27.0, 29.0] | [246, 244] |
p03261 | u434872492 | 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 = []\nw_dic = dict()\nfor i in range(N):\n W.append(input())\n\ncheck = True\nfor i in range(N-1):\n if W[i][-1] == W[i+1][0]:\n continue\n else:\n check = False\n break\nfor i in range(N):\n if W[i] in w_dic:\n check = False\n else:\n w_dict[W[i]]... | ['Runtime Error', 'Accepted'] | ['s127972336', 's265773851'] | [3064.0, 3064.0] | [18.0, 17.0] | [354, 401] |
p03261 | u441320782 | 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_1 = 1\nflag_2 = None\ninf = [input() for i in range(N)]\nprint(inf)\nfor j in range(N):\n for k in range(N):\n if inf[j]==inf[k]:\n flag_1 = 0\n break\n\nfor p in range(N-1):\n sear_1 = [q for q in inf[p]]\n sear_2 = [o for o in inf[p+1]]\n if sear_1[-1]==sear_2[0]:\n flag_2... | ['Wrong Answer', 'Accepted'] | ['s605021517', 's218619389'] | [3064.0, 3060.0] | [18.0, 18.0] | [430, 197] |
p03261 | u448655578 | 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 = []\nfor i in range(N):\n word = list(input())\n if i == 0:\n words.append(word[len(word)])\n elif i == N-1:\n words.append(word[0])\n else:\n words.append(word[0])\n words.append(word[len(word)])\n \nif len(set(words))*2 - len(words) == 0:\n print("Yes")\nelse:\n print("No... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s379447572', 's999636416', 's285587520'] | [3060.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0] | [311, 609, 528] |
p03261 | u453526259 | 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\nused = []\nans = "Yes"\n\nfor i in range(n):\n if i == 0:\n t = str(input())\n else:\n t = str(input())\n print(t + "!")\n for j in used:\n if t == j:\n ans = "No"\n\n if len(t) == 1:\n if past[]\n \n e... | ['Runtime Error', 'Accepted'] | ['s476819593', 's555339528'] | [2940.0, 2940.0] | [17.0, 18.0] | [408, 296] |
p03261 | u454714837 | 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 = []\n\nAns = True\n\nfor i in range(N):\n a =input()\n L.append(a)\n\nfor j in range(N-1):\n if list(L[j])[-1] != list(L[j+1])[0]:\n Ans = False\n\nfor k in range(N):\n if L[i] in L[:i]:\n Ans = False\n \nif Ans == True:\n print('Yes')\nelse:\n print('No')",... | ['Wrong Answer', 'Accepted'] | ['s044809345', 's343019816'] | [3064.0, 3064.0] | [17.0, 18.0] | [296, 296] |
p03261 | u455317716 | 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())\nsiritori_list = list()\nfor i in range(n):\n siritori_list.append(input())\nfor ii in range(n):\n word = siritori_list.pop(0)\n print(word,siritori_list)\n if siritori_list:\n if not(word[-1] == siritori_list[0][0]) or word in siritori_list:\n print("No")\n b... | ['Wrong Answer', 'Accepted'] | ['s225550314', 's962887742'] | [3064.0, 3060.0] | [22.0, 17.0] | [335, 305] |
p03261 | u457601965 | 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 numpy as np\nimport collections as cl\nimport itertools as it\n# import more_itertools as mit\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(100000)\n\nn = int(readline())\nw = list(readlines().split())\ndic = set()... | ['Runtime Error', 'Accepted'] | ['s437636991', 's887386286'] | [27084.0, 27076.0] | [117.0, 121.0] | [489, 506] |
p03261 | u464912173 | 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() for i in range(n)] \n\nfor i in range(1, n):\n if a[i-1][-1]!=a[i][0] or a[i]==a[:i-1]:\n print('No')\n break\n else:\n print('Yes')", "n = int(input())\na = [input() for i in range(n)] \n\nfor i in range(1, n):\n if a[i-1][-1]!=a[i][0] or a[i] in a[:i-1]:\n print('No')\n... | ['Wrong Answer', 'Accepted'] | ['s146220435', 's542017666'] | [3060.0, 3060.0] | [17.0, 17.0] | [166, 164] |
p03261 | u468953424 | 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())\nc=0\nm=[]\ns=input()\nm.append(s)\nfor i in range(N-1):\n l=input()\n if l not in m and m[i][-1]==l[0]:\n c+=1\n m.append(l)\nif c==N-1:\n print("YES")\nelse:\n print("NO")', 'N=int(input())\nc=0\nm=[]\ns=input()\nm.append(s)\nfor i in range(N-1):\n l=input()\n if l not in m and m[i][-1]==l[... | ['Wrong Answer', 'Accepted'] | ['s608909910', 's775193299'] | [3060.0, 3060.0] | [17.0, 17.0] | [183, 183] |
p03261 | u469953228 | 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=input()\nx=[]\nfor i in range(n):\n w = input()\n if i !=0 and (w in x or x[i-1][-1] != w[0]):\n print ("No")\n exit()\n x.append(w)\nprint("Yes")\n ', 'n = int(input())\ns = input()\nL = [s]\nfor i in range(n-1):\n t = input()\n if t[0] != s[len(s)-1] or t in L:\n print("No")\n exit()\n L.app... | ['Runtime Error', 'Accepted'] | ['s725898436', 's779069043'] | [2940.0, 3060.0] | [17.0, 17.0] | [154, 170] |
p03261 | u475402977 | 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=input()\nN=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][len(S[i])-1]!=S[i+1][0]:\n ans='No'\nprint(ans)\n", "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 ... | ['Runtime Error', 'Accepted'] | ['s406851782', 's820726435'] | [3060.0, 3060.0] | [17.0, 17.0] | [183, 173] |
p03261 | u475808877 | 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()]\ncount=1\nfor i in range(n-1):\n w=input()\n s.append(w)\n if s[i][-1]==s[i+1][0]:\n count=count+1\nif count==n and len(s)==len(set(s)):\n print("Yes")\nelse:\n print("no")', 'n=int(input())\ns=[input()]\ncount=1\nfor i in range(n-1):\n w=input()\n s.append(w)\n... | ['Wrong Answer', 'Accepted'] | ['s206496549', 's687347083'] | [3064.0, 3060.0] | [17.0, 18.0] | [211, 211] |
p03261 | u477650749 | 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... | ['x1, y1, x2, y2 = map(int, input().split())\nprint(x2+(y1-y2),y2+(x2-x1),x1+(y1-y2),y1+(x2-x1))', 'n = int(input())\nlist_w = [input() for i in range(n)]\nlist_ok = [list_w[0]]\n\nif len(list_w) != len(set(list_w)):\n print("No")\n\nelse:\n for i in range(1, n):\n if list_w[i - 1][-1] == list_w[i][0]:\n ... | ['Runtime Error', 'Accepted'] | ['s059690442', 's346346166'] | [2940.0, 3060.0] | [18.0, 17.0] | [93, 352] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.