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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03864 | u375616706 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['N, x = map(int, input().split())\nl = list(map(int, input().split()))\n\nbefore = sum(l)\nl[0] = min(x, l[0])\nfor i in range(1, N):\n s = l[i-1]+l[i]\n if s > x:\n l[i] = x-l[i-1]\n\nprint(l)\nprint(before-sum(l))\n', "from collections import defaultdict\nimport heapq\nfrom math import sqrt\n# -*- codin... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s373644827', 's759022616', 's966450796'] | [14540.0, 3316.0, 14252.0] | [97.0, 21.0, 84.0] | [217, 1268, 208] |
p03864 | u417014669 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['N,x=map(int, input().split())\ns=list(map(int,input().split()))\n\nans=0\nif s[0]>x:\n print(s[0])\n ans=s[0]-x\n s[0]=x\nfor i in range(len(s)-1):\n if s[i]+s[i+1]>x:\n ans+=s[i]+s[i+1]-x\n print(ans)\n s[i+1]=x-s[i]\nprint(ans) \n ', 'N,x = map(int,input().split())\na =... | ['Wrong Answer', 'Accepted'] | ['s293583828', 's040848906'] | [14068.0, 14252.0] | [190.0, 155.0] | [265, 238] |
p03864 | u485137520 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['n, x = map(int, input().split())\nl = list(map(int, input().split()))\ntotal = 0\n\nfor i in range(n - 1):\n if l[i] + l[i + 1] > x:\n max_index = None\n if l[i] > l[i+1]:\n max_index = i\n o = i+1\n else:\n max_index = i+1\n o = i\n l[max_ind... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s185988739', 's983922628', 's652238063'] | [14252.0, 14252.0, 14252.0] | [126.0, 108.0, 109.0] | [342, 274, 272] |
p03864 | u543954314 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['n,k = map(int, input().split())\nl = list(map(int, input().split()))\ntot = 0\nfor i in range(1,n):\n if a[i-1] + a[i] > k:\n c = min(a[i],k-(a[i]+a[i-1]))\n tot += c\n a[i] -= c\n if a[i-1]+a[i] > k:\n d = k-a[i-1]\n tot += d\n a[i-1] -= d\nprint(tot)', 'n,k = map(int, input().split())\na... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s355010699', 's429128011', 's008001234'] | [14052.0, 14540.0, 14132.0] | [48.0, 188.0, 147.0] | [268, 268, 266] |
p03864 | u593063683 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['# ARC 064\ndef getInt(): return int(input())\ndef getIntList(): return [int(x) for x in input().split()]\ndef db(x): \n global debug\n if debug: print(x)\ndebug = False\n\nN,x = getIntList()\na = getIntList()\neatCnt = 0\nhalf = (x+1) // 2 \ndb((N,x,a,half))\nfor i in range(N-1):\n if a[i]+a[i+1]>x: \n ... | ['Wrong Answer', 'Accepted'] | ['s420434553', 's086227858'] | [14064.0, 14132.0] | [257.0, 129.0] | [752, 1627] |
p03864 | u595893956 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['n,x=map(int,input().split())\na=list(map(int,input().split()))\nret=0\nif a[0]>x:\n ret+=a[0]-x\n a[0]-=x\nfor i in range(1:n):\n if a[i]+a[i-1]>x:\n ret+=a[i]+a[i-1]-x\n a[i]=a[i]+a[i-1]-x\nprint(ret)', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\nret=0\nif a[0]>x:\n ret+=a[0]-x\n a[0]... | ['Runtime Error', 'Accepted'] | ['s871259804', 's810602668'] | [2940.0, 14068.0] | [17.0, 119.0] | [200, 208] |
p03864 | u620868411 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['# -*- coding: utf-8 -*-\nline = input().split(" ")\nn = int(line[0])\nx = int(line[1])\na = [int(n) for n in input().split(" ")]\n\nret = max(0,a[0]-x)\na[0] = min(a[0],x)\nfor i in range(1,n):\n if a[i-1]+a[i]>x:\n r = (a[i-1]+a[i])-x\n if a[i]>=r:\n a[i] -= r\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s514613237', 's031562959'] | [14548.0, 14052.0] | [127.0, 110.0] | [384, 276] |
p03864 | u780475861 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['import sys\n\nn, x, *lst = map(int, sys.stdin.read().split())\nre1 = 0\nlst.append(0)\nfor i in range(n, 0, -1):\n tmpsum = lst[i] + lst[i - 1]\n if tmpsum > x:\n res += tmpsum - x\n lst[i - 1] -= tmpsum - x\n\nprint(res)\n', 'import sys\n\nn, x, *lst = map(int, sys.stdin.read().split())\nres = 0\nlst.append(... | ['Runtime Error', 'Accepted'] | ['s869607403', 's045312784'] | [14092.0, 14092.0] | [57.0, 102.0] | [219, 219] |
p03864 | u785205215 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ["from sys import stdin, stdout\nimport numpy as np\ndef readLine_int_list():return list(map(int, stdin.readline().split()))\n\n\n\ndef main():\n n, x = readLine_int_list()\n\n _a = readLine_int_list()\n a = _a.copy()\n \n for i in range(n-1):\n if a[i] + a[i+1] > x:\n \n if ... | ['Wrong Answer', 'Accepted'] | ['s193592172', 's043736742'] | [23068.0, 23104.0] | [224.0, 234.0] | [594, 598] |
p03864 | u813102292 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['n,x = (int(i) for i in input().split())\na = list(int(i) for i in input().split())\ncopy = []\nfor num in a:\n copy.append(num)\n \nfor i in range(n-1):\n if i==0:\n if a[i]>x:\n a[i]=x\n else:\n if a[i]+a[i+1]>x:\n a[i+1] -= x-(a[i]+a[i+1])\n\nprint(sum(copy)-sum(a))\n... | ['Wrong Answer', 'Accepted'] | ['s383831141', 's512384144'] | [14540.0, 14052.0] | [125.0, 108.0] | [303, 275] |
p03864 | u815878613 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['N, x = map(int, input().split())\nA = list(map(int, input().split()))\n\nans = 0\n\nfor i in range(N - 1):\n if A[i] + A[i + 1] > x:\n ans += A[i] + A[i + 1] - x\n if A[i] >= A[i + 1]:\n d = A[i] + A[i + 1] - x\n if d < 0:\n A[i] = 0\n A[i + 1] -= x... | ['Wrong Answer', 'Accepted'] | ['s353336339', 's955840006'] | [14544.0, 14252.0] | [153.0, 121.0] | [557, 318] |
p03864 | u835482198 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['N, x = map(int, input().split())\na = list(map(int, input().split()))\ncnt = 0\nfor i in range(N-1):\n tmp = (a[i] + a[i+1]) - x\n if tmp > 0:\n continue\n cnt += tmp\n a[i] -= tmp - a[i+1]\n a[i+1] = 0\nprint(cnt)\n', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\ncnt =... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s059182861', 's159550238', 's859150841', 's063532986'] | [14252.0, 14060.0, 14052.0, 14132.0] | [103.0, 110.0, 135.0, 127.0] | [227, 193, 348, 306] |
p03865 | u113430839 | 2,000 | 262,144 | There is a string s of length 3 or greater. No two neighboring characters in s are equal. Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first: * Remove one of the characters in s, excluding both ends. However, a character cannot... | ['s=input();l = len;p = print\nif (s[0]==s[-1] * l(s)%2==0) + (s[0]!=s[-1] * l(s)%2==1):\n p("First")\nelse:\n p("Second")\ns=input();l = len;p = print\nif (s[0]==s[-1] * l(s)%2==0) + (s[0]!=s[-1] * l(s)%2==1):\n p("First")\nelse:\n p("Second")\n', 's=input();l = len;p = print\nif (s[0]==s[-1] and l(s)%2==0... | ['Runtime Error', 'Accepted'] | ['s007216014', 's204692319'] | [3316.0, 3316.0] | [24.0, 34.0] | [246, 128] |
p03865 | u375616706 | 2,000 | 262,144 | There is a string s of length 3 or greater. No two neighboring characters in s are equal. Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first: * Remove one of the characters in s, excluding both ends. However, a character cannot... | ['S = input()\nif (S[0] == S[-1]) ^ (len(S) % 2 == 0):\n ans = "First"\nelse:\n ans = "Second"\nprint(ans)\n', 'S = input()\nans = "First"\nif (S[0] == S[-1]) ^ (len(S) % 2 == 0):\n ans = "Second"\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s845549170', 's698938425'] | [3316.0, 3316.0] | [19.0, 17.0] | [106, 96] |
p03865 | u476604182 | 2,000 | 262,144 | There is a string s of length 3 or greater. No two neighboring characters in s are equal. Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first: * Remove one of the characters in s, excluding both ends. However, a character cannot... | ["s = input()\nif (len(s)%2==0)^(s[0]==s[-2]):\n print('Second')\nelse:\n print('First')", "s = input()\nif (len(s)%2==0)^(s[0]==s[-1]):\n print('Second')\nelse:\n print('First')"] | ['Wrong Answer', 'Accepted'] | ['s882347545', 's890460324'] | [3316.0, 3316.0] | [18.0, 17.0] | [84, 84] |
p03865 | u543954314 | 2,000 | 262,144 | There is a string s of length 3 or greater. No two neighboring characters in s are equal. Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first: * Remove one of the characters in s, excluding both ends. However, a character cannot... | ['s = input()\nif (s[0] == s[1])^(len(s)%2 == 1):\n print("First")\nelse:\n print("Second")', 's = input()\nt = ("First","Second")\nprint(t[(len(s)%2==0)^(s[0]==s[-1])])'] | ['Wrong Answer', 'Accepted'] | ['s292272243', 's497038316'] | [3316.0, 3316.0] | [22.0, 18.0] | [87, 72] |
p03865 | u639989198 | 2,000 | 262,144 | There is a string s of length 3 or greater. No two neighboring characters in s are equal. Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first: * Remove one of the characters in s, excluding both ends. However, a character cannot... | ["s = input()\n\nif (s[0] == s[-1]) ^ (len(s) & 1):\n print('Second')\nelse:\n print('First')", "s = input()\n\nif (s[0] == s[-1]) ^ (len(s) & 1):\n print('First')\nelse:\n print('Second')\n"] | ['Wrong Answer', 'Accepted'] | ['s930686802', 's973639881'] | [3316.0, 3316.0] | [24.0, 24.0] | [92, 93] |
p03865 | u835482198 | 2,000 | 262,144 | There is a string s of length 3 or greater. No two neighboring characters in s are equal. Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first: * Remove one of the characters in s, excluding both ends. However, a character cannot... | ['#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\ns = input()\nif len(s) % 2 == 0 ^ s[0] == s[-1]:\n print("Second")\nelse:\n print("First")\n', '#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\ns = input()\nif (len(s) % 2 == 0) == (s[0] == s[-1]):\n print("Second")\nelse:\n print("First")\n', '#!/usr/bin/... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s528270335', 's740419219', 's033313376'] | [3316.0, 3316.0, 3316.0] | [24.0, 26.0, 26.0] | [139, 144, 207] |
p03947 | u107077660 | 2,000 | 262,144 | Two foxes Jiro and Saburo are playing a game called _1D Reversi_. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones... | ['s = input()\nwhile "BB" in s or "WW" in s:\n\ts.replace("BB", "B")\n\ts.replace("WW", "W")\n\nprint(len(s)-1)', 's = input()\nans = -1\nb = ""\nfor l in s:\n\tif b != l:\n\t\tans += 1\n\tb = l\nprint(ans)'] | ['Time Limit Exceeded', 'Accepted'] | ['s813015297', 's858522912'] | [3188.0, 3188.0] | [2102.0, 40.0] | [102, 80] |
p03947 | u118642796 | 2,000 | 262,144 | Two foxes Jiro and Saburo are playing a game called _1D Reversi_. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones... | ['S = input()\nprint(sum([a!=b for a,b in zip(S[:-1],S[1:])])', 'S = input()\nprint(sum([a!=b for a,b in zip(S[:-1],S[1:])]))'] | ['Runtime Error', 'Accepted'] | ['s230596724', 's068040240'] | [2940.0, 4212.0] | [18.0, 28.0] | [58, 59] |
p03947 | u232757112 | 2,000 | 262,144 | Two foxes Jiro and Saburo are playing a game called _1D Reversi_. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones... | ['from sys import stdin\ninput = stdin.readline\nN,T = map(int,input().split())\nprices = list(map(int,input().split()))\nlast = 10000000000\nhighestTally = [prices[-1]]\nfor price in prices[-2:-N-1:-1]:\n highestTally.append(max(highestTally[-1],price))\nhighestTally.reverse()\n\nbiggestJump=0\nsellingPriceForBigge... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s266914761', 's472944684', 's775105370', 's001695167'] | [3316.0, 3444.0, 3444.0, 3188.0] | [24.0, 23.0, 24.0, 38.0] | [820, 1337, 1337, 146] |
p03947 | u329865314 | 2,000 | 262,144 | Two foxes Jiro and Saburo are playing a game called _1D Reversi_. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones... | ['s=input()\nans = 0\nfor I in range(len(s)-1):\n if s[i]!=s[i+1]:\n ans += 1\nprint(ans)', 's=input()\nans = 0\nfor i in range(len(s)-1):\n if s[i]!=s[i+1]:\n ans += 1\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s958159862', 's274027966'] | [3188.0, 3188.0] | [17.0, 43.0] | [83, 84] |
p03947 | u382423941 | 2,000 | 262,144 | Two foxes Jiro and Saburo are playing a game called _1D Reversi_. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones... | ['s = input()\nprev = s[0]\nans = 0\n\nfor c in s:\n if c != prev:\n ans += 1\n prev = c\nprint(ans-1)\n', "s = open('input', 'r').read()\nprev = s[0]\nans = 0\n\nfor c in s:\n if c != prev:\n ans += 1\n prev = c\nprint(ans-1)\n", 's = input()\nprev = s[0]\nans = 0\n\nfor c in s:\n ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s551496402', 's776488975', 's989990355'] | [3188.0, 3064.0, 3188.0] | [40.0, 23.0, 40.0] | [110, 128, 108] |
p03947 | u417014669 | 2,000 | 262,144 | Two foxes Jiro and Saburo are playing a game called _1D Reversi_. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones... | ['s=input()\ncnt=0\nfor i range(1,len(s)):\n if s[i]!=s[i-1]:\n cnt+=1\nprint(cnt)', 's=input()\ncnt=0\nfor i in range(1,len(s)):\n if s[i]!=s[i-1]:\n cnt+=1\nprint(cnt)'] | ['Runtime Error', 'Accepted'] | ['s311793120', 's001541545'] | [2940.0, 3188.0] | [17.0, 46.0] | [79, 82] |
p03947 | u485137520 | 2,000 | 262,144 | Two foxes Jiro and Saburo are playing a game called _1D Reversi_. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones... | ["\ns_long = input()\n\ncount = 0\nprev = ''\n\nfor s in s_long:\n if prev == ''\n prev = s\n continue\n\n if prev != s:\n count += 1\n prev = s\n\nprint(count)", "s_long = input()\n\ncount = 0\nprev = ''\n\nfor s in s_long:\n if prev == '':\n prev = s\n continue\n\n ... | ['Runtime Error', 'Accepted'] | ['s198306270', 's123883247'] | [2940.0, 3188.0] | [18.0, 39.0] | [177, 178] |
p03947 | u579299997 | 2,000 | 262,144 | Two foxes Jiro and Saburo are playing a game called _1D Reversi_. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones... | ["print('AAA')\n", "\nimport numpy as np\nprint('hoge!')\n ", "\nimport numpy as np\nprint('hoge!')\n ", "\nimport numpy as np\nprint('hoge!')\n ", "\nimport numpy as np\nprint('hoge!')\n ", "\nimport numpy as np\nprint('hoge!')\n ", "\nimport numpy as np\nprint('hoge!')\n ", "print('AAA')\n", "\nimport nu... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer',... | ['s077243059', 's081274149', 's181056686', 's189198075', 's309110059', 's365842659', 's389002934', 's394427223', 's422313696', 's538612802', 's546977711', 's564521074', 's606954644', 's618301741', 's682814545', 's704744253', 's843555274', 's845663000', 's899363550', 's992516591', 's314106353'] | [3068.0, 12552.0, 12548.0, 12552.0, 20000.0, 12552.0, 12552.0, 3068.0, 20504.0, 12552.0, 13224.0, 18592.0, 22964.0, 12552.0, 17972.0, 12548.0, 12860.0, 12524.0, 3068.0, 12524.0, 3188.0] | [22.0, 167.0, 167.0, 162.0, 270.0, 161.0, 168.0, 23.0, 310.0, 161.0, 175.0, 257.0, 363.0, 166.0, 268.0, 173.0, 173.0, 162.0, 24.0, 162.0, 34.0] | [13, 38, 38, 38, 38, 38, 38, 13, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 13, 38, 74] |
p03947 | u998771223 | 2,000 | 262,144 | Two foxes Jiro and Saburo are playing a game called _1D Reversi_. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones... | ['S=input();\nDifF=0;\nDifE=0;\nFirst=S[0];\nlen=len(S)\nEnd=S[len-1];\nif First==End:\n for i in range(len):\n \tif S[i]!=First:\n \t\tDifF+=1;\n \t\tDifE+=1;\nelif First!=End:\n for i in range(len):\n \tif S[i]!=First:\n \t\tDifF+=1;\n \telif S[i]==First:\n \t DifE+=1;\nif DifE >= DifF:\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s802846448', 's972969517', 's674872997'] | [3188.0, 3060.0, 3188.0] | [38.0, 17.0, 41.0] | [330, 136, 129] |
p03951 | u020798319 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = str(input().split())\nt = str(input().split())\na = set(s+t)\nprint(a)\nprint(len(a)-3)', 'n = int(input())\ns = str(input())\nt = str(input())\nfor i in range (n+1):\n b = s[0:i] + t[0:n]\n if b[0:n] == s:\n n += i\n break\nprint(n)'] | ['Wrong Answer', 'Accepted'] | ['s055734397', 's370673751'] | [9072.0, 9072.0] | [26.0, 28.0] | [104, 142] |
p03951 | u023229441 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n=int(input())\nA=input()\nB=input()\ns=0\n\nans=2*n\nfor i in range(n)\n if A[-i-1:]!=B[:i+1]:\n s=1\n print(ans)\n exit()\n else:\n ans-=1\nprint(ans)', 'n=int(input())\nA=input()\nB=input()\ns=0\n\nans=n\nD=[i for i in range(n)][::-1]\nfor i in D:\n if A[-i-1:]==B[:i+1]:\n \n print(ans)\n e... | ['Runtime Error', 'Accepted'] | ['s167027693', 's698208320'] | [2940.0, 3060.0] | [17.0, 17.0] | [153, 172] |
p03951 | u026155812 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = input()\nt = input()\nnum = 0\nfor i in range(0, N):\n if t[:i] == s[N-i-1:]:\n num = i\nprint(2*N - num)', 'N = int(input())\ns = input()\nt = input()\nnum = 0\nfor i in range(N):\n if t[:i+1] == s[-i-1:]:\n num = i+1\nprint(2*N - num)\n \n'] | ['Wrong Answer', 'Accepted'] | ['s728454232', 's325845405'] | [2940.0, 2940.0] | [17.0, 19.0] | [130, 140] |
p03951 | u030110634 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = input()\nt = input()\nfor i in range(0,N):\n if s[-i-1] !=t[i]:\n break\nif s == t:\n print(s)\nelse:\n print(s + t[i:])\n', 'N = int(input())\ns = input()\nt = input()\nmx = 0\nfor i in range(0,N):\n cnt = 0\n for j in range(0,N):\n if i+j >= N: break\n if s[... | ['Wrong Answer', 'Accepted'] | ['s768682155', 's644089532'] | [3064.0, 3064.0] | [22.0, 24.0] | [150, 223] |
p03951 | u030726788 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['import sys\n\n\nn=int(input())\ns=input()\nt=input()\ntest=s+t\nif(s==t):\n print(s)\n sys.exit()\nfor i in range(1,n+1)[::-1]:\n test=s[0:-i]+t\n if(test[:n]==s and test[-n:]==t):\n print(test)\n sys.exit()\n \nprint(s+t)', 'import sys\n\n\nn=int(input())\ns=input()\nt=input()\ntest=... | ['Wrong Answer', 'Accepted'] | ['s754198331', 's091203455'] | [3316.0, 3064.0] | [21.0, 17.0] | [239, 254] |
p03951 | u046592970 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\n\nf = 1\nfor i in range(n):\n if s[i:] == t[:n-i]:\n print(s + t[n-i:])\n f = 0\n break\nif f:\n print(s + t)', 'n = int(input())\ns = input()\nt = input()\ncnt = 0\nfor i in range(n):\n if s[n-i-1:] == t[:i+1]:\n cnt = len(t[:i+1])\npri... | ['Wrong Answer', 'Accepted'] | ['s872430825', 's174500568'] | [3060.0, 2940.0] | [17.0, 17.0] | [169, 138] |
p03951 | u057415180 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\n\nfor i in range(n):\n if s[-i-1:] != t[:i+1]:\n cnt = i\n\nprint(n * 2 - i)', 'n = int(input())\ns = input()\nt = input()\ncnt = 0\nfor i in range(n):\n if s[-1-i:] == t[:i+1]:\n cnt = i + 1\nprint(n*2-cnt)'] | ['Wrong Answer', 'Accepted'] | ['s447695967', 's071878266'] | [3064.0, 3060.0] | [20.0, 17.0] | [116, 124] |
p03951 | u063052907 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['# coding: utf-8\nN, s, t = int(input()), input(), input()\n\ncnt = 0\nif s == t:\n print(N)\nelse:\n for i in range(N):\n if s[-i:]==t[:i]:\n cnt = (i+1)\n print(2 * N - cnt)', 'N = int(input())\ns = input()\nt = input()\n\nt_ = ""\nfor i in range(N+1):\n if s[i:] == t[:N-i]:\n ch... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s261710628', 's283494175', 's964466872'] | [2940.0, 3060.0, 2940.0] | [18.0, 18.0, 17.0] | [191, 170, 123] |
p03951 | u066337396 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input().strip()\nt = input().strip()\nfor i in range(n):\n if s[i:] == t[:n-i]:\n print(s + t[i:])\nprint(s+t)', 'n = int(input())\ns = input().strip()\nt = input().strip()\nfor i in range(n-1):\n if s[i:] == t[:n-i+1]:\n print(s + t[i+1:])\nprint(s+t)\n', 'n = int(input())\ns = input().... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s342517233', 's660415244', 's813583968', 's663645614'] | [3060.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [130, 137, 135, 142] |
p03951 | u077337864 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input().strip()\nt = input().strip()\nis_match = False\nfor i in range(len(s)):\n if s[i:] == t[:n-i]:\n is_match = True\n break\nif is_match:\n print(s[:i] + t)\nelse:\n print(s + t)', 'n = int(input())\ns = input().strip()\nt = input().strip()\nis_match = False\nfor i in range(len(s))... | ['Wrong Answer', 'Accepted'] | ['s705263573', 's618276696'] | [2940.0, 2940.0] | [17.0, 17.0] | [203, 214] |
p03951 | u085717502 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['#!/usr/bin/env python\n# coding: utf-8\n\n# In[27]:\n\n\nN = int(input())\ns = str(input())\nt = str(input())\n\n\n# In[29]:\n\n\nfor i in range(len(s)):\n# print(i, s[i:], t[:len(t)-i])\n if s[i:] == t[:len(t)-i]:\n print(s[:i]+t)\n break\n elif i == len(s)-1:\n print(s+t)\n\n\n# In[ ]... | ['Wrong Answer', 'Accepted'] | ['s173092229', 's515207392'] | [2940.0, 2940.0] | [18.0, 17.0] | [301, 343] |
p03951 | u088552457 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ["n = int(input())\ns = input()\nt = input()\n\nif s == t:\n print(n)\n exit()\n\nans = ''\nfor i in range(n):\n ss = s[n-i-1:]\n tt = t[:i+1]\n if ss == tt:\n ans = s[:n-i-1]+t[i+1:]\n\nif len(ans) == 0:\n print(len(s+t))\nelse:\n print(len(ans))\n ", "n = int(input())\ns = input()\nt = input()\n\nif s == t... | ['Wrong Answer', 'Accepted'] | ['s541793279', 's241825670'] | [3060.0, 3060.0] | [17.0, 17.0] | [240, 242] |
p03951 | u089032001 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['def inpl():\n return list(map(int, input().split()))\n\n\nN = int(input())\nS = input()\nT = input()\n\nfor i in range(N):\n if T[i] == S[-1 - i]:\n continue\n print(2 * N - i * 2)\n break\n', 'def inpl():\n return list(map(int, input().split()))\n\n\ndef Check(S, T):\n for i in range(len(S))... | ['Wrong Answer', 'Accepted'] | ['s236640298', 's534892344'] | [2940.0, 3060.0] | [19.0, 17.0] | [196, 321] |
p03951 | u101225820 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['a,b,c=(input() for _ in range(3))\ncnt=0\nfor i in range(1,int(a)+1):\n if(b[-i:]==c[:i]):cnt=i\n else:print(2*int(a)-cnt)', 'a,b,c=(input() for _ in range(3))\ncnt=0\nfor i in range(1,int(a)+1):\n if(b[-i:]==c[:i]):cnt=i\nprint(2*int(a)-cnt)\n'] | ['Wrong Answer', 'Accepted'] | ['s191204346', 's304728382'] | [3060.0, 2940.0] | [17.0, 17.0] | [124, 116] |
p03951 | u102960641 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n,x = map(int, input().split())\nif n != x:\n print("No")\nelse:\n print("Yes")\n for i in range(1, 2 * n):\n print(i)\n', 'n = int(input())\na = input()\nb = input()\n\nfor i in range(n):\n if i == 0:\n if a == b:\n print(a)\n exit()\n if a[i:] == b[:-i]:\n print(a + b[-i:])\n exit()\nprin... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s333311076', 's338876117', 's525676201', 's316760275'] | [2940.0, 2940.0, 3060.0, 2940.0] | [17.0, 18.0, 21.0, 18.0] | [119, 182, 182, 176] |
p03951 | u106971015 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = input()\nt = input()\nindex = 0\nfor i in s:\n if i == t[index]:\n index += 1\n else:\n continue\nprint(s + t[index:])', 'N = int(input())\ns = input()\nt = input()\nindex = 0\nfor i in s:\n if i == t[index]:\n index += 1\n else:\n continue\nprint(len(s + ... | ['Wrong Answer', 'Accepted'] | ['s460793607', 's255038254'] | [2940.0, 2940.0] | [17.0, 17.0] | [151, 156] |
p03951 | u114641312 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['# from math import factorial,sqrt,ceil,gcd\n# from itertools import permutations as permus\n# from collections import deque,Counter\n# import re\n\n# from decimal import Decimal, getcontext\n\n# # eps = Decimal(10) ** (-100)\n\n# import numpy as np\n# import networkx as nx\n# from scipy.sparse.csgraph import shortest... | ['Runtime Error', 'Accepted'] | ['s504822576', 's917435022'] | [2940.0, 2940.0] | [17.0, 17.0] | [1012, 1012] |
p03951 | u136090046 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\n\ncnt = 0\nfor i, j in zip(s[::-1], t):\n if i == j:\n cnt += 1\n\ncnt2 = 0\nfor i, j in zip(s, t):\n if i == j:\n cnt2 += 1\nprint(s+t[max(cnt, cnt2):])', 'n = int(input())\ns = input()\nt = input()\n\nres = s+t\nfor num in range(n):\n tmp = s[:-num]... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s389099554', 's901400189', 's392889646'] | [3060.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [204, 197, 176] |
p03951 | u136395536 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = input()\nt = input()\n\nanswer = ["*"]*N\n\nfor i in range(len(s)):\n answer[i] = s[i]\n\nfor j in range(len(t)):\n answer[N-j-1] = t[i]\n\nprint(len(answer))', 'N = int(input())\ns = input()\nt = input()\n\n\nnomatch = False\nplace = 0\nfor i in range(N):\n place = i\n if t[0] == s[... | ['Wrong Answer', 'Accepted'] | ['s380534168', 's552789828'] | [3060.0, 3064.0] | [17.0, 17.0] | [174, 405] |
p03951 | u137228327 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n=int(input())\ns=input()\nt=input()\n\nprint(len(set(s)-set(t))+len(set(t)-set(s)))\n', 'n=int(input())\ns=input()\nt=input()\n\nfor i in range(n,2*n-1):\n if s[:2*n-i] == t[2*n-i]:\n print(i)\n exit()\nprint(2*n)', 'n=int(input())\ns=input()\nt=input()\n\nfor i in range(n+1):\n #print(s[i:],t[:n... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s792238896', 's874299402', 's951109274'] | [9040.0, 9128.0, 9164.0] | [29.0, 26.0, 26.0] | [81, 133, 141] |
p03951 | u138486156 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\nfor i in range(n):\n l = n - i\n if s[i:] == t[i:i+l]:\n print(2*n-l)\n exit()\nprint(2*n)\n', 'n = int(input())\ns = input()\nt = input()\nfor i in range(n):\n l = n - i\n if s[i:] == t[0:l]:\n print(2*n-l)\n exit()\nprint(2*n)\n'] | ['Wrong Answer', 'Accepted'] | ['s031393245', 's405263799'] | [2940.0, 2940.0] | [17.0, 17.0] | [147, 145] |
p03951 | u140672616 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['import sys\n\nN = int(input())\n\na = input()\nb = input()\n\nfor i in range(N):\n\tif(a[0:N-i] == b[i:N]){\n\t\tprint(N+i)\n\t\tsys.exit()\n\t\t\nprint(2 * N)', 'import sys\n\nN = int(input())\n\na = input()\nb = input()\n\nfor i in range(N):\n\tif a[i:N] == b[0:N-i]:\n\t\tprint(N+i)\n\t\tsys.exit()\n\t\t\nprint(2 *... | ['Runtime Error', 'Accepted'] | ['s314834085', 's220273818'] | [3064.0, 3064.0] | [22.0, 22.0] | [140, 139] |
p03951 | u183840468 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ["n = int(input())\n\ns = [i for i in input()]\nt = [i for i in input()]\n\ns.extend(t)\n\nprint(''.join(sorted(set(s), key=s.index)))\n\n", 'n = int(input())\ns = input()\nt = input()\n\nidx = 0\nct = 0\n\nfor i in s:\n if i == t[idx]:\n ct += 1\n idx += 1\n \nprint(n*2 - ct)'] | ['Wrong Answer', 'Accepted'] | ['s113456315', 's245754058'] | [2940.0, 3060.0] | [17.0, 17.0] | [127, 147] |
p03951 | u196697332 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = str(input())\nt = str(input())\n\nword = s + t\n\nfor i in range(N):\n if word[len(s) - 1] == word[len(s)] and :\n s = s[:N - 1]\n word = s + t\n \nprint(len(word))\n \n', 'N = int(input())\ns = str(input())\nt = str(input())\n\nword = s + t\n\nif s == t:\n print(N)\n\nfo... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s096524939', 's269342378', 's380283806', 's780896686', 's888254428', 's146125321'] | [2940.0, 3060.0, 3064.0, 3060.0, 3060.0, 2940.0] | [18.0, 18.0, 17.0, 18.0, 18.0, 17.0] | [201, 292, 323, 316, 243, 210] |
p03951 | u212328220 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\n\nlst = []\nfor i in range(1,n+1):\n print(s[n-i:],t[:i])\n if s[n-i:] == t[:i]:\n lst.append(i+(n-i)*2)\n\n\nif lst:\n print(min(lst))\nelse:\n print(n*2)\n\n', 'n = int(input())\ns = input()\nt = input()\n\nlst = []\nfor i in range(1,n+1):\n if s[n-i:... | ['Wrong Answer', 'Accepted'] | ['s890376883', 's286941384'] | [9024.0, 9152.0] | [26.0, 26.0] | [205, 179] |
p03951 | u227082700 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n=int(input())\ns=input()\nt=input()\nfor i in range(n,2*n+1):\n a=s[:i]+t[i-n:]\n if a[-n:]==t:exit(print(i))', 'n=int(input())\ns=input()\nt=input()\nfor i in range(n,2*n+1):\n a=s[:n]+t[2*n-i:]\n if a[-n:]==t:exit(print(i))'] | ['Wrong Answer', 'Accepted'] | ['s720050670', 's379139894'] | [2940.0, 2940.0] | [18.0, 17.0] | [107, 109] |
p03951 | u231685196 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['\n\nn = int(input())\ns = input()\nt = input()\n\ncomb = s+t\ncomb = list(comb)\n\nif s==t:\n print(s)\nelse:\n\n while (True):\n left = n-1\n right = n\n if comb[left] == comb[right]:\n comb[left]=""\n left-=1\n right+=1\n else:\n break\n\... | ['Wrong Answer', 'Accepted'] | ['s715146609', 's560403561'] | [3060.0, 3064.0] | [17.0, 17.0] | [323, 337] |
p03951 | u249987458 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = str(input())\nt = str(input())\nz = s + t\nfor i in range(n):\n if s[i:] == t[:n-i]:\n z = s + t[n-i:]\n break\nprint(z)', 'n = int(input())\ns = str(input())\nt = str(input())\nz = s + t\nfor i in range(n):\n if s[i:] == t[:n-i]:\n z = s + t[n-i:]\n break\nprin... | ['Wrong Answer', 'Accepted'] | ['s234478729', 's945290240'] | [9136.0, 9040.0] | [28.0, 31.0] | [151, 156] |
p03951 | u268516119 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N,S,T=(input() for i in range(3))\nN=int(N)\nfor k in range(N,-1,-1):\n if all([S[N-k+i]==T[i] for i in range(k)]) or k==0:\n print(S+T[k:])\n break', 'N,S,T=(input() for i in range(3))\nN=int(N)\nfor k in range(N,-1,-1):\n if all([S[N-k+i]==T[i] for i in range(k)]) or k==0:\n print(N*2-k)\... | ['Wrong Answer', 'Accepted'] | ['s580660097', 's541888529'] | [3060.0, 3060.0] | [18.0, 19.0] | [174, 172] |
p03951 | u272496669 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = str(input())\nt = str(input())\ni = 0\nwhile t.find(s[i,n])>-1:\n\n', 'n = int(input())\ns = str(input())\nt = str(input())\ni = -1\nwhile True:\n i += 1\n if t.find(s[i:n])>-1:\n print(int(n+i))\n break\n'] | ['Runtime Error', 'Accepted'] | ['s874634704', 's519946465'] | [3064.0, 3064.0] | [23.0, 23.0] | [83, 139] |
p03951 | u273010357 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\n\nans = 2*n\n\nfor i in range(1,n+1):\n print(s[-i:], t[:i])\n if s[-i:] == t[:i]:\n ans = 2*n - i\nprint(ans)', 'n = int(input())\ns = input()\nt = input()\n\nans = 2*n\n\nfor i in range(1,n+1):\n if s[-i:] == t[:i]:\n ans = 2*n - i\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s119836704', 's273496923'] | [3060.0, 3060.0] | [17.0, 17.0] | [157, 132] |
p03951 | u275145490 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\nfor i in range(n, 0, -1):\n if s[-i:] == t[:i]:\n ans = 2 * n - i\n print(ans)\n break\nprint(2 * n)\n', 'n = int(input())\ns = input()\nt = input()\nfor i in range(n, 0, -1):\n if s[-i:] == t[:i]:\n ans = 2 * n - i\n print(ans)\n ... | ['Wrong Answer', 'Accepted'] | ['s223010193', 's284758622'] | [3064.0, 3064.0] | [23.0, 23.0] | [161, 171] |
p03951 | u276204978 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['def main():\n N = int(input())\n s = input()\n t = input()\n\n for i in range(N):\n if s[i:] == t[:N-i]:\n print(s[:i]+t)\n return\n print(s+t)\n\nmain()', 'def main():\n N = int(input())\n s = input()\n t = input()\n\n for i in range(N):\n if s[i:] == t[... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s081603872', 's340867430', 's287975423'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 17.0] | [186, 186, 188] |
p03951 | u278886389 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = input()\nt = input()\n\nn = N\nwhile 0 <= n:\n a = s[-(n+1):]\n b = t[0:n+1]\n if a == b:\n print(s+t[n+1:])\n exit()\n n -= 1\n\nprint(s+t)\nexit()', 'N = int(input())\ns = input()\nt = input()\n\nn = N\nwhile 0 <= n:\n a = s[-(n+1):]\n b = t[0:n+1]\n if a == ... | ['Wrong Answer', 'Accepted'] | ['s875446837', 's110308401'] | [3060.0, 3060.0] | [17.0, 17.0] | [182, 192] |
p03951 | u280512618 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n=int(input())\ns=input()\nt=input()\nfor i in range(n):\n if s[i:-1] == t[:n-i]:\n print(n+i)\n quit(0)\n \nprint(2*n)', 'n=int(input())\ns=input()\nt=input()\nfor i in range(n):\n if s[i:] == t[:n-i]:\n print(n+i)\n quit(0)\n \nprint(2*n)'] | ['Wrong Answer', 'Accepted'] | ['s836295297', 's972133576'] | [2940.0, 2940.0] | [17.0, 17.0] | [121, 119] |
p03951 | u281610856 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\ncnt = 0\nfor i in range(n):\n print(s[i:])\n print(t[:n-i])\n if s[i:] == t[:n-i]:\n cnt += n - i\n break\nprint(2 * n - cnt)', 'n = int(input())\ns = input()\nt = input()\ncnt = 0\nfor i in range(n):\n if s[i:] == t[:n-i]:\n cnt += n - i\n ... | ['Wrong Answer', 'Accepted'] | ['s957294854', 's973430607'] | [3060.0, 2940.0] | [17.0, 17.0] | [182, 146] |
p03951 | u288430479 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\ncou = 0\nfor i in range(n):\n s1 = s[i:]\n t1 = t[:n-i]\n# print(s1,t1)\n if s1==t1:\n print(2*n-(n-i))\nelse:\n print(2*n)\n', 'n = int(input())\ns = input()\nt = input()\ncou = 0\nfor i in range(n):\n s1 = s[i:]\n t1 = t[:n-i]\n# print(s1,t1)\n if s1==t1:\n ... | ['Wrong Answer', 'Accepted'] | ['s646568057', 's272647175'] | [9172.0, 9048.0] | [33.0, 27.0] | [165, 176] |
p03951 | u291873788 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n=int(input())\ns=str(input())\nt=str(input())\n\ndef solve(n,s,t):\n for i in range(n):\n print(s[i:])\n print(t[:n-i])\n if s[i:]==t[:n-i]:\n return 2*n-(n-i)\n return 2*n\n\nprint(solve(n,s,t))', 'n=int(input())\ns=str(input())\nt=str(input())\n\ndef solve(n,s,t):\n for i in range(n):\n if s[i:... | ['Wrong Answer', 'Accepted'] | ['s146969520', 's467450356'] | [3060.0, 3060.0] | [17.0, 17.0] | [200, 164] |
p03951 | u298297089 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['\ndef resolve():\n n = int(input())\n s = input()\n t = input()\n if s == t and len(s) >= n:\n print(len(s))\n return\n pos = 0\n for ss, tt in zip(s[::-1], t):\n if ss != tt:\n break\n pos += 1\n if len(s) + len(t[pos:]) >= n:\n print(len(s+t[pos:]))... | ['Wrong Answer', 'Accepted'] | ['s275233696', 's316479262'] | [3060.0, 3064.0] | [17.0, 18.0] | [402, 482] |
p03951 | u308041652 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ["# -*- coding: utf-8 -*-\nn = int(input())\ns = input()\nt = input()\ntxt = s+t\ntmp = ''\n\nfor i in range(1,n):\n tmp = s+t[i:]\n if tmp[-n:]==t:\n txt = tmp\n\nif s==t:\n print(s)\nelse :\n print(txt)", "# -*- coding: utf-8 -*-\nn = int(input())\ns = input()\nt = input()\ntxt = s+t\ntmp = ''\n\nf... | ['Wrong Answer', 'Accepted'] | ['s570735499', 's369799154'] | [3064.0, 3064.0] | [23.0, 23.0] | [206, 216] |
p03951 | u314089899 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = str(input())\nt = str(input())\n\nif s == t:\n print(N)\nelse:\n for i in range(N):\n if s[N-1-i]!=t[i]:\n print(2*N-(i+1))\n break', 'N = int(input())\ns = str(input())\nt = str(input())\n\nif s == t:\n print(N)\nelse:\n for i in range(N,0,-1):\n ... | ['Wrong Answer', 'Accepted'] | ['s299668937', 's226170692'] | [9124.0, 9016.0] | [30.0, 24.0] | [178, 241] |
p03951 | u328364772 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\n\ns = list(s)\nt = list(t)\n\nfor i in range(-1, -n, -1):\n if t[i] != s[i]:\n s.append(t[i])\n\nprint(s)\nprint(len(s))', 'n = int(input())\ns = input()\nt = input()\n\nans = n\nfor i in range(n):\n if s[i:] == t[:n-i]:\n break\n else:\n ans +... | ['Wrong Answer', 'Accepted'] | ['s851682687', 's081442340'] | [3060.0, 2940.0] | [17.0, 17.0] | [162, 146] |
p03951 | u329706129 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\nS = input()\nT = input()\nans = 2 * N\nif (S == T):\n print(N)\n exit(0)\nfor i in range(N):\n if (T[i] == S[-(i + 1)]):\n print(T[i], S[-(i + 1)])\n ans -= 1\nprint(ans)', 'N = int(input())\nS = input()\nT = input()\nans = 2 * N\nfor i in range(N):\n for j in range(1, N + ... | ['Wrong Answer', 'Accepted'] | ['s215549506', 's680053602'] | [3064.0, 2940.0] | [20.0, 19.0] | [200, 180] |
p03951 | u335793707 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\n\nif s == t:\n print(n)\n return\n\nr = 0\nfor i in range(0, n):\n if s[-(i + 1)] != t[i]:\n break\n r += 1\n\nprint((n * 2) - r)\n', 'n = int(input())\ns = input()\nt = input()\n\nr = n\nfor i in range(0, n):\n if s[i:] == t[:(n-i)]:\n brea... | ['Runtime Error', 'Accepted'] | ['s522220974', 's147369713'] | [2940.0, 2940.0] | [17.0, 18.0] | [179, 136] |
p03951 | u350093546 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n=int(input())\ns=input()\nt=input()\nwhile True:\n if s==t:\n break\n s=s[1:]\n t=[:-1]\n n+=1\nprint(n)', 'n=int(input())\ns=input()\nt=input()\nwhile True:\n if s==t:\n break\n s=s[1:]\n t=t[:-1]\n n+=1\nprint(n)\n'] | ['Runtime Error', 'Accepted'] | ['s822592088', 's439427780'] | [8940.0, 9116.0] | [22.0, 27.0] | [103, 105] |
p03951 | u350997995 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = input()\nt = input()\nfor i in range(N+1):\n if s[i:]==t[:N-i]:\n break\nprint(s+t[N-i:])', 'N,s,t = open(0).read().split()\nN = int(N)\nans = 2*N\nfor i in range(N):\n if s[i:]==t[:N-i]:\n ans=N+i\n break\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s030092237', 's678338994'] | [2940.0, 2940.0] | [18.0, 17.0] | [115, 134] |
p03951 | u366644013 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\nans = s + t[len(s+t) - len(set(s+t)):]\nprint(ans)', 'n = int(input())\ns = input()\nt = input()\nfor i in range(n):\n if s[i:] == t[:n-i]:\n print(n+i)\n exit()\nprint(n*2)'] | ['Wrong Answer', 'Accepted'] | ['s318370601', 's906634013'] | [2940.0, 2940.0] | [17.0, 17.0] | [90, 129] |
p03951 | u367130284 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n,s,t=open(0).readlines()\nn=int(n)\nfor i in range(1,n+1):\n x=s[:i]+t\n if x[:n]==s and x[-n:]==t:\n q=x\nprint(len(x))', '_,s,t=open(0).readlines();print(len(s+t)-sum(r[0]==r[1]for r in zip(s,t))-1)', 'input();s=input();t=input();print(2*len(s)-max([i for i in range(n+1)if s[-i:]==t[:i]]or[0]))', 'n=int(input... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s073560463', 's299540065', 's384583680', 's511222424', 's633659769'] | [3060.0, 2940.0, 2940.0, 2940.0, 2940.0] | [18.0, 18.0, 17.0, 18.0, 17.0] | [120, 76, 93, 136, 95] |
p03951 | u371467115 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n=int(input())\ns=[input() for i in range(n)]\nt=[input() for j in range(n)]\ns.reverse()\nl=0\nfor k in range(n):\n while s[k]==t[k]:\n l+=1\nprint(l)', 'n=int(input())\ns=list(input())\nt=list(input())\ns.reverse()\nl=0\nfor k in range(n):\n if s[k]==t[k]:\n l+=1\n else:\n break\npri... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s585793907', 's780831514', 's688233476'] | [3060.0, 2940.0, 2940.0] | [2103.0, 17.0, 18.0] | [154, 147, 160] |
p03951 | u386089355 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\n\nfor i in range(n):\n\tif t[i] == s[(-1) * i - 1]:\n\t\tcontinue\n\telse:\n\t\tbreak\n\nif i == 0:\n\tprint(s + t)\nelse:\n\tprint(s[:(-1) * i] + t)', 'n = int(input())\ns = input()\nt = input()\n\nfor i in reversed(range(n)):\n\tj = (-1) * i - 1\n\tif t[:(i+1)] == s[j:]:\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s341699569', 's635406472', 's667643284'] | [3060.0, 3060.0, 3060.0] | [18.0, 17.0, 17.0] | [172, 198, 233] |
p03951 | u391731808 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N=int(input())\nS=input()\nT=input()\nfor i in range(N+1):\n s = S+T[::-1][i:][::-1]\n if s[-N:]==T: print(N+i);break', 'N=int(input())\nS=input()\nT=input()\nfor i in range(N+1):\n s = S+T[::-1][:i][::-1]\n if s[-N:]==T:print(N+i);break\n'] | ['Wrong Answer', 'Accepted'] | ['s075231544', 's119687642'] | [2940.0, 2940.0] | [17.0, 17.0] | [114, 114] |
p03951 | u396495667 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\n\nif s==t:\n print(s)\n \nelse:\n for i in range(n):\n if s[i:] == t[:-i]:\n print(2*n -(n-i))\n else:\n print(2*n)', 'n =int(input())\ns = list(input())\nt =list(input())\n\nfor i in range(n,0,-1):\n if s[-i:] ==t[:i]:\n print(2*n-i)\n exit()\npri... | ['Wrong Answer', 'Accepted'] | ['s666447282', 's692017148'] | [3060.0, 2940.0] | [17.0, 17.0] | [166, 135] |
p03951 | u405660020 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n=int(input())\ns=input()\nt=input()\n\nn_s=len(s)\nn_t=len(t)\nl=[]\nfor i in range(n_s):\n for j in range(n_t):\n l.append(s[:i]+t[j:])\nans=s+t\nfor c in l:\n if c[:n_s]==s and c[len(c)-n_t:]==t:\n if len(ans)>len(c):\n ans=c\n\nprint(ans)', 'n=int(input())\ns=input()\nt=input()\n\nn... | ['Wrong Answer', 'Accepted'] | ['s186952815', 's217525177'] | [4596.0, 4596.0] | [24.0, 24.0] | [257, 262] |
p03951 | u411923565 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['#26 A - Prefix and Suffix\nN = int(input())\ns = list(input())\nt = list(input())\ns_rev = list(reversed(s))\n\ncnt = N\nfor i in range(1,N+1):\n \n tgt = list(reversed(s_rev[:i]))\n print(tgt,t[:i])\n if tgt == t[:i]:\n cnt -= 1\n else:\n break\n \nif s == t:\n print(N)\nelse:\n ... | ['Wrong Answer', 'Accepted'] | ['s908310955', 's554603531'] | [9200.0, 9096.0] | [33.0, 28.0] | [386, 309] |
p03951 | u414809621 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['# -*- coding: utf-8 -*-\n"""\nCreated on Sat Oct 29 21:00:35 2016\n\n@author: dotha\n"""\n\ndef main():\n N = int(input())\n s = input()\n t = input()\n if s==t:\n return s\n for i in range(N):\n if s[i:] == t[:-i]:\n return(s[:i]+t)\n else:\n return(s+t)\n \n\n\n\... | ['Wrong Answer', 'Accepted'] | ['s866632754', 's247729029'] | [3064.0, 3064.0] | [23.0, 22.0] | [343, 348] |
p03951 | u427344224 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = input()\nt = input()\n\nif s.find(t) > -1:\n print(len(s))\n exit()\n\nS = s + t\nr = len(S)\nfor i in range(N):\n ti = S[-(N-i):]\n index = s.find(ti)\n if index > -1:\n print(len(s)+len(t)- (len(s)-index-1))\n exit()\nprint(r)', 'N = int(input())\ns = input()\nt = ... | ['Wrong Answer', 'Accepted'] | ['s096085653', 's048926049'] | [3064.0, 3060.0] | [17.0, 17.0] | [263, 212] |
p03951 | u430771494 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ["N=int(input())\ns=list(input())\nt=list(input())\nf=s+t\nif s==t:\n print(''.join(s))\n exit()\nfor i in range(0,N):\n if s[-i:]==t[:i]:\n f=s+t[i:]\nprint(''.join(f))", 'N=int(input())\ns=list(input())\nt=list(input())\nf=s+t\nif s==t:\n print(s)\n exit()\nfor i in range(0,N):\n if s[-i:]==t... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s377449859', 's615471441', 's842630744'] | [3060.0, 3060.0, 3060.0] | [17.0, 17.0, 18.0] | [173, 155, 165] |
p03951 | u454524105 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\nans = ""\nfor i in range(n):\n if s[i] == t[0]:\n ans += s[:i]\n ans += t\n break\nif ans == "": ans = s + t\nprint(ans)', 'n = int(input())\ns = input()\nt = input()\nif s == t: print(s)\nelse:\n idx = j = 0\n for i in range(n):\n if s[... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s241626127', 's599740385', 's492339189'] | [3060.0, 3060.0, 2940.0] | [17.0, 17.0, 17.0] | [178, 291, 142] |
p03951 | u461833298 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = input()\nt = input()\n\nfor i in range(N):\n if s==t:\n print(N)\n break\n elif s[i:] == t[:-i]:\n print(N+i)\n break\n else:\n print(N*2)\n break', '\nN = int(input())\ns = input()\nt = input()\n\nans=0\nfor i in range(N):\n if s==t:\n ... | ['Wrong Answer', 'Accepted'] | ['s622725181', 's505667878'] | [2940.0, 3060.0] | [17.0, 18.0] | [206, 211] |
p03951 | u468972478 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\na, b = [input() for i in range(2)]\nfor i in range(n+1):\n if a[i:] == b[:n-i]:\n print(i + n)\n', 'n = int(input())\na, b = [input() for i in range(2)]\nfor i in range(n+1):\n if a[i:] == b[:n-i]:\n print(i + n)\n break'] | ['Wrong Answer', 'Accepted'] | ['s294938860', 's593366176'] | [9156.0, 9164.0] | [28.0, 28.0] | [113, 122] |
p03951 | u482969053 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ["N = int(input())\ns = input()\nt = input()\nans = ''\nfor i in range(N):\n prefix = s[i:]\n if t.startswith(prefix):\n ans = s[:i] + t\n break\nif ans == '':\n ans = s + t\nprint(ans)\n", "N = int(input())\ns = input()\nt = input()\nans = ''\nfor i in range(N):\n prefix = s[i:]\n if t.sta... | ['Wrong Answer', 'Accepted'] | ['s363544115', 's498994436'] | [2940.0, 3060.0] | [17.0, 17.0] | [196, 201] |
p03951 | u485319545 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ["n=int(input())\ns=input()\nt=list(input())\n\nimport re \n\n\nans=s\n\nk=-1\nfor i in range(n):\n tmp=''.join(t[:i+1])\n\n if tmp in ans:\n k=i\n\nif k<n-1:\n ans+=''.join(t[k+1:])\n\nprint(ans)\n", "n=int(input())\ns=input()\nt=list(input())\n\nimport re \n\n\nans=s\n\nk=-1\nfor i in range(n):\n t... | ['Wrong Answer', 'Accepted'] | ['s061337648', 's185800291'] | [9744.0, 9904.0] | [37.0, 41.0] | [192, 197] |
p03951 | u500297289 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\ns = input()\nt = input()\n\nfor i in range(N):\n if s[i:] == t[:N - i]:\n tmp = len(s[i:])\n print(s + t[tmp:])\n exit()\n\nprint(s + t)', 'N = int(input())\ns = input()\nt = input()\n\nfor i in range(N):\n if s[i:] == t[:N - i]:\n tmp = len(s[i:])\n print(le... | ['Wrong Answer', 'Accepted'] | ['s967022464', 's597045622'] | [3060.0, 3060.0] | [17.0, 17.0] | [168, 178] |
p03951 | u503111914 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\nS = input()\nT = input()\nans = S+T\nfor i in range(1,N+1):\n #print(S[-i:],T[:i])\n if S[-i:] == T[:i]:\n ans = S + T[i:]\nprint(ans)', 'N = int(input())\nS = input()\nT = input()\nans = S+T\nfor i in range(1,N+1):\n #print(S[-i:],T[:i])\n if S[-i:] == T[:i]:\n ans = S + T... | ['Wrong Answer', 'Accepted'] | ['s905565190', 's729109985'] | [8972.0, 9136.0] | [30.0, 28.0] | [157, 162] |
p03951 | u513900925 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = input()\nN =int(N)\ns = input()\nt = input()\n\nfor i in range(N):\n q = s[-(i+1):]\n r = t[:i+1]\n if q == r :\n x = q\n y =i+1\nprint(s[:N-y]+t)', 'N = input()\nN =int(N)\ns = input()\nt = input()\ny = 0\nfor i in range(N):\n q = s[-(i+1):]\n r = t[:i+1]\n if q == r :\n x ... | ['Runtime Error', 'Accepted'] | ['s216014610', 's565676019'] | [3060.0, 3060.0] | [17.0, 18.0] | [162, 163] |
p03951 | u518064858 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n=int(input())\ns=input()\nt=input()\nans=""\nfor i in range(n+1):\n s1=s[:n-i]\n s2=s[n-i:]\n t1=t[:i]\n t2=t[i:]\n if s2==t1:\n ans=s1+s2+t2\nprint(ans)\n', 'n=int(input())\ns=input()\nt=input()\nans=""\nfor i in range(n+1):\n s1=s[:n-i]\n s2=s[n-i:]\n t1=t[:i]\n t2=t[i:]\n if s... | ['Wrong Answer', 'Accepted'] | ['s402133049', 's253239688'] | [2940.0, 2940.0] | [17.0, 17.0] | [166, 171] |
p03951 | u541318412 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\nw1 = input()\nw2 = input()\n\ndef joint(x,y):\n tmp = 0\n for i in range(0,n):\n if x[-i-1] == y[i]:\n tmp += 1\n else:\n break\n tmp_x = x[0:n-tmp]\n return(tmp_x+y)\n\nif w1 == w2:\n print(w1)\nelse:\n print(joint(w1,w2))', 'n = int(input())\nw... | ['Wrong Answer', 'Accepted'] | ['s554640147', 's330637711'] | [3060.0, 3064.0] | [17.0, 18.0] | [278, 266] |
p03951 | u572032237 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n = int(input())\ns = input()\nt = input()\ntemp = s\nfor i in range(n):\n if temp[:n] == s and temp[-n:] == t:\n print(len(temp))\n break\n if s[-(i + 1)] != t[i]:\n temp += t[i]\n print(temp)\n print(temp[:n])\n print(temp[-n:])\n if temp[:n] == s and temp[-n:] == ... | ['Wrong Answer', 'Accepted'] | ['s770512668', 's960568725'] | [9200.0, 9108.0] | [21.0, 30.0] | [348, 179] |
p03951 | u582243208 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['n=int(input())\ns=input()\nt=input()\nif s==t:\n print(n)\nelse:\n ans=2*n\n f=True\n for i in range(n):\n for j range(i+1):\n if t[j]==a[n-1-i+j]:\n f=False\n if not f:\n break\n print(ans)', 'n=int(input())\ns=input()\nt=input()\nif s==t:\n print(... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s047859888', 's256875576', 's273111243', 's423648553', 's456266932', 's216239824'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [22.0, 23.0, 22.0, 23.0, 22.0, 23.0] | [242, 254, 257, 260, 257, 141] |
p03951 | u582763758 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['import sys\nn = int(input())\nS1 = input().rstrip()\nS2 = input().rstrip()\nfor i in range(n,-1,-1):\n if S1[n-i:] == S2[:i]:\n print(S1+S2[i:])\n sys.exit(0)\n', 'n = int(input())\nS1 = input().rstrip()\nS2 = input().rstrip()\nfor i in range(n,-1,-1):\n if S1[n-i:] == S2[:i]:\n print(S1+S2... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s157889390', 's518013989', 's808212374'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [169, 152, 157] |
p03951 | u593567568 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['N = int(input())\nS = list(input())\nT = list(input())\n\nans = N + N\nfor i in range(N):\n w = S + T[-(i+1):]\n if w[:N] == S and w[N:] == T:\n ans = min(ans,i+N+1)\n\nif S == T:\n ans = N\n \nprint(ans)\n \n', 'N = int(input())\nS = list(input())\nT = list(input())\n\nans = N + N\nfor i in range(N+1):\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s192284176', 's347191684', 's293886689'] | [2940.0, 3064.0, 3060.0] | [17.0, 17.0, 17.0] | [206, 267, 207] |
p03951 | u595893956 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['import sys\nn=int(input())\ns=input()\nt=input()\nif s == t:\n print len(s)\n sys.exit()\nfor i in range(1,n):\n tmp=s+t[-1*i:]\n if tmp[-n:] == t:\n print n+i\n sys.exit()\n', 'import sys\nn=int(input())\ns=input()\nt=input()\nif s == t:\n print(n)\n sys.exit()\nfor i in range(1,n+1):\n tmp=s+t[-1*i:]\n... | ['Runtime Error', 'Accepted'] | ['s961827445', 's592702048'] | [2940.0, 2940.0] | [17.0, 17.0] | [172, 171] |
p03951 | u603234915 | 2,000 | 262,144 | Snuke is interested in strings that satisfy the following conditions: * The length of the string is at least N. * The first N characters equal to the string s. * The last N characters equal to the string t. Find the length of the shortest string that satisfies the conditions. | ['import sys\nn = int(input())\ns = list(input())\nt = list(input())\n\nif s == t:\n print(n)\n sys.exit()\n\nfor i in range(n):\n if s[i:n] == t[0:(n-i)]:\n break\nprint(2*n - i)\n\n\n', 'import sys\nn = int(input())\ns = list(input())\nt = list(input())\n\nif s == t:\n print(n)\n sys.exit()\ncan... | ['Wrong Answer', 'Accepted'] | ['s752937007', 's122793975'] | [2940.0, 3060.0] | [17.0, 17.0] | [184, 244] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.