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 | u785505707 | 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... | ['dataNum=input()\nwordList=[]\nfor word in input:\n wordList.append(word.strip())\n\nif len(wordList) != len(set(wordList)):\n print("No")\n exit()\n\nchar = wordList[0][-1:]\nfor n in range(1, len(wordList)):\n if(char != wordList[n][:1]):\n print("No")\n exit()\n char = wordList[n][-1:]\... | ['Runtime Error', 'Accepted'] | ['s586074733', 's461732375'] | [3064.0, 3064.0] | [17.0, 17.0] | [317, 331] |
p03261 | u790812284 | 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)]\nw_set = set()\nfor i in range(n):\n w_set.add(w[i])\n\nif len(w)!=len(w_set):\n print("No")\nelse:\n for i in range(n-1):\n if w[i][-1]!=w[i+1][0]:\n print("No")\n \nprint("Yes")', 'import sys\nn=int(input())\nw=[input() for i i... | ['Wrong Answer', 'Accepted'] | ['s988196738', 's017835488'] | [3060.0, 3064.0] | [18.0, 17.0] | [255, 274] |
p03261 | u791664126 | 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())\nsp=input()\nl=set()\nfor _ in range(n-1):\n sn=input()\n if (sn in l) or (sp[-1]!=sn[0]):\n print('No')\n sys.exit()\n l.add(sn)\n sp=sn\nprint('Yes')", "import sys\nn=int(input())\nsp=input()\nl=set()\nfor _ in range(n-1):\n sn=input()\n if (sn in l) or (sp... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s173319716', 's367477705', 's568876254'] | [3060.0, 3064.0, 3064.0] | [17.0, 17.0, 18.0] | [193, 193, 193] |
p03261 | u803617136 | 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'\nwords = [input() for _ in range(n)]\nsaid = set()\ntail = words[0][0]\nfor w in words:\n if w in said or w[0] != tail:\n ans = 'No'\n print(w)\n break\n said.add(w)\n tail = w[-1]\n\nprint(ans)", "n = int(input())\nans = 'Yes'\nwords = [input() for _ in ran... | ['Wrong Answer', 'Accepted'] | ['s703032574', 's636944611'] | [3064.0, 3064.0] | [17.0, 17.0] | [241, 224] |
p03261 | u810735437 | 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 -*-\n\nimport array\nfrom bisect import *\nfrom collections import *\nimport fractions\nimport heapq \nfrom itertools import *\nimport math\nimport random\nimport re\nimport string\nimport sys\n\n\nN = int(input())\nprev = None\nok = Truen\nfor n in range(N):\n w = input... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s200819291', 's669942163', 's510176251'] | [8232.0, 8264.0, 8008.0] | [269.0, 303.0, 282.0] | [467, 466, 531] |
p03261 | u811000506 | 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)]\nflag = True \nb = W[0][-1] \nfor i in range(1,N): \n if b == W[i][0]:\u3000\n b = W[i][-1]\u3000\n else: \n flag = False\n exit()\n \nif int(len(W))!=len(set(W)):\n flag = False\n\nif flag == True:\n print("Yes")\nelse:\n print("No")', 'N = int(input... | ['Runtime Error', 'Accepted'] | ['s427445265', 's401279605'] | [2940.0, 3064.0] | [18.0, 18.0] | [278, 268] |
p03261 | u814781830 | 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... | ['W = []\njudge = True\na = ""\nN = int(input())\nfor i in range(N):\n s = input()\n W.append(s)\n if i == 0:\n a = s[len(s)-1]\n else:\n if a != s[0] or s in W:\n judge = False\n break\n else:\n a = s[len(s)-1]\nif judge:\n print("Yes"):\nelse:\n ... | ['Runtime Error', 'Accepted'] | ['s225942953', 's096420292'] | [2940.0, 3316.0] | [17.0, 19.0] | [311, 310] |
p03261 | u814986259 | 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\nN=int(input())\nsiritori=collections.defaultdict(int)\nprev=""\nfor i in range(N):\n word = imput()\n if word in siritori:\n print("No")\n elif prev[-1]==word[0]:\n print("No")\n siritori[word]+=1\nprint("Yes")', 'import collections\nN=int(input())\nsiritori=collections.defaultdict(int... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s063600392', 's426009218', 's928086163', 's428203354'] | [3316.0, 3316.0, 3316.0, 3060.0] | [20.0, 20.0, 20.0, 18.0] | [231, 241, 241, 241] |
p03261 | u816631826 | 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... | ['noOfWords= int(input())\nwords = []\nsatisfactor = True\nfor i in range(noOfWords):\n words.append(input())\n\nif len(set(words)) < len(words):\n print("NO") \n satisfactor = False \nelse:\n for i in range(len(words)-1):\n if words[i][len(words[i])-1] == words[i+1][0]:\n continue\n ... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s295714678', 's296524547', 's398544904', 's729308933', 's951592949', 's620040436'] | [3060.0, 3060.0, 3060.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 18.0, 18.0, 18.0] | [438, 211, 265, 354, 360, 262] |
p03261 | u835732324 | 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=[str(input()) for i in range(n)]\nans = 0\nfor i in range(n):\n if list(l[i])[-1] == list(l[i+1])[0] and l.count(l[i]) == 1:\n ans += 1\n else:\n ans += 0\nprint('Yes' if ans==n else'N0')", "n=int(input())\nl=[str(input()) for i in range(n)]\nans = 0\nfor i in range(n-1):\n if... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s313335422', 's792229924', 's424031953'] | [3060.0, 3060.0, 2940.0] | [18.0, 19.0, 17.0] | [217, 221, 191] |
p03261 | u844005364 | 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)]\nprint("Yes" if all([y[0] == x[-1] for x, y in zip(words, words[1:]) and len(set(words)) == n else "No")', 'n = int(input())\nwords = [input() for _ in range(n)]\nprint("Yes" if all([y[0] == x[-1] for x, y in zip(words, words[1:])) and len(set(words)) == n else "N... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s021731815', 's241623516', 's337275674', 's795460656'] | [2940.0, 2940.0, 3064.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [156, 157, 157, 158] |
p03261 | u846226907 | 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 numpy as np\nimport sys\n\ninput = sys.stdin.readline\n\nN = int(input())\n\nx = []\n\nres = True\nfor i in range(N):\n w = input()\n w = w[:(len(w)-1)]\n if w in x:\n res = False\n x.append(w)\n print(w,w[0],x[i-1][-1],res)\n if i > 0: \n if w[0] != x[i-1][-1]:\n res... | ['Wrong Answer', 'Accepted'] | ['s487414905', 's362974451'] | [14536.0, 21748.0] | [152.0, 309.0] | [355, 322] |
p03261 | u855985627 | 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())\nfor i in range(N-1):\n if W[i][-1] != W[i+1][0]:\n print('No')\n return\n for j in range(i+1, N):\n if W[i]==W[j]:\n print('No')\n return\nprint('Yes')", "N=int(input())\nW=[]\nfor i in range(N):\n W.append(input())\nfor i in range(N... | ['Runtime Error', 'Accepted'] | ['s658882825', 's712981686'] | [3060.0, 3060.0] | [17.0, 18.0] | [223, 223] |
p03261 | u856232850 | 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\nans = 'Yes'\n\nw = []\n\nfor i in range(n):\n\ta = input()\n\tif a in w:\n\t\tans = 'No'\n\telse:\n\t\tw.append(a)\n\nif n == 2:\n\tif w[0][-1] != w[1][0]:\n\t\tans = 'No'\nelif n == 3:\n\tif w[0][-1] != w[1][0]:\n\t\tans = 'No'\n\tif w[1][-1] != w[2][0]:\n\t\tans = 'No'\nelse:\n\tfor i in range(1... | ['Runtime Error', 'Accepted'] | ['s190875195', 's243161849'] | [3188.0, 3064.0] | [18.0, 17.0] | [365, 213] |
p03261 | u857148155 | 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 i in range(n):\n w=input()\n if w in ws or w[0]!=ws[i-1][-1]:\n print("No")\n break\nelse:\n print("Yes")', 'n=int(input())\nws=[input()]\nfor i in range(1,n):\n w=input()\n if w in ws or w[0]!=ws[i-1][-1]:\n print("No")\n break\n ws.append(w)\nelse:print("Yes")'] | ['Runtime Error', 'Accepted'] | ['s661021327', 's912895730'] | [3060.0, 3060.0] | [17.0, 17.0] | [133, 154] |
p03261 | u863370423 | 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', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s060108111', 's179952356', 's410821103', 's741443477', 's180709316'] | [3060.0, 3444.0, 3064.0, 3060.0, 3060.0] | [18.0, 21.0, 18.0, 17.0, 17.0] | [322, 732, 384, 372, 454] |
p03261 | u864197622 | 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\nif [W[i][-1] for i in range(N-1)] == [W[i+1][0] for i in range(N-1)] and len(list(set(W))) = len(W):\n print ("Yes")\nelse:\n print ("No")', 'N = int(input())\nW = [input() for i in range(N)]\n\nif [W[i][-1] for i in range(N-1)] == [W[i+1][0] for i in range(N... | ['Runtime Error', 'Accepted'] | ['s736371093', 's780255972'] | [2940.0, 3060.0] | [17.0, 17.0] | [191, 192] |
p03261 | u867848444 | 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)]\ncount=0\nif len(w)==len(set(w)):\n for i in range(n-1):\n if w[i][-1]==w[i+1][0]:\n count+=1\nelse:\n print('No')\nprint('Yes' if count>0 else 'No')", "n=int(input())\nw=[input() for i in range(n)]\ncount=0\nif len(w)==len(set(w)):\n for i in r... | ['Wrong Answer', 'Accepted'] | ['s242573666', 's615682854'] | [3060.0, 3060.0] | [17.0, 17.0] | [210, 275] |
p03261 | u869265610 | 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=[]\nss=True\nfor i in range (N):\n W.append(input())\n\n\nfor t in range (N):\n if W[t-1][-1]==W[t][0]:\n ss=True\n else:\n ss=False \nif len(W)!=N: \n ss=False\n \nif ss==False:\n print("No")\nelse:\n print("Yes")\n', "N=int(input())\nH=input()\nword=[]\nfor i in range(N... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s062733232', 's928964905', 's807506520'] | [3060.0, 9004.0, 9136.0] | [17.0, 26.0, 27.0] | [243, 221, 236] |
p03261 | u872887731 | 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().split())\na = []\nflag = 1\nfor i in range(N):\n a.append(str(input().split()))\n if i != 0:\n for j in range(i):\n if a[i] == a[j]:\n flag =0\n\n\nback = a[0][-1]\nfor i in range(1,N):\n front = a[i][0]\n if front != back:\n flag = 0\n break\... | ['Runtime Error', 'Accepted'] | ['s141185704', 's915223397'] | [3064.0, 3064.0] | [17.0, 18.0] | [376, 360] |
p03261 | u874741582 | 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=[]\nS = 0\nfor i in range(0,n):\n B.append((input()))\nfor m in range(n-1):\n if B[m][-1] == B[m+1][0]:\n S += 1\nif S == n-1:\n print("Yes")\nelse:\n print("No")', 'n=int(input())\nB=[]\nS = 0\nfor i in range(0,n):\n B.append((input()))\nC = set(B)\nif len(B) != len(C):\n p... | ['Wrong Answer', 'Accepted'] | ['s970641255', 's372014302'] | [3060.0, 3060.0] | [17.0, 17.0] | [188, 271] |
p03261 | u879674287 | 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 = input()\n before = ''\n words = set()\n\n for i in range(n):\n w = input()\n if w not in words:\n words.add(w)\n else:\n print('No')\n return\n\n if before == '':\n before = w\n continue\n\n if befo... | ['Runtime Error', 'Accepted'] | ['s888349400', 's494917485'] | [3056.0, 3060.0] | [17.0, 17.0] | [387, 411] |
p03261 | u879870653 | 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())\ncounter = 0\nqq = 0\nL = []\nfor i in range(N) :\n if i == 0 :\n w = input()\n L.append(w)\n q = w[-1]\n if i != 0 :\n w = input()\n if w in L :\n qq += 1\n p = w[0]\n if p == q :\n q = w[-1]\n counter += 1\n\n ... | ['Wrong Answer', 'Accepted'] | ['s728522503', 's123477599'] | [3060.0, 3064.0] | [17.0, 18.0] | [397, 417] |
p03261 | u883203948 | 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... | ['#data input\nn = int(input())\ni = 0\nstr = [0] * n \nwhile i < n: \n str[i] = input()\n i += 1\n \n\n\ni = 0\ncount = 0\nx = ""\nwhile i < n-1:\n if str[i][-1] == str[i+1][0]:\n i += 1\n else:\n print("no")\n count = 1\n break\ni = 0\nwhile i < n:\n x = str.count(str[i... | ['Wrong Answer', 'Accepted'] | ['s308322779', 's497526379'] | [3064.0, 3064.0] | [18.0, 17.0] | [436, 436] |
p03261 | u890807039 | 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,temp = int(input()),[],[]\nfor i in range(n):\n w.append(input())\n print(w[-1])\n if w[-1] in temp:\n print("No")\n exit()\n else:\n temp.append(w[-1])\n if i > 1 and w[i-1][0] != w[i][-1]:\n print("No")\n exit()\nprint("Yes")', 'n,w,temp = int(input()),[],[]\nfo... | ['Wrong Answer', 'Accepted'] | ['s672796958', 's812185352'] | [3064.0, 3060.0] | [17.0, 18.0] | [269, 250] |
p03261 | u896791216 | 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)]\nres = True\nfor i in range(1,n):\n print(w[i-1][-1])\n print(w[i][0])\n print(w[i][0] == w[i-1][-1])\n if w[i][0] != w[i-1][-1]:\n res = False\n else:\n continue\nif res == True and len(w) == len(set(w)):\n print("Yes")\nelse:\n pri... | ['Wrong Answer', 'Accepted'] | ['s862485876', 's320708880'] | [3064.0, 3060.0] | [17.0, 17.0] | [312, 238] |
p03261 | u897436032 | 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... | ['w = input().split(\'\\n\')\nvalid = False\nfor i in range(1,len(w))\n if w[i][-1] == w[i+1][0] and len(set(w)) == len(w) \n vaild = True\n else: \n vaild = False\n\nprint("Yes" if vaild else "NO")\n', "# coding: utf-8\ndef is_unique(seq):\n return len(seq) == len(set(seq))\n \n \ndef main():\n n = i... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s193981690', 's314038565', 's516400344', 's586170351', 's763116012', 's969663499', 's454145403'] | [2940.0, 2940.0, 2940.0, 3064.0, 2940.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 18.0] | [198, 359, 201, 455, 358, 212, 411] |
p03261 | u898917044 | 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... | ['# abc109_b\n\nfrom collections import Counter\n\n\ndef solve(words):\n commons = Counter(words).most_common()\n if commons[0][1] > 1:\n return "No"\n else:\n # initial letter first word not important\n first_letters = list(map(lambda x: x[0], words[1:]))\n # final letter final wor... | ['Wrong Answer', 'Accepted'] | ['s879339030', 's761969184'] | [3316.0, 3316.0] | [21.0, 21.0] | [593, 763] |
p03261 | u902462889 | 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())\n\nlst_W = []\nfor i in range(N):\n lst_W.extend(input().split())\n\nans = "Yes"\n\nfor i in range(N - 1):\n if (lst_W[i])[-1:] != (lst_W[i+1])[:1]:\n ans = "No"\n break\n\nif len(lst_W) != len(set(lst_W)):\n \n\nprint(ans)', '\nN = int(input())\n\nlst_W = []\nfor i in range(... | ['Runtime Error', 'Accepted'] | ['s516448578', 's258092016'] | [2940.0, 3064.0] | [17.0, 17.0] | [259, 258] |
p03261 | u911153222 | 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 shiritori():\n n = int(input())\n words = [input() for _ in range(n)]\n print(words)\n for word in words:\n count = 0\n for w in words:\n if w == word:\n count += 1\n if count > 1:\n print('No')\n exit()\n \n for i in range(n):... | ['Wrong Answer', 'Accepted'] | ['s061339019', 's490670701'] | [3064.0, 3064.0] | [17.0, 18.0] | [576, 560] |
p03261 | u914116178 | 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: utf8\n\nif __name__ == "__main__":\n n = int(input())\n w = []\n flag = True\n for _ in range(n):\n a = input()\n last = w[len(w)-1]\n if a[0] != last[len(last)-1] and a in w:\n flag = False\n print("No")\n break\n w.append(a)\n if ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s052452099', 's415128468', 's682143255', 's926525118', 's759193614'] | [3064.0, 3060.0, 3064.0, 3064.0, 3064.0] | [19.0, 18.0, 18.0, 18.0, 18.0] | [340, 261, 384, 385, 414] |
p03261 | u914330401 | 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 = ""\nis_cor = True\nfor i in range(N):\n w_list[i] = input()\na = w_list[0]\nfor i in range(1, N-1):\n b = w_list\n b[i] = 0\n if a[len(a)-1] != w_list[i][0] or w_list[i] in b:\n print("No")\n is_cor = False\n break\nif is_cor:\n print("Yes")', 'N = int(input())\nw_list = [""]*... | ['Runtime Error', 'Accepted'] | ['s140654335', 's510665506'] | [3064.0, 3064.0] | [17.0, 17.0] | [268, 281] |
p03261 | u918859246 | 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 = []\nfor i in range(N):\n w = str(input())\n if w not in word_list:\n word_list.append(w)\n elif w in word_list:\n print('No')\n break\n \n if i == 0:\n continue\n else:\n if w[0] == word_list[i-1][-1]:\n print('Yes')\n ... | ['Wrong Answer', 'Accepted'] | ['s203176186', 's129581719'] | [3060.0, 3060.0] | [18.0, 18.0] | [356, 433] |
p03261 | u919127329 | 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... | ['word_num = int(input())\n\nword_list=[]\nfor i in range(word_num):\n word_list.append(str(input()))\n\n# print(word_list)\ntemp = 0\nfor item in word_list:\n initial_word = item[0]\n last_word = item[-1]\n if(temp != initial_word and temp != 0):\n print("No")\n exit()\n temp = last_word\n # print("Ok"... | ['Wrong Answer', 'Accepted'] | ['s170163823', 's823307490'] | [2940.0, 3064.0] | [17.0, 18.0] | [318, 446] |
p03261 | u919730120 | 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... | [" w=[input() for _ in range(n)]\n chk=[]\n chk.append(w[0])\n ans='Yes'\n for i in range(1,n):\n if w[i-1][-1]!=w[i][0] or (w[i] in chk):\n ans='No'\n break\n chk.append(w[i])\n print(ans)\n\nif __name__ == '__main__':\n resolve()", "def resolve():\n n=int(in... | ['Runtime Error', 'Accepted'] | ['s613020595', 's487524471'] | [2940.0, 3064.0] | [17.0, 18.0] | [274, 308] |
p03261 | u921615009 | 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... | ['args = input().split("\\n")\ncount = args[0]\nwords = [word for word in args[1:]]\nresult = "Yes"\nif len(words) == len(list(set(words))):\n for i in range(len(words)-1):\n if words[i][-1] != words[i+1][0]:\n \tresult = "No"\nelse:\n result = "No"\nprint(result)\n\n\n', 'args = input().split("\\n")\ncount = a... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s621377024', 's987259549', 's502710629'] | [3060.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0] | [261, 254, 217] |
p03261 | u928758473 | 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 os\nimport sys\nfrom collections import defaultdict, Counter, deque\nfrom itertools import product, permutations,combinations, accumulate\nfrom operator import itemgetter\nfrom bisect import bisect_left,bisect\nfrom heapq import heappop,heappush,heapify\nfrom math import ceil, floor, sqrt\nfrom copy import dee... | ['Wrong Answer', 'Accepted'] | ['s932904472', 's752177365'] | [9488.0, 9476.0] | [35.0, 32.0] | [752, 747] |
p03261 | u928784113 | 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())\na = [input() for i in range(N)]\nfor i in range(N):\n if a[i][len(a[i])]==a[i+1][0]:\n continue\n else:\n break\n print("No")\nprint("Yes")', '# -*- coding: utf-8 -*-\nN = int(input())\na = [input() for i in range(N)]\nfor i in range(N):\n if a[i][len(a[i])]=a[i+... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s339352782', 's921618064', 's937369526'] | [2940.0, 2940.0, 3064.0] | [18.0, 18.0, 18.0] | [184, 188, 303] |
p03261 | u931118906 | 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=[]\nws=[]\ncount=1\nfor i in range(n):\n w.append(input())\n ws.append(list(w[i]))\nfor i in range(n):\n if (w.count(w[i]))>1:\n count-=1\nfor j in range(n-1):\n if (ws[j][len(w[j])-1])==(ws[j+1][0]):\n count+=1\nif count==(n):\n print('Yes')\nelse:\n print('N0')", "n... | ['Wrong Answer', 'Accepted'] | ['s688692370', 's978434365'] | [3064.0, 3064.0] | [18.0, 18.0] | [297, 300] |
p03261 | u934788990 | 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\nn = int(input())\nk = []\nresult=[]\nfor i in range(n):\n a = input()\n k.append(a)\nans = collections.Counter(k)\nfor i in range(1,n):\n if k[i-1][-1] == k[i][0] and ans.most_common()[0][1] == 1:\n result.append("1")\n else:\n result.append("0")\nprint(result)\naim = col... | ['Wrong Answer', 'Accepted'] | ['s386061315', 's546913493'] | [3316.0, 3444.0] | [22.0, 22.0] | [466, 422] |
p03261 | u935254309 | 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 = {}\nlast=""\nflg = True\n\nw =[]\n\nfor i in range(N):\n w.append(str(input()))\n \n \nfor i in w:\n temp = i\n \n if temp in W:\n flg = False\n break\n else:\n W[temp] = 1\n \n if i !=0:\n if temp[0] == last:\n last = temp[-... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s146112095', 's748826826', 's531838316'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0] | [497, 443, 460] |
p03261 | u937529125 | 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 = []\nflag = 1\nbefore = ""\nfor i in range(n):\n a1 = input()\n\n if i == 0:\n before = a1[len(a1)-1]\n continue\n if before != a1[0]:\n flag = 0\n before = a1[len(a1)-1]\nif flag==0:\n print("No")\nelse:\n print("Yes")', 'n = int(input())\na = []\nflag = 1\... | ['Wrong Answer', 'Accepted'] | ['s976000346', 's655483764'] | [3060.0, 3064.0] | [19.0, 17.0] | [263, 375] |
p03261 | u940102677 | 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 = []\nFlag = Trure \nfor i in range(n):\n w.append(input())\nfor i in range(n-1):\n if w[i][-1] != w[i+1][0]:\n Flag = False\nif len(w) = len(set(w)):\n Flag = False\nprint("Yes" if Flag else "No")', 'n = int(input())\nw = []\nFlag = True \nfor i in range(n):\n w.append(input())\nfor i in range(... | ['Runtime Error', 'Accepted'] | ['s906049097', 's124630664'] | [2940.0, 3064.0] | [17.0, 17.0] | [208, 213] |
p03261 | u940279019 | 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().rsprit() for i in range(n)]\nuse = [w[0]]\nfor i in range(1,n):\n if w[i][0] == w[i-1][-1] and w[i] not in use:\n use.append(w[i])\n else:\n print('No')\n exit()\nprint('Yes')", "n = int(input())\nw = [input().rstrip() for i in range(n)]\nuse = [w[0]]\nfor i in range(1,n):\n ... | ['Runtime Error', 'Accepted'] | ['s257628750', 's294788929'] | [3060.0, 3060.0] | [18.0, 18.0] | [208, 208] |
p03261 | u940332739 | 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 = []\nfor i in range(N):\n S.append(input())\n\n\n\nwww = "YYY"\nfor i in range(N-2):\n\n if S[i][-1] != S[i+1][0]:\n www = "fuck"\n\n\nqqq = "ZZZ"\nS.sort()\nfor i in range(N-2):\n if S[i] == S[i+1]:\n qqq = "bich"\n\nif www == "YYY" and qqq == "ZZZ":\n print("Yes")\nels... | ['Wrong Answer', 'Accepted'] | ['s128735489', 's598368964'] | [3060.0, 3060.0] | [18.0, 18.0] | [315, 313] |
p03261 | u945418216 | 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())\nww=[input() for i in range(n)]\n\nif len(set(ww))==n:\n print('No')\nelse:\n for i in range(1,n):\n if ww[i-1][-1] != ww[i][0]:\n print('No')\n break\n else:\n print('Yes')", "n = int(input())\n\nww = [input() for _ in range(n)]\n# print(ww)\n\nfor i,w in e... | ['Wrong Answer', 'Accepted'] | ['s929474437', 's741350270'] | [3064.0, 3060.0] | [19.0, 18.0] | [222, 219] |
p03261 | u945761460 | 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=[]\nx=str(input())\na[0]=x\nd=bool(True)\nfor i in range(1, n):\n y=str(input)\n if x[len(x)]!=y[0]:\n d=False\n for i in range(a.size()):\n if y==a[i]:\n d=False\n a.append(y)\n\nif d:\n print("Yes")\nelse:\n print("No")', 'n=int(input())\na=[]\nx=str(input())\na.append(x)\nd=bool... | ['Runtime Error', 'Accepted'] | ['s302953466', 's672975834'] | [9192.0, 9196.0] | [26.0, 33.0] | [240, 265] |
p03261 | u949406263 | 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... | ['count = input()\ninputed = []\nlast = ""\njudge = "Yes"\nfor i in range(int(count)):\n new_inputed = input()\n if i != 0 and (new_inputed[0] != last or new_inputed in inputed):\n judge = "No"\n print(last, new_inputed[-1], new_inputed in inputed)\n last = new_inputed[-1]\n inputed.append(new... | ['Wrong Answer', 'Accepted'] | ['s253143665', 's678670547'] | [3060.0, 3060.0] | [17.0, 17.0] | [330, 269] |
p03261 | u951480280 | 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 _ in range(n)]\nans=0\nfor i in range(n-1):\n if S[i][-1] != S[i+1][0]:\n ans = 1\n break\nprint("Yes" if ans == 0 else "No")', 'n=int(input())\nS=[input() for _ in range(n)]\nans=1\nfor i in range(n-1):\n if S[i][-1] == S[i+1][0]:\n ans += 1\nprint("Yes" if a... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s151102730', 's936505908', 's086835710'] | [2940.0, 3060.0, 3060.0] | [17.0, 18.0, 18.0] | [166, 153, 179] |
p03261 | u952588409 | 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())\nlast = input()\nwds = set([last])\nfor i in range(N-1):\n wd = input()\n if wd in wds or last[-1]!=wd[0]: \n print('No')\n break\n last = wd\n wds.add(wd)\nprint('Yes')", "N=int(input())\nlast = input()\nwds = set([last])\nfor i in range(N-1):\n print(i)\n wd = input()\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s374585020', 's583657453', 's772648836'] | [3060.0, 3060.0, 3060.0] | [17.0, 18.0, 17.0] | [200, 213, 209] |
p03261 | u964494353 | 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())\nwords = input().split()\nfor i in range(n-1)\n for j in range(1, i):\n if words[i] == words[j]:\n print('No')\n sys.exit()\n if words[i][-1] != words[i+1][1]:\n print('No')\n sys.exit()\nprint('Yes')", "import sys\nn = int(input())... | ['Runtime Error', 'Accepted'] | ['s686054858', 's904687217'] | [2940.0, 3060.0] | [17.0, 18.0] | [275, 252] |
p03261 | u970107703 | 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 = False\ndic = []\n\nword = input()\ndic.append(word)\n\nfor i in range(N-1):\n word = input()\n if(word not in dic and word[0] == dic[-1][-1]):\n dic.append(word)\n else:\n flag = True\n break\nif(flag == True):\n print('NO')\nelse:\n print('YES')", "N = int... | ['Wrong Answer', 'Accepted'] | ['s228699911', 's520496601'] | [3064.0, 3064.0] | [17.0, 18.0] | [290, 290] |
p03261 | u970899068 | 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)] \ncount=0\nif len(set(w))<len(w):\n print('No')\nelse:\n for i in range(n-1):\n if w[i][-1]==w[i+1][0]:\n count+=1\n if count==n-1:\n print('Yes')\n else:\n print('No')\nprint(count)", "n=int(input())\nw=[input() for i in ran... | ['Wrong Answer', 'Accepted'] | ['s761118591', 's941579604'] | [3064.0, 3060.0] | [17.0, 17.0] | [262, 249] |
p03261 | u972658925 | 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())\nlst = [iuput() for _ in range(n-1)]\nlstset = set(lst)\nif len(lst) != len(lstset):\n print("No")\nelse:\n cnt = 0\n for i in range(n-1):\n if lst[i][-1] == lst[i][0]:\n cnt += 1\n else:\n break\n if cnt == len(lst):\n print(\'Yes\')\n else:\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s730910129', 's927731923', 's801799034'] | [3060.0, 3064.0, 3060.0] | [18.0, 17.0, 18.0] | [326, 308, 328] |
p03261 | u973840923 | 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\nword_stock = []\n\nfor word in W:\n \n if word in word_stock:\n print('No')\n \n try:\n if word_stock[-1][-1] != word[0]:\n print('No')\n except:\n pass\n word_stock.append(word)\n\nprint('Yes')", "for word in word_... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s293283909', 's310962288', 's496059158', 's565822615', 's239994622'] | [3060.0, 2940.0, 3060.0, 3060.0, 3064.0] | [19.0, 19.0, 18.0, 19.0, 17.0] | [324, 265, 332, 315, 455] |
p03261 | u982473248 | 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 si():\n\n n = int(input()) \n tk = [input() for i in range(n)]\n tu = len(set(tk))\n l =[]\n k = []\n\n \n \n oo = 0\n\n\n while oo < tu:\n t = tk[oo]\n l.append(t[0])\n k.append(t[-1])\n oo += 1\n \n oo = 0\n\n\n while oo < tu-1:\n if k[... | ['Wrong Answer', 'Accepted'] | ['s333790785', 's976817103'] | [3064.0, 3064.0] | [18.0, 17.0] | [517, 473] |
p03261 | u985041094 | 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 check_words(w):\n if len(w) != len(set(w)):\n return False\n for i in range(n-1):\n if w[i][-1] != w[i+1][0]:\n return False\n return True\n\nn = int(input())\nw = list(map(str, input().split()))\nret = 'Yes' if check_words(w) else 'No'\nprint(ret)", "n = int(input())\nw = list(m... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s344448258', 's495212273', 's519685521', 's812703475', 's893890150', 's050411432'] | [3060.0, 3060.0, 3060.0, 3060.0, 3060.0, 3060.0] | [17.0, 17.0, 18.0, 17.0, 18.0, 18.0] | [275, 227, 291, 197, 275, 197] |
p03261 | u985963315 | 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())\nresult = "Yes"\nw = list(input())\nfor i in range(n - 1):\n s = input()\n if s in w:\n result = "No"\n elif s[0] != w[-1][-1]:\n result = "No"\n else:\n w.append(s)\nprint(result)', 'n = int(input())\nresult = "Yes"\nw = list(input())\nfor i in range(n - 1):\n s = input()\n if s in w:... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s684360025', 's975831633', 's650198973'] | [3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0] | [199, 219, 232] |
p03261 | u987164499 | 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 stdin\nimport fractions\n\nn = int(stdin.readline().rstrip())\n\nli = [stdin.readline().rstrip() for _ in range(n)]\nk = len(li)\nlin = list(set(li))\n\nif len(li) != k:\n print("No")\n exit()\n\nfor i in range(len(li)-1):\n if li[i][-1] != li[i+1][0]:\n print("No")\n exit()\npr... | ['Wrong Answer', 'Accepted'] | ['s271551083', 's459938162'] | [5052.0, 5308.0] | [36.0, 38.0] | [312, 313] |
p03261 | u989157442 | 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... | ["# Shiritori\nn = int(input())\nli = []\nfor i in range(n):\n li.append(list(input()))\nfor j in range(n):\n if li[j][-1] != li[j+1][0]:\n print('No1')\n exit()\n for k in range(j):\n if li[j] == li[k]:\n print('No2')\n exit()\nprint('Yes')\n", "# Shiritori\nn = int(... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s699993926', 's705723745', 's586864027'] | [3060.0, 3064.0, 3060.0] | [18.0, 18.0, 18.0] | [279, 281, 324] |
p03261 | u993435350 | 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 w in range(N)]\n\nfor i in range(1,len(W)):\n if (W[i-1][-1] != W[i][0]) or (W[i] in W[:i] == True):\n print("No")\n break\nelse:print("Yes")', 'N = int(input())\n\nW = [input() for w in range(N)]\n\nfor i in range(1,len(W)):\n if (W[i-1][-1] != W[i][0]) or (W[i] in W[:i])... | ['Wrong Answer', 'Accepted'] | ['s256040025', 's066634827'] | [3060.0, 3064.0] | [18.0, 17.0] | [177, 169] |
p03261 | u999503965 | 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 i in range(n)]\n\nif l.most_common()[0][1] != 1:\n ans="No"\nelse:\n l_head = [i[0] for i in l]\n l_tail = [i[-1] for i in l]\n if l_head == l_tail:\n ans="Yes"\n else:\n ans="No"\n \nprint(ans)\n ', 'from collections import Counter\n\nn=int(input())\nl=[input() for i in ... | ['Runtime Error', 'Accepted'] | ['s022039351', 's210863185'] | [9156.0, 9268.0] | [25.0, 29.0] | [229, 297] |
p03262 | u003501233 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['def gcd(a,b):\n while b:\n a,b = b, a % b\n return a\n\nN,X=map(int,input().split())\nx=list(map(int,input().split()))\n\nans = x[0] - X\n\nfor i in range(1,N):\n ans = gcd(ans, x[i] - X)\n\nprint(abs(ans))', 'def gcd(a,b):\n while b:\n a,b = b, a % b\n return a\n\nN,X=map(int,input().split())\nx=list(ma... | ['Wrong Answer', 'Accepted'] | ['s120165682', 's525450492'] | [14252.0, 14252.0] | [75.0, 82.0] | [201, 199] |
p03262 | u013408661 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['n,x=map(int,input().split())\nX=list(map(int,input().split()))\nfor i in X:\n i=abs(i-x)\ndef gcd(x,y):\n if y==0:\n return x\n else:\n return(y,x%y)\nstack=X[0]\nfor i in range(n-1):\n stack=gcd(stack,X[i+1])\nprint(stack)', 'n,x=map(int,input().split())\nX=list(map(int,input().split()))\nfor i in range(n)... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s140139088', 's982387910', 's471607402'] | [14252.0, 15020.0, 15020.0] | [54.0, 66.0, 110.0] | [221, 234, 238] |
p03262 | u013629972 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools\n\n\nsys.setrecursionlimit(10**7)\ninf = 10 ** 20\neps = 1.0 / 10**10\nmod = 10**9+7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -... | ['Runtime Error', 'Accepted'] | ['s604270272', 's405625312'] | [3064.0, 16636.0] | [18.0, 359.0] | [872, 1095] |
p03262 | u017063101 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['def A(a,b):\n if a<b:\n tmp = a\n a = b\n b = tmp\n r = a % b\n while r!=0:\n a = b\n b = r\n r = a % b\n return b\nn,X=map(int,input().split())\nx=list(map(int,input().split()))\nx.append(X)\nx.sort()\nx2=[]\nfor i in range(1,n+1):\n x2.append(x[i]-x[i-1])\nprint(x2... | ['Wrong Answer', 'Accepted'] | ['s613814506', 's241846603'] | [19852.0, 20020.0] | [121.0, 118.0] | [460, 450] |
p03262 | u023077142 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['def gcd(a, b):\n if b == 0:\n return a\n else:\n return gcd(b, a%b)\n\nN, X = [int(n) for n in input().split()]\nxs = [int(n) - X for n in input().split()]\n\nif all([n == xs[0] for n in xs]):\n m = min(xs)\n xs = [n - m for n in xs]\n g = gcd(max(xs[0], xs[1]), min(xs[0], xs[1]))\n fo... | ['Runtime Error', 'Accepted'] | ['s212636152', 's547368857'] | [14224.0, 14252.0] | [56.0, 124.0] | [394, 322] |
p03262 | u029022354 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['#coding: utf-8\nimport numpy as np\nimport fraction\nfrom functools import reduce\n\nn,x = list(map(int,input().split()))\n\ny = np.asarray(list(map(int,input().split())))\ny -= x\n\nprint(reduce(fraction.gcd, y))\n\n', '\n#coding: utf-8\nimport numpy as np\nfrom functools import reduce\n\ndef gcd(a, b):\n while b... | ['Runtime Error', 'Accepted'] | ['s589689122', 's069354326'] | [13668.0, 23112.0] | [152.0, 824.0] | [205, 261] |
p03262 | u037221289 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ["N,X = map(int,input().split(' '))\nL = list(map(int,input().split(' ')))\n\ndef algGCF(a,b):\n if a % b == 0:\n return b\n else:\n return algGCF(b,a%b)\nGCF = abs(X-L[0])\nfor i in range(1,N):\n GCF = algGCF(GCF,X-L[i])\nprint(GCF) ", "N,X = map(int,input().split(' '))\nL = list(map(int,input().split(' ')))... | ['Wrong Answer', 'Accepted'] | ['s204559426', 's963047812'] | [14224.0, 14224.0] | [99.0, 91.0] | [231, 242] |
p03262 | u044952145 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['import math\nfrom functools import reduce\n\nN, X = [int(c) for c in input().split()]\nx = [int(c) for c in input().split()]\n\nif N == 1:\n print(abs(x[0] - X))\nelse:\n x.append(X)\n x.sort()\n print(x)\n x = [n - x[0] for n in x]\n print(x)\n D = reduce(math.gcd, x)\n print(D)', '#import ma... | ['Runtime Error', 'Accepted'] | ['s684677683', 's956994765'] | [14756.0, 14724.0] | [121.0, 114.0] | [289, 325] |
p03262 | u044964932 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['from fractions import gcd\n\n\ndef main():\n n, s = map(int, input().split())\n xs = sorted(list(map(int, input().split())))\n\n for i, x in enumerate(xs):\n if i == 0:\n ans = x-s\n else:\n ans = gcd(ans, x-s)\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n'... | ['Wrong Answer', 'Accepted'] | ['s192155747', 's739885148'] | [21516.0, 20372.0] | [165.0, 92.0] | [300, 354] |
p03262 | u077337864 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['N, X = map(int, input().strip().split())\nxs = list(map(int, input().strip().split()))\n\nfor i in range(len(xs)):\n xs[i] = abs(xs[i] - X)\n\nisis = False\nif N == 1:\n print(xs[0] - X)\n isis = True\n\nmax_dis = max(abs(xs[i] - xs[i+1]) for i in range(len(xs) - 1))\nmin_dis = min(abs(xs[i] - xs[i+1]) for i in ra... | ['Runtime Error', 'Accepted'] | ['s552901534', 's917750414'] | [14100.0, 14252.0] | [99.0, 129.0] | [459, 253] |
p03262 | u092278825 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['N, X = map(int, input().split())\ncities = [int(i) for i in input().split()]\ncities.sort()\ndist = [int(abs(i-X)) for i in cities]\ndist.sort()\nprint(dist)\n \nif N==1:\n print(max(dist))\nelse:\n while len(dist)>0:\n m = min(dist)\n dist = [int(i%m) for i in dist]\n dist.sort()\n ... | ['Wrong Answer', 'Accepted'] | ['s147810270', 's716207997'] | [16268.0, 14864.0] | [1648.0, 1652.0] | [461, 449] |
p03262 | u102126195 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['import fraction\nN, X = map(int, input().split())\nx = list(map(int, input().split()))\nx.sort()\nif N > 1:\n mini = x[1] - x[0]\n if mini > abs(X - x[0]) and abs(X - x[0]) != 0:\n mini = abs(X - x[0])\nelif N == 1:\n mini = abs(x[0] - X)\nfor i in range(1, N):\n if mini > x[i] - x[i - 1]:\n ... | ['Runtime Error', 'Accepted'] | ['s289596601', 's152730701'] | [3064.0, 16240.0] | [17.0, 176.0] | [629, 632] |
p03262 | u102242691 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['\nn,x = map(int,input().split())\nx = list(map(int,input().split()))\nl = [abs(i-x) for i in x]\n\n\ndef gcd(x,y):\n if y == 0:\n return x\n else:\n return gcd(y,x%y)\n\nans = l[0]\nfor i in range(1,n):\n ans = gcd(l[i],ans)\nprint(ans)', '\nn,x = map(int,input().split())\nx = list(map(int,inpu... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s063071061', 's992919209', 's563047989'] | [14224.0, 14252.0, 14224.0] | [42.0, 42.0, 90.0] | [272, 270, 251] |
p03262 | u102902647 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ["N, X = map(int, input().split())\nx_lst = [int(i) for i in input().split()]\n# N, X = map(int, '3 81'.split())\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\nres = [x_list[0]]\nfor i in range(1, N):\n res.append(gcd(res[i-1], x_list[i]))\nprint(min(res))", "N, X = map(int, input().split())... | ['Runtime Error', 'Accepted'] | ['s795607997', 's114943986'] | [14252.0, 14252.0] | [46.0, 98.0] | [328, 338] |
p03262 | u107091170 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['N,X=map(int,input().split())\nx = list(map(int,input().split()))\nif not X in x:\n x.append(X)\nx.sort()\nd = []\nfor i in range(len(x)-1):\n d.append( x[i+1] - x[i] )\n\ndef GCD(a,b):\n if a%b==0: return b\n return GCD(b,a%b)\n\ng = d[0]\nlcm = d[0]\nfor i in range( len(d)-1 ):\n lcm = g * d[i+1] // G... | ['Wrong Answer', 'Accepted'] | ['s828605046', 's517101894'] | [14252.0, 14252.0] | [188.0, 150.0] | [327, 297] |
p03262 | u116038906 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['\nimport math\nfrom functools import reduce\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\n\nimport sys\n\nN,X = map(int, input().split())\nx = list(map(int, input().split()))\n\n\nx_div =[abs(X-x[0])] \nfor i in range(N):\n x_div.appe... | ['Runtime Error', 'Accepted'] | ['s512400919', 's438308122'] | [20448.0, 20408.0] | [76.0, 79.0] | [569, 571] |
p03262 | u118642796 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['import fraction\n\nN,X = map(int,input().split())\nx = [int(i) for i in input().split()]\nans = abs(X-x[0])\nnow = X\nfor i in x:\n if abs(now - i) % ans:\n ans = fraction.gcd(ans, abs(now-i))\n now = i\n\nprint(ans)', 'def gcd(a,b):\n while b:\n a, b = b, a % b\n return a\nN,X = map(int,inp... | ['Runtime Error', 'Accepted'] | ['s484835905', 's211878352'] | [3060.0, 14252.0] | [17.0, 87.0] | [218, 225] |
p03262 | u123745130 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['import fractions\nfrom functools import reduce\n\nn,x = map(int,input().split())\nlst=list(map(int,input().split()))\nnew_lst=[abs(i-x) for i in lst]\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\nprint(gcd(*new_lst))\n', 'n,x = map(int,input()... | ['Runtime Error', 'Accepted'] | ['s274182519', 's229262011'] | [16304.0, 15020.0] | [74.0, 88.0] | [280, 257] |
p03262 | u134387396 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['import math\nimport sys\n\nn, x = list(map(lambda x : int(x),input().split()))\n\nzahyo = list(map(lambda x : int(x),input().split()))\n\nzahyo.append(x)\nzahyo.sort()\n\nmin = zahyo[1] - zahyo[0]\n\nis_odd = False\nis_even = False\n\nodds = list()\n\nfor i in range(n):\n diff = zahyo[i+1] - zahyo[i]\n\n if dif... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s054654870', 's219029814', 's892508787', 's965320866', 's525506872'] | [3064.0, 16296.0, 3672.0, 3668.0, 16296.0] | [17.0, 158.0, 23.0, 23.0, 159.0] | [745, 709, 707, 687, 724] |
p03262 | u135197221 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['def mapt(fn, *args):\n return list(map(fn, *args))\n\n\ndef Input():\n return mapt(int, input().split(" "))\n\ndef main():\n N, X = Input()\n if N == 1:\n print(abs(N-X))\n exit()\n \n x = Input()\n x.append(X)\n x.sort()\n data = [abs(x[i] - x[i+1]) for i in range(N)]\n\n... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s609527449', 's646350271', 's961721764', 's471323630'] | [19976.0, 19932.0, 19976.0, 20388.0] | [80.0, 79.0, 62.0, 102.0] | [400, 398, 311, 501] |
p03262 | u141786930 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['# C - Skip\n\nimport numpy as np\nimport fractions\n\nN, X = map(int, input().split())\nx = list(int(x) for x in input().split())\nx.append(X)\nx.sort()\nx = np.array(x)\nx = x - x[0]\n\nans = 10**18\nif N == 1:\n print(x[1] - x[0])\nelse:\n for i in range(N-1):\n ans = min(ans, fractions.gcd(x[i], x[i+1... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s090083833', 's463963973', 's158156459'] | [25008.0, 24908.0, 14252.0] | [433.0, 495.0, 204.0] | [319, 327, 336] |
p03262 | u163320134 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['def gcd(a,b):\n if b==0:\n return a\n else:\n return gcd(b,a%b)\n \nn,x=map(int,input().split())\narr=list(map(int,input().split()))\narr.append(x)\narr=sorted(arr)\narr2=[]\nfor i in range(n-1):\n arr2.append(arr[i+1]-arr[0])\nif n==1:\n print(abs(arr[0]-x))\nelse:\n ans=gcd(arr2[0],arr2[1])\n for i in ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s309540864', 's773815344', 's728779604'] | [14224.0, 3064.0, 14252.0] | [151.0, 17.0, 148.0] | [350, 342, 342] |
p03262 | u165133750 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['from functools import reduce\nfrom math import gcd\n\nn, x = map(int, input().split())\na = [abs(int(A) - x) for A in input().split()]\na.sort()\nprint(a)\nprint(reduce(gcd, a))\n', 'from functools import reduce\nfrom math import gcd\n\nn, x = map(int, input().split())\na = [abs(int(A) - x) for A in input().split()]\... | ['Wrong Answer', 'Accepted'] | ['s702583232', 's102311047'] | [20612.0, 20632.0] | [105.0, 77.0] | [171, 162] |
p03262 | u172035535 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['N,A = map(int,input().split())\nX = sorted(map(int,input().split()))\nY = []\nfor x in X:\n Y.append(abs(A-x))\nans = Y[0]%Y[1]\nfor y in Y:\n for i in range(y-1,0,-1):\n if y%i == 0:\n ans = max(ans,i)\n break\nprint(ans)', 'N,S = map(int,input().split())\nX = list(map(int,input().... | ['Runtime Error', 'Accepted'] | ['s408762655', 's375298899'] | [15020.0, 14252.0] | [2104.0, 128.0] | [246, 258] |
p03262 | u177040005 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['def gcd(a,b):\n if b == 0:\n return abs(a)\n else:\n return gcd(b, a%b)\n\n\nN,St = map(int, input().split())\nX = list(map(int,input().split()))\n\nif not(St in X):\n X.append(St)\nX = sorted(X)\n\ndel_X = []\nfor i in range(len(X)-1):\n del_X.append(X[i+1] - X[i])\ndel_X = sorted(list(set(... | ['Runtime Error', 'Accepted'] | ['s428143895', 's727785931'] | [14252.0, 14252.0] | [111.0, 126.0] | [472, 437] |
p03262 | u189188797 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['import fractions\nn,m=map(int,input().split())\ntosi = list(map(int,input().split()))\nfor i in range(n):\n tosi[i]=abs(m-tosi[i])\nanswer=min(tosi)\nprint(tosi)\nwhile max(tosi)!=0:\n for i in range(n):\n if tosi[i]%answer==0:\n tosi[i]=0\n else:\n answer=fractions.gcd(answe... | ['Wrong Answer', 'Accepted'] | ['s543035035', 's278781752'] | [16280.0, 16280.0] | [136.0, 123.0] | [330, 318] |
p03262 | u192541825 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['def gcd(a,b):\n if b==0:\n return a\n else:\n gcd(b,a%b)\n\n\nn,x=map(int,input().split())\n\nif n==1:\n a=int(input())\n print(abs(a-x))\n exit()\nelse:\n str=input()\n lst=str.split(" ")\n a=int(lst[0])\n b=int(lst[1])\n maxim=gcd(abs(a-x),abs(b-x))\n for i in range(2,... | ['Runtime Error', 'Accepted'] | ['s422954692', 's258712313'] | [11096.0, 11096.0] | [26.0, 103.0] | [372, 379] |
p03262 | u212952060 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['n, x = map(int, input().split())\nc = list(map(int, input().split()))\nc = set([abs(x-c[i]) for i in range(n)])\nl = min(c)\nf = [l]\nif l < 999999999:\n for i in range(1, l):\n if l % i == 0:\n f.append(i)\nfor i in range(len(f), 0, -1):\n d = True\n for item in c:\n if item % f[i-1... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s150441613', 's736337648', 's788071903', 's345734833'] | [17680.0, 17680.0, 17836.0, 17836.0] | [1786.0, 1780.0, 1782.0, 1826.0] | [381, 373, 382, 316] |
p03262 | u219180252 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['from functools import reduce\nN, X = map(int, input().split())\nloc = list(map(int, input().split()))\n\na = min([abs(l-X) for l in loc])\nb = reduce(lambda x, y: abs(x-y), sorted(loc)[:2])\nprint(a,b)\nif max([a,b]) % min([a,b]):\n print(abs(min(loc)-X))\nelse:\n print(min([a,b]))', 'from functools import redu... | ['Wrong Answer', 'Accepted'] | ['s508397757', 's106926038'] | [14596.0, 14748.0] | [97.0, 88.0] | [278, 230] |
p03262 | u231095456 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['def gcd(n,m):\n n,m = max(n,m),min(n,m)\n r = n % m\n while r > 0:\n n,m = m,r\n r = n % m\n return m\nN,X = map(int,input().split())\nx = [X - y for y in list(map(int,input().split()))]\nans = x[0]\nfor i in range(1,N):\n ans = gcd(ans, x[i])\nprint(abs(ans))', 'from math import gcd\nN,X... | ['Wrong Answer', 'Accepted'] | ['s583771138', 's522107157'] | [14252.0, 17176.0] | [110.0, 64.0] | [277, 176] |
p03262 | u231936499 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['N,X=map(int,input().split())\nx_list=list(map(int,input().split()))\n\nx_list.append(X)\nx_list_new=sorted(x_list)\nx_list_new_dif=[x_list_new[i+1]-x_list_new[i] for i in range(len(x_list_new)-1)]\n\nmin(x_list_new_dif)', 'def gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return(a)\n\nN,X=map(int,input().split()... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s036177929', 's701389932', 's283502541'] | [15020.0, 14228.0, 14224.0] | [95.0, 43.0, 129.0] | [212, 390, 389] |
p03262 | u239342230 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['N, X = map(int, input().split())\nx_list = list(map(int, input().split()))\n\ndef gcd(l):\n x = max(l)\n y = min(l)\n if x % y == 0:\n return y\n else:\n while x%y!=0:\n z = x%y\n x = y\n y = z\n else:\n return z\n \nif N == 1:\n p... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s270826553', 's561321290', 's665327570'] | [14252.0, 14252.0, 14252.0] | [42.0, 48.0, 180.0] | [406, 471, 236] |
p03262 | u247211039 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['import math\nfrom functools import reduce\nN, X = map(int, input().slpit())\nx = list(map(int,input().split()))\n \nfor i in range(N):\n x[i] = abs(x[i]-X)\n \nx = sorted(x)[::-1]\ncnt = 0\n \nfor i in range(N):\n cnt = math.gcd(cnt, x[i])\n \nprint(cnt)', 'import fractions\nfrom functools import reduce\nN, X =... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s137046905', 's266516778', 's635710666', 's678317295', 's929540492'] | [9288.0, 12084.0, 12048.0, 9428.0, 20324.0] | [32.0, 38.0, 41.0, 27.0, 106.0] | [246, 359, 350, 244, 246] |
p03262 | u255898796 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['def make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n \na = [int(... | ['Wrong Answer', 'Accepted'] | ['s399733443', 's770535415'] | [20444.0, 20340.0] | [605.0, 150.0] | [834, 844] |
p03262 | u259755734 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['N, X = map(int, input().split())\nX = list(map(int, input().split())\n\nmin_dist = abs(X - min(L))\n\nans = 1\n\nfor d in range(min_dist, 0, -1):\n b = all((x - X) % d == 0 for x in L)\n if b:\n print(d)\n break\n', 'N, X = map(int, input().split())\nX = list(map(int, input().split()))\n\nmin_dist... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s570582494', 's971021551', 's841579057'] | [8956.0, 20044.0, 20336.0] | [28.0, 47.0, 68.0] | [221, 222, 255] |
p03262 | u267325300 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['import fraction\n\nN, X = map(int, input().split())\n\nx = list(map(int, input().split()))\n\ndist_list = [abs(X - e) for e in x]\nans = dist_list[0]\nfor e in dist_list:\n ans = fraction.gcd(e, ans)\n\n\nprint(ans)\n', 'def gcd(x, y):\n while y != 0:\n temp = y\n y = x % y\n x = temp\n ... | ['Runtime Error', 'Accepted'] | ['s329573155', 's766179257'] | [2940.0, 14224.0] | [17.0, 86.0] | [207, 282] |
p03262 | u275934251 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ["def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\nN, X = map(int, input().split())\nx = [int(_) for _ in input().split(' ')]\n\ndist = [abs(i - X) for i in x]\n\nans = dist[0]\n\nfor i in range(N):\n ans = gcd(ans, dist[i])\n\nprint(ans)", "N, X = map(int, input().split())\n \narr = [int(_... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s416559248', 's605080369', 's761101199'] | [14252.0, 14224.0, 14252.0] | [79.0, 124.0, 88.0] | [250, 327, 250] |
p03262 | u277236383 | 2,000 | 1,048,576 | There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D. Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like: * Move 1: ... | ['def make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n divisors.sort()\n return divisors\n\ndef make_codivisors(n):\n divisors = []\n n0divisors = make_d... | ['Runtime Error', 'Accepted'] | ['s712011112', 's443952363'] | [15376.0, 14480.0] | [363.0, 335.0] | [768, 807] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.