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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03951 | u609814378 | 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\nmae = s[:N]\nushiro = t[:N]\n\nif mae == ushiro:\n print(mae)\n exit()\n\n\nprint(mae+ushiro)', 'N = int(input())\ns = input()\nt = input()\n\nmae = s[:N]\nushiro = t[:N]\n\nif mae == ushiro:\n print(mae)\n exit()\n\n\nprint(len(mae+ushiro))', 'import sys\nn =... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s495310471', 's919033744', 's695923614'] | [9100.0, 9104.0, 9176.0] | [25.0, 31.0, 26.0] | [133, 138, 244] |
p03951 | u612721349 | 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().strip() for _ in range(3)]\nn = int(n)\nif s == t:\n print(n)\n exit(0)\nfor i in range(n):\n if s[n-i-1] != t[i]:\n print(s + t[i:])\n break', 'n, s, t = [input().strip() for _ in range(3)]\nn = int(n)\nfor i in range(n):\n if s[i:] == t[:n-i]:\n print(n + i)\n break\nelse:\n prin... | ['Wrong Answer', 'Accepted'] | ['s626385167', 's428841718'] | [2940.0, 3060.0] | [17.0, 17.0] | [161, 146] |
p03951 | u619197965 | 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 string=s[i:]\n if string==t[0:len(string)]:\n ans=s[0:i]+string+t[len(string):]\n break\nelse:\n ans=s+t\nprint(ans)', 'n=int(input())\ns=input()\nt=input()\nans=""\nfor i in range(n):\n string=s[i:]\n if string==t[0:len(s... | ['Wrong Answer', 'Accepted'] | ['s090597212', 's371074915'] | [3060.0, 3060.0] | [17.0, 18.0] | [195, 200] |
p03951 | u620868411 | 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\nfor i in range(n):\n print(s[i:],t[:-i])\n if s[i:]==t[:-i]:\n print(2*n-(n-i))\n exit()\nprint(2*n)\n', 'n = int(input())\ns = input()\nt = input()\n\nif s==t:\n print(n)\n exit()\n\nfor i in range(n):\n ... | ['Wrong Answer', 'Accepted'] | ['s685189539', 's054625255'] | [3060.0, 2940.0] | [17.0, 17.0] | [192, 168] |
p03951 | u623687794 | 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 x==1 or x==n:print("No")\nelse:\n print("Yes")\n b=[0]*n\n b[n//2]=x\n b[n//2-1]=x-1\n b[n//2+1]=x+1\n tor=[i+1 for i in range(n)]\n del tor[x-2:x+1]\n print(tor)\n for i in range(n):\n if b[i]==0:\n b[i]=tor.pop()\n for i in b:\n print(i)\n', 'n,x=map(int,input()... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s139094928', 's937296848', 's982282198'] | [3064.0, 3064.0, 2940.0] | [18.0, 18.0, 17.0] | [279, 270, 123] |
p03951 | u625963200 | 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\nif s==t:\n print(n)\nelse:\n for i in range(1,n+1):\n ans=s+t[-i:]\n print(ans)\n if ans[:n]==s and ans[-n:]==t:\n print(len(ans))\n exit()', 'n=int(input())\ns=list(input())\nt=list(input())\n\nfor i in range(n+1):\n if s[i:]==t[:n-i]:\n pr... | ['Wrong Answer', 'Accepted'] | ['s745025701', 's799636124'] | [3060.0, 2940.0] | [18.0, 18.0] | [200, 115] |
p03951 | u680035567 | 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()\n\ns = input()\n\nt = input()\n\ntemp = 0\nflag = True\n\nwhile(temp < N-1 & flag):\n temps = s[N-temp-1:N-1]\n tempt = t[:temp]\n if(temps==tempt):\n temp += 1\n else:\n flag = False\n\nprint(N+N-temp)', 'N = int(input())\n\ns = input()\n\nt = input()\n\ntemp = N\nflag = True\ni... | ['Runtime Error', 'Accepted'] | ['s111096304', 's788754157'] | [3064.0, 3192.0] | [22.0, 22.0] | [223, 283] |
p03951 | u691018832 | 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\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(10 ** 7)\n\nn = int(readline())\ns = input()\nt = input()\nfor i in range(n):\n if s[i:] == t[:n - i]:\n print(n + i)\n exit()\n print(s[i:], t[:n - i])\npr... | ['Wrong Answer', 'Accepted'] | ['s419535199', 's327399927'] | [3060.0, 3060.0] | [17.0, 18.0] | [315, 287] |
p03951 | u693933222 | 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\nsf = s[0:n]\ntf = t[-n:]\n\nfor i in range(len(sf)):\n if (sf[i] in tf):\n for j in range(0, len(sf) - i):\n if (sf[i + j] != tf[j]):\n break\n else:\n print(tf)\n break\n\n else:\n print(sf[i],end... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s198880814', 's413567140', 's946772976', 's815848488'] | [3064.0, 3064.0, 3064.0, 3060.0] | [17.0, 18.0, 17.0, 17.0] | [336, 318, 427, 379] |
p03951 | u697690147 | 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. | ['if (n == len(s) and (s == t)):\n print(n)\nelse:\n ind = [0]\n for i in range(1, len(s)):\n if s[-i:] == t[:i]:\n ind.append(i)\n\n ind.reverse()\n for i in ind:\n if i == 0:\n print(2*n)\n else:\n res = s[0:-i] + t\n if len(res) >= n:\n ... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s078914067', 's630465428', 's858981813', 's514700418'] | [8872.0, 9148.0, 9136.0, 9068.0] | [20.0, 26.0, 26.0, 31.0] | [355, 374, 391, 397] |
p03951 | u704165526 | 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\na=0\nb=-N\nc=0\n\nif int(len(s))==1 and int(len(t))==1:\n print(len(s)+len(t))\n\nelif s==t:\n print(N)\n\nelif s[0]==t[-N]:\n while s[a]==s[b]:\n c+=1\n a+=1\n b+=1\n print(c)\n if N==c:\n break\n\n print(s[0:N-c-1... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s214775212', 's446461014', 's505876461', 's940852864', 's784130624'] | [3064.0, 3188.0, 3192.0, 3064.0, 3064.0] | [22.0, 25.0, 23.0, 23.0, 22.0] | [321, 305, 350, 158, 137] |
p03951 | u729133443 | 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. | ['I=input;n=int(I());s,t=I(),I();print(2*n-max(i*(s[-i:]==t[i:])for i in range(n+1)))', 'n,s,t=open(0);n=int(n);print(2*n-max(i*(s[-i:-1]==t[:i])for i in range(n+1)))', 'I=input;n=int(I());s,t=I(),I();print(2*n-max(i*(s[-i:]==t[:i])for i in range(n+1)))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s012838360', 's993817390', 's585639241'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [83, 77, 83] |
p03951 | u740284863 | 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())\nS = s[::-1]\nif s == t and len(s) == n:\n print(s)\nelse:\n i = 0\n while len(s+t) >= n :\n \n if S[i] == t[i]:\n i += 1\n else:\n break\n s = s[0:len(s)-i]\n print(s+t)\n', 'n = int(input())\ns = str(input... | ['Wrong Answer', 'Accepted'] | ['s204053484', 's716988521'] | [3060.0, 3064.0] | [17.0, 17.0] | [267, 179] |
p03951 | u741397536 | 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\ncount = 0\nfor i in range(len(s)):\n if t[i] == s[-i-1]:\n count += 1\n else:\n break\n\nif s = t:\n print(len(s))\nelse:\n print(len(s)+len(t)-count)', 'N = int(input())\ns = input()\nt = input()\n\ncount = 0\nfor i in range(len(s)):\n if t[:... | ['Runtime Error', 'Accepted'] | ['s508306252', 's004360957'] | [2940.0, 2940.0] | [17.0, 17.0] | [208, 174] |
p03951 | u749770850 | 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()\ng = s[::-1]\nt = input()\n\nif s == t:\n print(s)\n exit()\n\nfor i in range(n):\n if g[i] != t[i]:\n print(s + t[i:])\n exit()', 'n = int(input())\ns = input()\nt = input()\n\nfor i in range(n):\n if s[i:] == t[:n-i]:\n print(n + i)\n exit()\n\nprint(n * 2)\n '] | ['Wrong Answer', 'Accepted'] | ['s116776644', 's598894687'] | [3060.0, 2940.0] | [17.0, 17.0] | [156, 130] |
p03951 | u760794812 | 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 = s + t\nif s != t:\n for i in range(N):\n if s[-i-1:] == t[:i+1]:\n Answer = s[:-i-1]+t[i:]\nelse:\n Answer = s\nprint(Answer)', 'N = int(input())\ns = input()\nt = input()\nAnswer = s + t\nfor i in range(N):\n if s[-i-1:] == t[:i+1]:\n Answer = s + ... | ['Wrong Answer', 'Accepted'] | ['s870585557', 's745222993'] | [3060.0, 2940.0] | [17.0, 17.0] | [179, 144] |
p03951 | u765237551 | 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 x==1 or x==2*N-1:\n print(\'No\')\nelse:\n print(\'Yes\')\n if x <= 2*N:\n y = list(i for i in range(2, 2*N-2) if i!=x)\n l = len(y)//2\n print("\\n".join(map(str, y[:l] + [2*N-1, x, 1, 2*N-2] + y[l:])))\n else:\n y = list(i for i in range(3... | ['Runtime Error', 'Accepted'] | ['s236923514', 's052453696'] | [3064.0, 3064.0] | [23.0, 22.0] | [411, 124] |
p03951 | u794173881 | 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 print(n-i)\n exit()\n\n\n', 'n = int(input())\ns = input()\nt = input()\n\nfor i in range(n):\n if s[i:]==t[:n-i]:\n print(n+i)\n exit()\n\nprint(2*n)\n'] | ['Wrong Answer', 'Accepted'] | ['s638310890', 's289484328'] | [2940.0, 2940.0] | [18.0, 18.0] | [110, 120] |
p03951 | u799443198 | 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\nfor i in range(N+1):\n st = s+t[i:]\n print(st)\n if st[:N] == s and st[-N:] == t:\n ans = min(ans, len(st))\nprint(ans)\n', 'N = int(input())\ns = input()\nt = input()\nans = 2 * N\nfor i in range(N+1):\n st = s+t[i:]\n if st[:N] == s and st[-N:] == t:... | ['Wrong Answer', 'Accepted'] | ['s331728406', 's657282709'] | [3060.0, 2940.0] | [17.0, 17.0] | [175, 163] |
p03951 | u802772880 | 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()\nls=len(s)\nlt=len(t)\nans=s+t\nfor i in range(n):\n if s[i:]==t[:ls-i]:\n ans=s+t[ls-i:]\n break\nprint(ans)', 'n=int(input())\ns=input()\nt=input()\nls=len(s)\nlt=len(t)\nans=s+t\nfor i in range(n):\n if s[i:]==t[:ls-i]:\n ans=s+t[ls-i:]\n break... | ['Wrong Answer', 'Accepted'] | ['s144999464', 's519569540'] | [3060.0, 3060.0] | [17.0, 20.0] | [153, 158] |
p03951 | u811000506 | 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(s)\n exit()\n\nfor i in range(1,N+1):\n ans = s + t[-i:]\n if ans[-N:] == t:\n break\nprint(ans)', 'N = int(input())\ns = str(input())\nt = str(input())\n\nif s==t:\n print(len(s))\n exit()\n\nfor i in range(1,N+1):\n ... | ['Wrong Answer', 'Accepted'] | ['s934490153', 's812193834'] | [9200.0, 9180.0] | [26.0, 28.0] | [176, 186] |
p03951 | u812973725 | 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 = input()\nt = input()\n\nfor i in range(N):\n if s[i:] == t[:N-i]:\n print(s[:i]+t)\n break\n if i == N-1:\n print(s+t)\n', 'N = int(input())\n\ns = input()\nt = input()\n\nans = ""\nfor i in range(N):\n if s[i:] == t[:N-i]:\n ans = s[:i]+t\n break\n ... | ['Wrong Answer', 'Accepted'] | ['s782350711', 's974157274'] | [2940.0, 3064.0] | [17.0, 18.0] | [160, 183] |
p03951 | u820351940 | 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, K = map(int, input().split())\nm = 2 * N - 1\n\nif 2 <= K < m:\n mid = list((3, 2, 1) if K == 2 else (K - 1, K, K + 1, K - 2))\n a = list(set(range(1, m + 1)) - set(mid))\n print("Yes\\n" + "\\n".join(map(str, a[:m//2 - 1] + mid + a[m//2 - 1:])))\nelse:\n print("No")\n', 'N, K = map(int, input().split(... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s206051932', 's352254448', 's367411764'] | [3064.0, 3064.0, 3064.0] | [23.0, 22.0, 22.0] | [273, 105, 148] |
p03951 | u830054172 | 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()\nc=0\nfor i in range(n):\n print(s[-i-1:])\n print(t[:i+1])\n if s[-i-1:]==t[:i+1]:\n c=i+1\nprint(n*2-c)\n', 'n=int(input())\ns=input()\nt=input()\nc=0\nfor i in range(n):\n # print(s[-i-1:])\n # print(t[:i+1])\n if s[-i-1:]==t[:i+1]:\n c=i+1\nprin... | ['Wrong Answer', 'Accepted'] | ['s419830791', 's806670832'] | [3060.0, 2940.0] | [17.0, 17.0] | [150, 154] |
p03951 | u834311314 | 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[N - 1 - i:N] == t[0:i + 1]:\n t = t[i + 1:N]\nprint(s + t)', 'N = int(input())\ns = input()\nt = input()\nu = t\nfor i in range(N):\n if s[N - 1 - i:N] == t[0:i + 1]:\n u = t[i + 1:N]\nprint(s + u)\nprint (len(s + u))', 'N = int... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s482478377', 's735222441', 's536454699'] | [3064.0, 3064.0, 3064.0] | [23.0, 23.0, 24.0] | [132, 157, 133] |
p03951 | u835482198 | 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())\nprefix = input()\nsuffix = input()\n\n\nif len(prefix) + len(suffix) < N:\n d = N - len(prefix) + len(suffix)\n print(prefix + \'a\' * d + suffix)\nelse:\n s = ""\n for i in range(1, N):\n \n if prefix[-i:] == suffix[:i]:\n s = prefix[:-i] + suffix\n if suffix... | ['Wrong Answer', 'Accepted'] | ['s249088166', 's726190272'] | [3060.0, 3060.0] | [17.0, 17.0] | [426, 437] |
p03951 | u841021102 | 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()\nanswer = n\nfor i in range (n + 1) :\n if answer == n :\n newstring = s[0:i] + t[:n]\n \tif newstring[0:n] == s :\n \tanswer += i\nprint (answer)\n', 'n = int(input())\ns = input()\nt = input()\ns1 = []\nt1 = []\nfor i in range(0 , len(s)):\n s1.append(s[i])\nfor i... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s256155000', 's257958120', 's638851779', 's663098902', 's882061364', 's913441679', 's309255390'] | [8964.0, 9040.0, 9060.0, 9020.0, 9120.0, 8892.0, 8992.0] | [27.0, 28.0, 34.0, 24.0, 27.0, 26.0, 29.0] | [187, 206, 92, 152, 206, 185, 172] |
p03951 | u844789719 | 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 x in range(N, 2 * N + 1):\n if S[x - N:] == T[:2 * N - x]:\n print(S + T[2 * N - x:])\n exit()\n', 'N = int(input())\nS = input()\nT = input()\nfor x in range(N, 2 * N + 1):\n if S[x - N:] == T[:2 * N - x]:\n print(x)\n exit()\n'] | ['Wrong Answer', 'Accepted'] | ['s765029398', 's931309129'] | [2940.0, 2940.0] | [19.0, 18.0] | [154, 138] |
p03951 | u846226907 | 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 = input()\nt = input()\n\ni = 0\n\nwhile i < N:\n if s[i:] == t[:N-1]:\n break\n else:\n i+=1\n\nprint(N+i)', 'N = int(input())\n\ns = input()\nt = input()\n\ni = 0\n\nwhile i < N:\n if s[i:] == t[:N-i]:\n break\n else:\n i+=1\n\nprint(N+i)'] | ['Wrong Answer', 'Accepted'] | ['s085701284', 's254718624'] | [2940.0, 3064.0] | [18.0, 18.0] | [136, 136] |
p03951 | u846552659 | 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()\nindex = N\na = -1\nfor tmp in range(1,len(t)+1):\n if s[index-1:len(s)] == t[0:tmp]:\n a = index-1\n index -= 1\nif a == -1:\n print(s+t)\nelse:\n for tmp in range(len(s)-a, len(t)):\n s = s+t[tmp]\n print(s)', '# -*- cod... | ['Wrong Answer', 'Accepted'] | ['s774129717', 's212083668'] | [3064.0, 3064.0] | [17.0, 17.0] | [290, 300] |
p03951 | u856232850 | 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()\ncount = 0\nfor i in range(n+1):\n if a[-i:] == a[:i]:\n count = i\nprint(2*n-count)', 'n = int(input())\na = input()\nb = input()\ncount = 0\nfor i in range(n+1):\n if a[-i:] == b[:i]:\n count = i\nprint(2*n-count)'] | ['Wrong Answer', 'Accepted'] | ['s769484454', 's995532457'] | [2940.0, 2940.0] | [17.0, 17.0] | [130, 130] |
p03951 | u859897687 | 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()\nc=0\nfor i in range(1,n):\n if a[-i:]==b[i:]:\n c+=1\n else:\n break\nprint(2*n-c)', 'a=input()\nb=input()\nc=0\nfor i in range(min(len(a),len(b))):\n if a[len(a)-1-i]==b[i]:\n c+=1\n else:\n break\nprint(len(a+b[c:]))', 'n=int(input())\na=input()\nb=input()\nc=0\... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s092182550', 's376692047', 's488136399', 's884188681', 's950333314', 's943986690'] | [3060.0, 2940.0, 3060.0, 2940.0, 2940.0, 2940.0] | [17.0, 19.0, 17.0, 17.0, 17.0, 18.0] | [119, 132, 100, 127, 101, 117] |
p03951 | u867826040 | 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 print(n+n)', 'n = int(input())\ns = input()\nt = input()\nx = 0\nfor i in range(n):\n if s[n-i-1:]==t[:i+1]:\n x = i+1\nprint((n*2)-x)'] | ['Wrong Answer', 'Accepted'] | ['s703746494', 's126054604'] | [2940.0, 3060.0] | [17.0, 17.0] | [83, 123] |
p03951 | u893063840 | 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, -1, -1):\n ans = [""] * (n + n - i)\n ans[:n] = list(s)\n ans[-n:] = list(t)\n if ans[:n] == list(s):\n break\n\nprint(*ans, sep="")\n', 'n = int(input())\ns = input()\nt = input()\n\nfor i in range(n, -1, -1):\n ans = [""] * (2 * n... | ['Wrong Answer', 'Accepted'] | ['s335543778', 's310677378'] | [3316.0, 2940.0] | [19.0, 18.0] | [205, 202] |
p03951 | u905582793 | 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)\n exit()\nfor i in range(1,n-1):\n if s[i+1:] == t[:-i-1]:\n print(n+i)\n break', 'n=int(input())\ns=input()\nt=input()\nif s==t:\n print(n)\n exit()\nfor i in range(n):\n if s[i+1:] == t[:-i-1]:\n print(n+i+1)\n break'] | ['Wrong Answer', 'Accepted'] | ['s725238945', 's682810563'] | [2940.0, 3064.0] | [17.0, 17.0] | [137, 135] |
p03951 | u932465688 | 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()\nk = 0\nfor i in range(N):\n if s[i:N] == t[0:N-i]:\n k = i\nif k != 0:\n print(s+t[N-k:N])\nelse:\n print(s+t)', 'N = int(input())\ns = input()\nt = input()\nk = -1\nfor i in range(N):\n if s[i:N] == t[0:N-i]:\n k = i\n break\nif k != -1:\n print(len(s+t[N-k:N... | ['Wrong Answer', 'Accepted'] | ['s685584969', 's390217605'] | [3060.0, 3060.0] | [18.0, 17.0] | [150, 172] |
p03951 | u936985471 | 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(len(s),-1,-1):\n if s[-i:]==t[:i]:\n break\nprint(s+t[i:])', 'import sys\nreadline = sys.stdin.readline\n\nN = int(readline())\nS = readline().rstrip()\nT = readline().rstrip()\n\nfor i in range(N, -1, -1):\n# print("i",i)\n# print(S[-i:],T[:i])\n if S[-i:] ... | ['Wrong Answer', 'Accepted'] | ['s640586365', 's428550115'] | [2940.0, 3060.0] | [17.0, 17.0] | [109, 250] |
p03951 | u940102677 | 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 k in range(0,n+1):\n if s[k:] == t[:n-k]:\n print(s+t[n-k:])\n break', 'n = int(input())\ns = input()\nt = input()\nfor k in range(0,n+1):\n if s[k:] == t[:n-k]:\n print(n+k)\n break'] | ['Wrong Answer', 'Accepted'] | ['s702423496', 's827682542'] | [2940.0, 2940.0] | [17.0, 17.0] | [117, 111] |
p03951 | u941753895 | 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=='abc' and t=='cde':\n exit()\na=0\nfor i in range(1,n+1):\n if s[n-i:]==t[:i]:\n a=i\nprint(2*n-a)", 'n=int(input())\ns=input()\nt=input()\na=0\nfor i in range(1,n+1):\n if s[n-i:]==t[:i]:\n a=i\nprint(2*n-a)'] | ['Wrong Answer', 'Accepted'] | ['s264316386', 's603551526'] | [3060.0, 2940.0] | [17.0, 17.0] | [138, 103] |
p03951 | u941884460 | 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().rstrip()\nt = input().rstrip()\ntotal = 0\nfor i in range(n):\n if s[n-1-i:] == t[:i+1]:\n total = i\nif total ==0:\n print(2*n)\nelse:\n print(2*n-(total+1))', 'n = int(input())\ns = input().rstrip()\nt = input().rstrip()\ntotal = 0\nif s == t:\n print(n)\nelse:\n for i in range... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s285229881', 's593699193', 's567702721'] | [3060.0, 3060.0, 2940.0] | [17.0, 17.0, 17.0] | [184, 202, 149] |
p03951 | u950708010 | 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()\nn = len(t)\nans = s\nfor i in range(n,-1,-1):\n if t[0:i] in s:\n print (s+t[i::])\n exit()\nprint(s+t)', 'n = int(input())\ns = input()\nt = input()\nn = len(t)\nans = s\nfor i in range(n,-1,-1):\n if t[0:i] in s:\n print (s+t[i::])\n exit()\nprint(len(s+t))'... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s262448323', 's917221251', 's571067612'] | [3060.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0] | [145, 150, 155] |
p03951 | u957872856 | 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()\nw = s+t\ncnt = 0\nfor i in range(len(s)):\n if s[-i-1] == t[i]:\n cnt += 1\nwhile len(w) > N and cnt > 0:\n t = t[1:]\n w = s + t\n cnt -= 1\nprint(w)', 'N = int(input())\ns = input()\nt = input()\nw = s+t\ncnt = 0\nif s == t and N <= len(s):\n print(len(s))\n exit... | ['Wrong Answer', 'Accepted'] | ['s712260542', 's457851873'] | [3060.0, 3064.0] | [17.0, 17.0] | [189, 315] |
p03951 | u966695411 | 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 c = 0\n for i in range(N):\n if S[i] != T[-i-1]:\n c = i\n break\n print(N * 2 - c + 2)', 'N = int(input())\nS = input()\nT = input()\nif S == T:\n print(N)\nelse:\n c = 0\n for i in range(N):\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s119379189', 's978615803', 's361894795'] | [3064.0, 3064.0, 3064.0] | [26.0, 22.0, 22.0] | [192, 192, 128] |
p03951 | u970809473 | 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=0\nfor i in range(n):\n if s[i:] == t[:n-i]:\n ans = n-i\nif ans == 0:\n print(s+t)\nelse:\n print(s[:-ans]+t)', 'n=int(input())\ns=input()\nt=input()\nans=0\nfor i in range(n):\n print(i,s[i:],t[:n-i])\n if s[i:] == t[:n-i]:\n ans = max(n-i,ans)\nprint(2*n-ans)', ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s299114520', 's959961550', 's534575082'] | [3060.0, 3060.0, 2940.0] | [17.0, 17.0, 18.0] | [148, 145, 120] |
p03951 | u977193988 | 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()\ncnt=0\nfor i in range(n):\n if s[i:]==t[:n-i]:\n print(s+t[n-i:])\n sys.exit()\nprint(s+t)', 'import sys\nn=int(input())\ns=input()\nt=input()\ncnt=0\nfor i in range(n):\n if s[i:]==t[:n-i]:\n print(len(s+t[n-i:]))\n sys.exit()\nprint... | ['Wrong Answer', 'Accepted'] | ['s225592730', 's353722661'] | [3060.0, 3060.0] | [17.0, 17.0] | [148, 158] |
p03951 | u981931040 | 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()\nidx = 0\nfor i in range(N):\n tmp_s = s[N - i - 1:]\n tmp_t = t[:i + 1]\n if tmp_s == tmp_t:\n idx = i + 1\n\nprint(s + t[idx:])', 'N = int(input())\ns = input()\nt = input()\nans = s\nfor i in range(N + 1):\n tmp_ans = s + t[i:]\n # print(tmp_ans)\n ... | ['Wrong Answer', 'Accepted'] | ['s750924501', 's704756506'] | [9176.0, 9156.0] | [28.0, 26.0] | [178, 202] |
p03951 | u987164499 | 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 sys import stdin\nn = int(stdin.readline().rstrip())\ns = stdin.readline().rstrip()\nt = stdin.readline().rstrip()\npoint = 0\nfor i,j in zip(s,t):\n if i == j:\n point += 1\n else:\n break\nprint(n*2-point)', 'n = int(input())\ns = input()\nt = input()\n\nfor i in range(len(s)):\n if s[i:... | ['Wrong Answer', 'Accepted'] | ['s835905693', 's648795235'] | [2940.0, 2940.0] | [17.0, 17.0] | [222, 136] |
p03951 | u995062424 | 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\n\nfor i in range(N):\n if(s[i:] == t[:(len(t)-i)]):\n ans = s + t[-i:]\n\nprint(ans if s != t else s)', 'N = int(input())\ns = input()\nt = input()\nans = s + t\n\nfor i in range(N):\n if(s[i:] == t[:(len(t)-i)]):\n ans = s + t[-i:]\n\nprint... | ['Wrong Answer', 'Accepted'] | ['s524979788', 's868399221'] | [3060.0, 3060.0] | [17.0, 17.0] | [159, 164] |
p03955 | u270681687 | 2,000 | 262,144 | We have a grid with 3 rows and N columns. The cell at the i-th row and j-th column is denoted (i, j). Initially, each cell (i, j) contains the integer i+3j-3. A grid with N=5 columns Snuke can perform the following operation any number of times: * Choose a 3×3 subrectangle of the grid. The placement of integers ... | ['import sys\ninput = sys.stdin.readline\n\nn = int(input())\na = [list(map(int, input().split())) for _ in range(3)]\n\nfor j in range(n):\n if not ((a[0][j] - 1 == a[1][j] and a[2][j] + 1 == a[1][j]) or (a[0][j] + 1 == a[1][j] and a[2][j] - 1 == a[1][j])):\n print("No")\n exit()\n\nfor j in range(n):... | ['Wrong Answer', 'Accepted'] | ['s100465489', 's519496519'] | [22496.0, 23132.0] | [144.0, 739.0] | [1214, 1224] |
p03966 | u010090035 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['import math\nN = int(input())\nx=0\nt=0\nn=0\npre_t=0\npre_n=0\nfor i in range(N):\n t,n = map(int,input().split())\n mul = max(math.ceil(pre_t/t),math.ceil(pre_n/n))\n t *= mul\n n *= mul\n pre_t = t\n pre_n = n\n x = t+n\nprint(x)', 'import math\nN = int(input())\nx=0\nt=0\nn=0\npre_t=1\npre_n=... | ['Wrong Answer', 'Accepted'] | ['s116047600', 's727858290'] | [3060.0, 3064.0] | [21.0, 21.0] | [238, 270] |
p03966 | u013756322 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['N = int(input())\nT = [None] * N\nA = [None] * N\nfor i in range(N):\n T[i], A[i] = map(int, input().split())\n\nt, a = 1, 1\n\nfor i in range(N):\n if ( t < T[i] and a < A[i]):\n t, a = T[i], A[i]\n else:\n n = max(t // T[i], a // A[i])\n t, a = n * T[i], n * A[i]\n\nprint(t + a)', 'N = int(input())\nT =... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s580660264', 's608951040', 's390765205'] | [3064.0, 3064.0, 3064.0] | [21.0, 21.0, 21.0] | [278, 287, 318] |
p03966 | u076917070 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ["import sys\ninput=sys.stdin.readline\n\n\nimport math\ndef f(n, m):\n return int(m * math.ceil(n/m))\n\ndef main():\n N = int(input())\n T = A = 1\n for _ in range(N):\n t,a = map(int, input().split())\n k = max(f(T,t)//t, f(A,a)//a)\n T = k*t\n A = k*a\n print(T+A)\n\ni... | ['Wrong Answer', 'Accepted'] | ['s118799991', 's022660845'] | [3188.0, 3060.0] | [21.0, 19.0] | [391, 281] |
p03966 | u095756391 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['N = int(input())\nta = [list(map(int, input().split())) for i in range(N)]\n\nt = ta[0][0]\na = ta[0][1]\n\nfor i in range(N-1):\n if ta[i][0] <= ta[i+1][0] and ta[i][1] <= ta[i+1][1]:\n t = ta[i+1][0]\n a = ta[i+1][1]\n elif ta[i][0] > ta[i+1][0] and ta[i][1] < ta[i+1][1]:\n k = 1\n while t > ta[i+1][0... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s698143700', 's808161675', 's078407429'] | [3188.0, 3316.0, 3188.0] | [2104.0, 2104.0, 22.0] | [651, 266, 217] |
p03966 | u107077660 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['N = int(input())\nTA = []\nfor i in range(N):\n\tTA.append(list(map(int, input().split())))\n\nTA.reverse()\n(voteA, voteB) = TA.pop()\nwhile TA:\n\t(Ti, Ai) = TA.pop()\n\ttmp = max(int((voteA + Ti -1) / Ti), int((voteB + Ai -1) / Ai))\n\tvoteA = Ti * tmp\n\tvoteB = Ti * tmp\nprint(voteA + voteB)\n\n', 'N = int(input... | ['Wrong Answer', 'Accepted'] | ['s655268295', 's139954136'] | [3192.0, 3188.0] | [28.0, 27.0] | [282, 270] |
p03966 | u149752754 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['N = int(input())\nTA = []\nAO = []\nfor i in range(N):\n T, A = map(int, input().split())\n TA += [T]\n AO += [A]\n\nfor i in range(N-1):\n D = ((TA[i]-1)//TA[i+1])+1\n E = ((AO[i]-1)//AO[i+1])+1\n F = max(D, E)\nans = int(TA[N-1] + AO[N-1])\nprint(ans)', 'N = int(input())\nTA = []\nAO = []\nfor i i... | ['Wrong Answer', 'Accepted'] | ['s487443146', 's306640920'] | [3064.0, 3064.0] | [21.0, 21.0] | [258, 292] |
p03966 | u163783894 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ["import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nin_n = lambda: int(readline())\nin_nn = lambda: map(int, readline().split())\nin_s = lambda: readline().rstrip().decode('utf-8')\nin_nl = lambda: list(map(int, readline().split()))\nin_nl2 = lam... | ['Wrong Answer', 'Accepted'] | ['s867976106', 's395819662'] | [9236.0, 9332.0] | [32.0, 31.0] | [1489, 1196] |
p03966 | u299869545 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['import math\n\ndef cceil(x,y):\n\tres = x //y\n\tif x % y != 0:res += 1\n\treturn res\n\ndef gcd(x, y):\n\tif(x == 0):return y\n\treturn gcd(y % x, x)\n \ndef main():\n votes = int(input())\n ratio = [[ int(i) for i in input().split() ] for j in range(votes)]\n \n votesTemp = [0, 0]\n for i in range(votes... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s260634525', 's616030719', 's486896280'] | [3444.0, 3444.0, 3188.0] | [34.0, 33.0, 29.0] | [820, 760, 830] |
p03966 | u319612498 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['from math import ceil\nfrom decimal import *\nn=int(input())\nprea=1.0\npret=1.0\nfor i in range(n):\n \n t,a=map(Decimal,input().split())\n i=max(ceil(prea/a),ceil(pret/t))\n pret,prea=t*i,a*i\n\nprint(pret+prea)', 'from math import ceil\nfrom decimal import *\nn=int(input())\nprea=Decimal("1.0")\npret=D... | ['Runtime Error', 'Accepted'] | ['s510276571', 's556226227'] | [5332.0, 5076.0] | [36.0, 111.0] | [214, 236] |
p03966 | u350997995 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['import math\nN = int(input())\nfor i range(N):\n a,t = map(int,input().split())\n if i == 0:\n x,y = a,t\n else:\n xa = math.ceil(x/a)\n yb = math.ceil(y/b)\n c = max(xa,yb)\n x,y = a*c,b*c\nprint(x+y)', 'import math\nN = int(input())\nfor i in range(N):\n a,t = map(int,input().split())\n if i == ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s409561844', 's544184017', 's815306585', 's735403478'] | [2940.0, 3060.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 20.0] | [208, 211, 208, 224] |
p03966 | u368780724 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ["s = input()\nhmp = 0\nans = 0\nfor i in s:\n if i == 'g' and hmp > 0:\n hmp -= 1\n ans += 1\n elif i == 'g':\n hmp += 1\n elif hmp > 0:\n hmp -= 1\n else:\n hmp += 1\n ans -= 1\nprint(ans)", 'def inpl(): return [int(i) for i in input().split()]\nN = int(input())\n... | ['Wrong Answer', 'Accepted'] | ['s584861703', 's418437131'] | [3060.0, 3060.0] | [20.0, 22.0] | [228, 187] |
p03966 | u371467115 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['n=int(input())\nc=2\ncnt1=1\ncnt2=1\nfor _ in range(n):\n t,a=map(int,input().split())\n i=c\n while i%(t+a)!=0:\n i+=1\n cnt1=i/(t+a)*t\n cnt2=i/(t+a)*a\n c=cnt1+cnt2\nprint(c)', 'n = int(input())\nmt, ma = 1, 1\nfor t, a in (map(int, input().split()) for _ in range(n)):\n l = max((mt-1)//t, (ma-1)//a) ... | ['Wrong Answer', 'Accepted'] | ['s610144589', 's909625023'] | [3060.0, 3316.0] | [22.0, 21.0] | [174, 174] |
p03966 | u375616706 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ["s = input()\n\nl = len(s)\n\npoint = 0\nfor a, b in zip(s[0::2], s[1::2]):\n if a == 'p':\n point -= 1\n if b == 'g':\n point += 1\nprint(point)\n", "s = input()\n\nl = len(s)\n\npoint = 0\nfor a, b in zip(s, s[1:]):\n if a == 'p':\n point -= 1\n if b == 'g':\n point += 1\nprin... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s443478142', 's450808979', 's168748687'] | [2940.0, 2940.0, 3060.0] | [18.0, 18.0, 22.0] | [155, 147, 188] |
p03966 | u426108351 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['N = int(input())\nx, y = 0\nfor i in range(N):\n a, b = map(int, input().split())\n mul = max((x-1)//a+1, (y-1)//b+1)\n x = mul*a\n y = mul*b\nprint(x+y)', 'N = int(input())\nx, y = 0, 0\nfor i in range(N):\n a, b = map(int, input().split())\n mul = max((x-1)//a+1, (y-1)//b+1)\n x = mul*a\n y = mul*b\nprint(x... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s038787239', 's521724619', 's552074047'] | [3060.0, 3060.0, 3060.0] | [18.0, 20.0, 21.0] | [150, 153, 153] |
p03966 | u455696302 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['import math\nfrom decimal import *\n\nN = int(input())\n_input = []\nfor i in range(N):\n _input.append(list(map(int,input().split())))\n\ntotal_T = 1\ntotal_A = 1\n\nfor t,a in _input:\n \n n = max(-(-t//Ti), -(-a//Ai))\n total_T = int(t*n)\n total_A = int(a*n)\n\nprint(total_A+total_T)\n', 'import ma... | ['Runtime Error', 'Accepted'] | ['s500333441', 's837819083'] | [5204.0, 5076.0] | [37.0, 38.0] | [338, 348] |
p03966 | u497046426 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['N = int(input())\nratio = []\nfor _ in range(N):\n ratio.append(tuple(map(int, input().split())))\nans = 0; total_t = 0; total_a = 0;\nfor t, a in ratio:\n i = 1\n while total_t > t*i and total_a > a*i:\n i += 1\n ans = (t + a)*i\nprint(ans)', 'N = int(input())\nratio = []\nfor _ in range(N):\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s101358353', 's546440178', 's931580785', 's689423529'] | [3060.0, 3060.0, 3188.0, 3064.0] | [20.0, 21.0, 21.0, 21.0] | [250, 294, 272, 273] |
p03966 | u543954314 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['n = int(input())\nts, as = map(int, input().split())\nfor _ in range(n-1):\n t, a = map(int, input().split())\n m = max((ts-1)//t, (as-1)//a)+1\n ts = m*t\n as = m*a\nprint(ts+as)', 'n = int(input())\nt2, a2 = map(int, input().split())\nfor _ in range(n-1):\n t, a = map(int, input().split())\n m = max((t2-1)//t... | ['Runtime Error', 'Accepted'] | ['s594017679', 's753952929'] | [2940.0, 3060.0] | [18.0, 21.0] | [176, 176] |
p03966 | u585704797 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['N=int(input())\n \nX=[]\nfor i in range(N):\n a=input().split()\n X.append([int(a[0]),int(a[1])])\n \n \ndef ceil(x):\n if int(x)==x:\n return int(x)\n else:\n return int(x//1+1)\n \n \na=X[0][0]\nb=X[0][1]\n \nfor i in range(1,N):\n c=X[i][0]\n d=X[i][1]\n \n \n #print("i = "+str(i)+" a = "+str(a)+" b =... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s351355336', 's538990489', 's683111277', 's885441508', 's979207578'] | [3188.0, 3188.0, 3188.0, 2940.0, 3188.0] | [22.0, 22.0, 20.0, 17.0, 21.0] | [496, 423, 506, 643, 642] |
p03966 | u598755311 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['\ndef main():\n votes = int(input());\n ratio = [[ int(i) for i in input().split() ] for j in range(votes)]\n\n tak = aok = 0\n for i in range(votes):\n takTemp, aokTemp = ratio[i][0], ratio[i][1]\n\n while tak > takTemp or aok > aokTemp:\n takTemp += ratio[i][0]\n aok... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s018525833', 's075035887', 's294011160', 's451642612'] | [3472.0, 3444.0, 3444.0, 5204.0] | [2102.0, 2102.0, 2103.0, 94.0] | [550, 529, 552, 684] |
p03966 | u603234915 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['taka, aoki = 1, 1\nfor _ in range(int(input())):\n a, b = map(int, input().split())\n ratio = max(-(-taka//a), -(-aoki//b))\n print(ratio)\n taka = ratio * a\n aoki = ratio * b\nprint(taka + aoki)', 'taka, aoki = 1, 1\nfor _ in range(int(input())):\n a, b = map(int, input().split())\n ratio = max... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s069453743', 's561153316', 's472589266'] | [3060.0, 3060.0, 3060.0] | [26.0, 27.0, 20.0] | [204, 245, 130] |
p03966 | u619819312 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['n=int(input())\na,b=map(int,input().split())\nfor i in range(n-1):\n e,f=map(int,input().split())\n t=e\n k=f\n while e<a or f<b:\n t+=e\n k+=f\n a=t\n b=k\nprint(a+b)', 'from itertools import gcd\nn=int(input())\na,b=map(int,input().split())\nd=a+b\nfor i in range(n-1):\n e,f=map(i... | ['Time Limit Exceeded', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s277524184', 's535292322', 's840222541', 's662738778'] | [3064.0, 3060.0, 5048.0, 3064.0] | [2104.0, 19.0, 40.0, 22.0] | [188, 164, 164, 319] |
p03966 | u663710122 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['A, B = 1, 1\nfor _ in range(int(input())):\n x, y = map(int, input().split())\n n = max(-(-A // x), -(-B // y))\n A, B = n * x, n * y\n\n print(A, B)\n\nprint(A + B)\n', 'A, B = 1, 1\nfor _ in range(int(input())):\n x, y = map(int, input().split())\n n = max(-(-A // x), -(-B // y))\n A, B = n * x... | ['Wrong Answer', 'Accepted'] | ['s420586483', 's458687981'] | [3060.0, 2940.0] | [27.0, 21.0] | [170, 153] |
p03966 | u706414019 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['import math\nN = int(input())\nt= 1\na= 1\n\ndef t_small(t,a,t1,a1):\n gain = -(-t//t1)\n t = gain*t1\n a_tmp=gain*a1\n if a_tmp<a:\n gain_a = -(-a//a_tmp)\n t *= gain_a\n a = a_tmp*gain_a\n else:\n a = a_tmp\n return t,a,t+a\n\ndef a_small(t,a,t1,a1):\n gain = -(-a//a... | ['Runtime Error', 'Accepted'] | ['s566921579', 's326512635'] | [9240.0, 9112.0] | [26.0, 28.0] | [715, 716] |
p03966 | u766407523 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['import math\nN = int(input())\nans = 2\ntp, ap = 0, 0\nfor i in range(N):\n \n t, a = map(int, input().split())\n k = max(math.ceil(tp/t), math.ceil(ap/a))\n t, a = t*k, a*k\n c = math.ceil(ans/(t+a))\n while True:\n if (t+a)*c >= ans:\n ans = (t+a)*c\n break\n c ... | ['Runtime Error', 'Accepted'] | ['s365922089', 's848460460'] | [3316.0, 3316.0] | [19.0, 22.0] | [475, 257] |
p03966 | u792037966 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['import math\ndef results(a,b):\n return (a+b-1//b)\n \nn=int(input())\nt,a=map(int,input().split())\nfor i in range(1,n):\n ti,ai=map(int,input().split())\n if ti<=t or ai<=a:\n k=max(results(t,ti),results(a,ai))\n t=k*ti\n a=k*ai\n else:\n t=ti\n a=ai\n #print(t,a)\... | ['Wrong Answer', 'Accepted'] | ['s762997534', 's207238758'] | [3060.0, 3064.0] | [23.0, 21.0] | [315, 315] |
p03966 | u813102292 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['n = int(input())\nt,a = [],[]\nfor i in range(n):\n tmp = [int(i) for i in input().split()]\n t.append(tmp[0])\n a.append(tmp[1])\n\np,q = 0,0\nfor i in range(n):\n tmp = max(p//t[i]+1,q//a[i]+1)\n p = t[i]*tmp \n q = a[i]*tmp\nprint(p+q) ', 'n = int(input())\nt,a = [],[]\nfor i in range(n):\n t... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s186270958', 's423115519', 's621300780', 's757664228', 's151756744'] | [3064.0, 3060.0, 3064.0, 3064.0, 3064.0] | [21.0, 20.0, 17.0, 20.0, 21.0] | [246, 227, 232, 242, 250] |
p03966 | u859897687 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['n=int(input())\nm=0\nfor _ in range(n):\n a,b=map(int,input().split())\n m=(m%(a+b)+m%(a+b)>0)*(a+b)\nprint(m)', 'n=int(input())\nm=2\nfor _ in range(n):\n a,b=map(int,input().split())\n m=(m%(a+b)+m%(a+b)>0)*(a+b)\nprint(m)', 'n=int(input())\nm=2\nfor _ in range(n):\n a,b=map(int,input().split())\n m=(m//(a+b)... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s038362148', 's365313035', 's413814707', 's935417452', 's414498989'] | [2940.0, 2940.0, 2940.0, 3060.0, 3060.0] | [21.0, 20.0, 20.0, 23.0, 21.0] | [107, 107, 108, 138, 142] |
p03966 | u888337853 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ["import sys\nimport math\nimport collections\nimport bisect\nimport itertools\n\n# import numpy as np\n\nsys.setrecursionlimit(10 ** 7)\nINF = 10 ** 20\nMOD = 10 ** 9 + 7\n# MOD = 998244353\n\nni = lambda: int(sys.stdin.readline().rstrip())\nns = lambda: map(int, sys.stdin.readline().rstrip().split())\nna = lambda: li... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s028873771', 's191050381', 's330038419', 's469077584', 's289175325'] | [9360.0, 9280.0, 9496.0, 9380.0, 9472.0] | [33.0, 33.0, 32.0, 31.0, 30.0] | [856, 931, 797, 860, 943] |
p03966 | u926678805 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['import math\nn=int(input())\nlog=[]\nH=[]\nfor i in range(n):\n log.append(tuple(map(int,input().split())))\nt,a=1,1\nfor x,y in log:\n nxt=max((t/x+0.5)//1,(a/y+0.5)//1)\n t=x*nxt\n a=y*nxt\nprint(t+a)', 'from decimal import *\nn=int(input())\nlog=[]\nH=[]\nfor i in range(n):\n log.append(tuple(map(in... | ['Wrong Answer', 'Accepted'] | ['s472957312', 's106089915'] | [3064.0, 5076.0] | [22.0, 37.0] | [203, 237] |
p03966 | u993435350 | 2,000 | 262,144 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | ['N = int(input())\nP = [0,0]\n\nfor i in range(N):\n Q = list(map(int,input().split()))\n t = Q[0]\n a = Q[1]\n m = max(P[0]/t,P[1]/a)\n while True:\n t = Q[0] * m\n a = Q[1] * m\n if t >= P[0] and a >= P[1]:\n P[0] = t\n P[1] = a\n break\n m += 1\n\nprint(sum(P))', 'N = int(input())\nP... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s623913813', 's923071355', 's393378358'] | [3064.0, 3064.0, 3064.0] | [24.0, 21.0, 22.0] | [278, 280, 282] |
p03967 | u095756391 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ["s = input()\n\nsubsg = []\nsubsp = []\n\nsg = 0\nsp = 0\nans = 0\nfor i in range(N):\n if s[i] == 'g':\n sg += 1\n else:\n sp += 1\n subsg.append(sg)\n subsp.append(sp)\n\nfor i in range(N):\n if subsp <= subsg:\n ans += 1\n \nprint(ans)", "s = input()\n\nsg = 0\nsp = 0\nans = 0... | ['Runtime Error', 'Accepted'] | ['s561936363', 's655428026'] | [3316.0, 3316.0] | [17.0, 60.0] | [256, 287] |
p03967 | u102960641 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ['s = input()\nt_s = n.count("p")\na_s = len(s) // 2\nprint(a_s-t_s)', 's = input()\nt_s = s.count("p")\na_s = len(s) // 2\nprint(a_s-t_s)'] | ['Runtime Error', 'Accepted'] | ['s986511357', 's785205029'] | [3188.0, 3188.0] | [17.0, 18.0] | [63, 63] |
p03967 | u118642796 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ['S = input()\nans = 0\nfor i in range(S):\n if i%2 == 0 and S[i] == "g":\n ans += 1\n elif i%2 == 1 and S[i] == "p":\n ans -= 1\nprint(ans)', 'S = input()\nans = 0\nfor i in range(len(S)):\n if i%2 == 0 and S[i] == "g":\n ans += 1\n elif i%2 == 1 and S[i] == "p":\n ans -= 1\nprint(ans)', 'S = input()\n... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s267749007', 's676746758', 's720419358'] | [3188.0, 3316.0, 3316.0] | [18.0, 48.0, 50.0] | [139, 144, 144] |
p03967 | u316386814 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ["s = input()\n\nans = 0\nfor i, x in enumerate(s):\n if i % 2 == 1 and x == 'p':\n ans -= 1\n elif i % 2 == 0 and x == 'g':\n ans += 1\n\nprint(ans)", "s = input()\n\nans = len(s) // 2 - s.count('p')\n\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s424618696', 's950940484'] | [3316.0, 3188.0] | [48.0, 18.0] | [158, 57] |
p03967 | u370608397 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ["s=input()\ndif=0\nfor i in range(len(s)):\n if s[i]=='g':\n dif+=1\n else:\n dif-=1\nprint(dif/2)\n", "s=input()\ndif=0\nfor i in range(len(s)):\n if s[i]=='g':\n dif+=1\n else:\n dif-=1\nprint(dif//2)"] | ['Wrong Answer', 'Accepted'] | ['s538463710', 's007580265'] | [3188.0, 3188.0] | [37.0, 36.0] | [111, 111] |
p03967 | u371763408 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ["s=input()\n\ngu=0\npa=0\nwin=0\n\nfot t in s:\n if t=='g':\n if gu>pa:\n pa+=1\n win+=1\n else:\n gu+=1\n else:\n if gu>pa:\n pa+=1\n else:\n win-=1\n gu+=1\nprint(win)\n \n ", "s=input()\n\ngu=0\npa=0\nwin=0\n\nfor t in s:\n if t=='g':\n if gu>pa:\n pa+=1\... | ['Runtime Error', 'Accepted'] | ['s704206397', 's417153818'] | [2940.0, 3316.0] | [17.0, 41.0] | [205, 205] |
p03967 | u405660020 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ["s=input()\ncnt=0\nfor i in range(len(s)):\n if i%2==0 and s[i]=='g':\n cnt+=1\n elif i%2==0 and s[i]=='p':\n pass\n elif i%2==1 and s[i]=='g':\n pass\n else:\n cnt-=1\nprint(cnt)\n", "s=input()\ncnt=0\nfor i in range(len(s)):\n if i%2==1 and s[i]=='g':\n cnt+=1\n e... | ['Wrong Answer', 'Accepted'] | ['s071415449', 's150029525'] | [3316.0, 3316.0] | [59.0, 55.0] | [208, 208] |
p03967 | u543954314 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ['s = input()\nm = "gp"*(len(s)//2+1)\ng = 0\nfor i in range(s):\n if s[i] == m[i]:\n continue\n elif s[i] == "p":\n g -= 1\n else:\n g += 1\nprint(g)', 's = input()\nprint(n//2-s.count("p"))', 's = input()\nprint(len(s)//2-s.count("p"))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s746093023', 's899546959', 's404027931'] | [3188.0, 3188.0, 3188.0] | [17.0, 17.0, 18.0] | [150, 36, 41] |
p03967 | u595893956 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ["s=input()\nprint((len(s)+1)//2-s.count('p'))", "s=input()\nprint((len(s))//2-s.count('p'))\n"] | ['Wrong Answer', 'Accepted'] | ['s805773146', 's722943546'] | [3188.0, 3188.0] | [18.0, 21.0] | [43, 42] |
p03967 | u606045429 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ['S = input()\nprint(-(-len(S) // 2) - S.count("p"))', 'S = input()\nprint(len(S) // 2 - S.count("p"))'] | ['Wrong Answer', 'Accepted'] | ['s181148802', 's796215197'] | [3188.0, 3188.0] | [17.0, 18.0] | [49, 45] |
p03967 | u678167152 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ["s = input()\ng = s.count('g')\np = s.count('p')\nprint(g-p)", "def solve():\n S = input()\n even = S[0::2]\n odd = S[1::2]\n ans = odd.count('g')-even.count('p')\n return ans\nprint(solve())"] | ['Wrong Answer', 'Accepted'] | ['s783386678', 's801701635'] | [3188.0, 3188.0] | [18.0, 18.0] | [56, 136] |
p03967 | u727801592 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ['s=input()\nprint(s)', "s=input()\nprint(len(s)//2-s.count('p'))"] | ['Wrong Answer', 'Accepted'] | ['s553114045', 's557941680'] | [3320.0, 3188.0] | [17.0, 17.0] | [18, 39] |
p03967 | u762540523 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ['s=input()\nans=0\nfor index,i in enumerate(s):\n if index%2==1:\n if i=="p":\n ans-=1\n else:\n if i=="g":\n ans+=1\nprint(ans)', 's=input()\nn=len(s)\nprint("gp"*(n//2)+"g"*(n%2))', 's=input()\nans=0\nfor index,i in enumerate(s):\n if index%2==0:\n if i=="p":\n ans-=1\n else:\n if i=="... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s214273174', 's929601543', 's372344622'] | [9080.0, 9232.0, 9160.0] | [47.0, 31.0, 48.0] | [136, 47, 136] |
p03967 | u767664985 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ['s = input()\ng_cnt, p_cnt = 0, 0\nans = 0\nfor si in s:\n if si = "g":\n if p_cnt < g_cnt:\n p_cnt += 1\n ans += 1\n else:\n g_cnt += 1\n ans -= 1\n else:\n g_cnt += 1\n ans += 1\nprint(ans)\n', 's = input()\ng_cnt, p_cnt = 0, 0\nans = 0\nf... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s581876328', 's889086956', 's227252636'] | [2940.0, 3316.0, 3316.0] | [17.0, 44.0, 39.0] | [255, 256, 306] |
p03967 | u780475861 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ["s = input()\n\ngrid = [0 if i == 'g' else 1 for i in s]\n\n\ndef biggest(grid):\n dist = [float('-inf')] * len(s)\n move = (0, 1)\n st = deque([[0, 0, 0, 0]])\n while st:\n g, p, idx, cur = st.popleft()\n if idx > len(s) - 1:\n continue\n for a in move:\n if a:\n... | ['Runtime Error', 'Accepted'] | ['s223734959', 's911834290'] | [4860.0, 3316.0] | [26.0, 23.0] | [779, 74] |
p03967 | u792078574 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | [' s=input()\n print((s.count("g")-s.count("p"))//2)', 's=input()\nprint((s.count("g")-s.count("p"))//2)\n'] | ['Runtime Error', 'Accepted'] | ['s936748404', 's770715201'] | [8892.0, 8988.0] | [26.0, 26.0] | [49, 48] |
p03967 | u798818115 | 2,000 | 262,144 | AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two _gestures_ , _Rock_ and _Paper_ , as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of ti... | ["# coding: utf-8\n# Your code here!\ns=list(input())\ncount=0\n\nfor i in range(len(s)):\n if s[i]=='g':\n s[i]=0\n else:\n s[i]=1\n print(s)\n if i&1^s[i]==1 and i&1==1:\n count+=1\n elif i&1^s[i]==1 and s[i]&1==1:\n count-=1\n else:\n pass\n\nprint(count)\n\n", "#... | ['Runtime Error', 'Accepted'] | ['s357656903', 's387722995'] | [136288.0, 4008.0] | [2103.0, 83.0] | [342, 328] |
p03986 | u010733367 | 1,000 | 262,144 | We have a string X, which has an even number of characters. Half the characters are `S`, and the other half are `T`. Takahashi, who hates the string `ST`, will perform the following operation 10^{10000} times: * Among the occurrences of `ST` in X as (contiguous) substrings, remove the leftmost one. If there is no o... | ['TSSTTTSS', 'st = []\nX = input()\nfor x in X:\n if not len(st) == 0:\n top = st.pop()\n if top == "S" and x == "T":\n continue\n else:\n st.append(top)\n st.append(x)\n else:\n st.append(x)\nprint(len(st))\n'] | ['Runtime Error', 'Accepted'] | ['s617707581', 's106136924'] | [3068.0, 5224.0] | [21.0, 124.0] | [8, 249] |
p03986 | u020390084 | 1,000 | 262,144 | We have a string X, which has an even number of characters. Half the characters are `S`, and the other half are `T`. Takahashi, who hates the string `ST`, will perform the following operation 10^{10000} times: * Among the occurrences of `ST` in X as (contiguous) substrings, remove the leftmost one. If there is no o... | ['#!/usr/bin/env python3\nimport sys\n# input = sys.stdin.readline\ndef INT(): return int(input())\ndef MAP(): return map(int,input().split())\ndef LI(): return list(map(int,input().split()))\n\ndef main():\n X = input()\n\n LENX = len(X)\n\n left_T = 0\n right_S = 0\n\n for i in range(LENX):\n if... | ['Wrong Answer', 'Accepted'] | ['s283831216', 's454814839'] | [3500.0, 3500.0] | [18.0, 47.0] | [574, 529] |
p03986 | u024804656 | 1,000 | 262,144 | We have a string X, which has an even number of characters. Half the characters are `S`, and the other half are `T`. Takahashi, who hates the string `ST`, will perform the following operation 10^{10000} times: * Among the occurrences of `ST` in X as (contiguous) substrings, remove the leftmost one. If there is no o... | ['s = input()\nwhile 1:\n s1 = s.replace(\'ST\',\'\',1)\n if len(s1) == len(s):\n break\n s = s1\nprint(str(len(s1)) + "\\n")\n', 'st = input()\nsc = 0\ntc = 0\nfor s in st:\n if s == "S":\n sc += 1\n if s == "T":\n if sc > 0:\n sc -= 1\n else:\n tc += 1\... | ['Time Limit Exceeded', 'Accepted'] | ['s341141667', 's998079632'] | [3500.0, 3500.0] | [1054.0, 57.0] | [129, 178] |
p03986 | u026155812 | 1,000 | 262,144 | We have a string X, which has an even number of characters. Half the characters are `S`, and the other half are `T`. Takahashi, who hates the string `ST`, will perform the following operation 10^{10000} times: * Among the occurrences of `ST` in X as (contiguous) substrings, remove the leftmost one. If there is no o... | ["s = input()\ncnt = 0\ncnt_set = 0\nfor x in S:\n if x == 'S':\n cnt += 1\n else:\n if cnt > 0:\n cnt_set += 1\n cnt -= 1\nprint(len(s)-2*cnt_set)", "s = input()\ncnt = 0\ncnt_set = 0\nfor x in s:\n if x == 'S':\n cnt += 1\n else:\n if cnt > 0:\n ... | ['Runtime Error', 'Accepted'] | ['s833247009', 's821773091'] | [3500.0, 3500.0] | [17.0, 51.0] | [177, 177] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.