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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03627 | u327466606 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['n = int(input())\ns = set()\nq = [0,0]\nimport heaps as hq\nfor a in map(int, input().split()):\n if a > q[0]:\n if a in s:\n del s[a]\n hq.heapreplace(q, a)\n else:\n s.add(a)\n\nprint(q[0]*q[1])', 'n = int(input())\ns = set()\nq = [0,0]\nimport heapq as hq\nfor a in map(int, input().split()):\... | ['Runtime Error', 'Accepted'] | ['s738447966', 's316534658'] | [3060.0, 20140.0] | [18.0, 101.0] | [206, 206] |
p03627 | u346308892 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['def spaceinput():\n return list(map(int,input().split(" ")))\n\n\nN=int(input())\na=spaceinput()\n\n\nsa=sorted(a,reverse=True)\nx=[]\ni=0\nwhile True:\n ssa=sa[i]\n if sa[i]==sa[i+1]:\n x.append(ssa)\n i+=2\n if len(x)==2:\n break\n\n i+=1\n if i>=len(sa):\n brea... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s012867251', 's122435087', 's478131883', 's514570933', 's679536714'] | [14224.0, 14480.0, 14244.0, 3060.0, 14252.0] | [107.0, 107.0, 102.0, 17.0, 114.0] | [334, 355, 301, 256, 367] |
p03627 | u346812984 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\nc = Counter(A)\nhen = [(key, val) for key, val in c.items() if val > 1]\n\nl = max(hen) if hen else 0\nif l != 0:\n if c[l] > 3:\n s = l\n else:\n hen.remove(l)\n s = max(hen) if hen else 0\nelse:\n ... | ['Runtime Error', 'Accepted'] | ['s390981951', 's023462159'] | [18600.0, 18600.0] | [73.0, 65.0] | [325, 318] |
p03627 | u348293370 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['n = int(input())\nnum_list = list(map(int, input().split()))\n\nset_list = list(set(num_list))\n\nfor i in range(len(set_list)):\n num_list.remove(set_list[i])\n\nnum_list.sort()\n\nprint(num_list)\n\nif len(num_list) >= 3:\n if num_list[-1] == num_list[-3]:\n print(num_list[-1]**2)\n elif num_list[-1... | ['Wrong Answer', 'Accepted'] | ['s079838195', 's553351041'] | [20432.0, 27784.0] | [2206.0, 118.0] | [562, 463] |
p03627 | u352067440 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['N = int(input())\ns1 = input()\ns2 = input()\nsum = 1\nmul = 1\nflag = 0\ni = 0\n\nwhile True:\n if i >= N:\n print(sum%1000000007)\n break\n\n elif s1[i]==s2[i] and flag==0:\n sum = 3\n i += 1\n flag = 1\n elif s1[i]!=s2[i] and flag==0:\n sum = 6\n i += 2\n ... | ['Runtime Error', 'Accepted'] | ['s765804896', 's257979325'] | [5744.0, 14252.0] | [25.0, 94.0] | [663, 379] |
p03627 | u354916249 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['N = int(input())\nA = list(map(int, input().split()))\n\nA.sort(reverse=True)\ncount = 0\nW = 0\nH = 0\nans = 0\n\nfor i in range(N-1):\n if A[i+1] == A[i]:\n count += 1\n if W == 0:\n if count == 2:\n W = A[i]\n count = 0\n if H == 0:\n if c... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s324441466', 's674696533', 's154334000'] | [14244.0, 14244.0, 14252.0] | [107.0, 43.0, 89.0] | [350, 307, 200] |
p03627 | u371132735 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['N = int(input())\nimport collections\nA = list(map(int,input().split()))\nC = collections.Counter(A)\nuse = []\nfor i,val in C.items():\n if val > 4:\n use.append(i)\n if val > 2:\n use.append(i)\n\nuse = sorted(use,reverse= True)\nif len(use)==0:\n print(0)\nelse:\n print(use[0]*use[1])', 'N = int(input())... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s222009770', 's700043983', 's534250296'] | [18600.0, 18600.0, 18600.0] | [73.0, 76.0, 78.0] | [283, 283, 284] |
p03627 | u383450070 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import collections\nn=int(input())\nA=list(map(int,input().split()))\na=collections.Counter(A)\nfirstnum=0\nsecondnum=0\nfirstl=0\nsecondl=0\nfor i,j in a.items():\n if i>=firstl and j%2>=0:\n secondnum=firstnum\n firstnum=j\n secondl=firstl\n firstl=i\n elif secondl<=i<firstl and j%2>=0:\n secondnum... | ['Wrong Answer', 'Accepted'] | ['s952215959', 's629172872'] | [18600.0, 28556.0] | [77.0, 141.0] | [345, 416] |
p03627 | u386089355 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import collections\n\nn = int(input())\nls = list(map(int, input().split()))\n\nc = collections.Counter(ls)\n\nls_s = c.most_common()\nls_s.sort(reverse=True)\n\nmul = []\n\nfor i in range(len(ls_s)):\n if ls_s[i][1] >= 4:\n if len(mul) == 0:\n print(ls_s[i][0] ** 2)\n break\n e... | ['Runtime Error', 'Accepted'] | ['s580952275', 's660788928'] | [2940.0, 21668.0] | [17.0, 238.0] | [551, 551] |
p03627 | u392319141 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\nN = int(input())\ncnt = Counter(map(int, input().split()))\n\nL = sum([[] for a, c in cnt.items()], [])\nL.sort()\n\nans = 0 if len(L) < 2 else L[-1] * L[-2]\nprint(ans)\n', 'from collections import Counter\nN = int(input())\ncnt = Counter(map(int, input().split()))\n\nL = sum([[1] fo... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s325567379', 's774588618', 's778120354', 's858537667'] | [24104.0, 24104.0, 24104.0, 24104.0] | [90.0, 2105.0, 2104.0, 90.0] | [195, 196, 155, 217] |
p03627 | u419963262 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\n\nn = int(input())\nA = list(map(int, input().split()))\n\nB = set(A)\nA = Counter(A)\nprint(A)\nans = 0\nkeep = 0\n\nfor i in B:\n kazu = A[i]\n if kazu >= 4:\n ans = i**2\n keep = i\n elif kazu >= 2:\n ans = keep * i\n keep = i\nprint(ans)\n', 'f... | ['Wrong Answer', 'Accepted'] | ['s643927681', 's512032910'] | [37468.0, 28584.0] | [156.0, 114.0] | [293, 306] |
p03627 | u422272120 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['n = int(input())\na = list(map(int,input().split()))\nl = []\nfor v in set(a):\n x = a.count(v)\n if x >= 2:\n l.append(x)\nif len(l) < 2:\n print (0)\n exit()\n\nl.sort()\nprint (l[0]*l[1])', 'from collections import Counter\n\nn = int(input())\na = list(map(int,input().split()))\na_count = sorted... | ['Wrong Answer', 'Accepted'] | ['s565651329', 's985923714'] | [14352.0, 21412.0] | [2104.0, 189.0] | [197, 393] |
p03627 | u426649993 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['if __name__ == "__main__":\n n = int(input())\n a = list(map(int, input().split()))\n\n sidelist = OrderedDict()\n\n for aa in a:\n if a.count(aa) >= 2:\n if aa not in sidelist:\n sidelist[aa] = 1\n else:\n sidelist[aa] += 1\n\n side_a = 0\n ... | ['Runtime Error', 'Accepted'] | ['s881384346', 's217943061'] | [14244.0, 14252.0] | [49.0, 85.0] | [743, 487] |
p03627 | u440161695 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\nm1,m2=0,0\nN=int(input())\nA=Counter(list(map(int,input().split())))\nkey=sorted(A.keys(),reverse=True)\nfor i in key:\n if A[i]>1 and m1==0:\n m1=A[i]\n if m1!=0 and A[i]>1:\n print(m1*A[i])\n exit()\nprint(0)', 'from collections import Counter\nm1=0\nN=int(input())\nA=Cou... | ['Wrong Answer', 'Accepted'] | ['s649975083', 's389442379'] | [18600.0, 18600.0] | [123.0, 128.0] | [243, 280] |
p03627 | u464205401 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import collections\nn = int(input())\na = list(map(int,input().split()))\nc = sorted(collections.Counter(a).items(),reverse = True)\n\nnum2=[]\nnum4=[]\n\nfor k in c:\n if k[1]>=4:\n num4.append(k[0])\n if k[1]>=2:\n num2.append(k[0])\n\nif len(num2)>=2 or len(num4)>=1:\n print(max(num2[0]*num2[1],num4[0]**2... | ['Runtime Error', 'Accepted'] | ['s029323765', 's517549999'] | [25720.0, 25728.0] | [134.0, 134.0] | [323, 351] |
p03627 | u473291366 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['N = int(input())\nA = list(map(int,input().split()))\nA.sort(reverse=True)\n\nmax_1 = 0\nlen_a = len(A)\nfor i, a in enumerate(A):\n if len_a - i >= 4:\n if A[i] == A[i+1] and A[i+1] == A[i+2] and A[i+2] == A[i+3]:\n if max_1 == 0:\n print(A[i] ** 2)\n exit()\n ... | ['Wrong Answer', 'Accepted'] | ['s050176513', 's889924382'] | [14100.0, 14672.0] | [79.0, 117.0] | [594, 610] |
p03627 | u477977638 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import sys\n\nread = sys.stdin.buffer.read\ninput = sys.stdin.buffer.readline\ninputs = sys.stdin.buffer.readlines\n\n# rstrip().decode(\'utf-8\')\n# map(int,input().split())\n# import numpy as np\n\nfrom collections import defaultdict\n\ndef main():\n\td=defaultdict(int)\n\t\n\tn=int(input())\n\tA=list(map(int,input... | ['Runtime Error', 'Accepted'] | ['s909009525', 's899965850'] | [18352.0, 12992.0] | [91.0, 83.0] | [638, 539] |
p03627 | u479638406 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\ndef solve():\n n = int(input())\n a = list(map(int, input().split()))\n\n l = Counter(a)\n tw = []\n fo = []\n for i,j in l.items():\n if j >= 2:\n tw.append(i)\n if j >= 4:\n fo.append(i)\n\n if len(tw) >= 2 or len(fo) >= 1:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s334031082', 's611588949', 's233082733'] | [18600.0, 18600.0, 18600.0] | [73.0, 77.0, 75.0] | [431, 403, 457] |
p03627 | u509739538 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import defaultdict\nfrom collections import deque\nimport itertools\nimport math\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\n\nd = defaultdict(int)\nn = readInt()\nf... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s008452191', 's450162599', 's865998096'] | [9144.0, 28820.0, 25680.0] | [28.0, 152.0, 122.0] | [571, 512, 572] |
p03627 | u524870111 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby\nfrom math import floor, ceil, sqrt, factorial, log\nfrom bisect import bisect_left, bisect_right\nfrom collections import Counter, defaultdict\nfrom heapq import heappop, heappush, heappushpop\nfrom itertool... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s684154549', 's881866451', 's427253474'] | [14636.0, 14632.0, 14616.0] | [137.0, 140.0, 136.0] | [762, 761, 766] |
p03627 | u536113865 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['n = int(input())\na = input()\nb = input()\n\nans = 3\ni = 0\nif a[0] != b[0]:\n i += 1\n ans += 3\n\nwhile i < n-1:\n if a[i]==b[i]:\n if a[i+1]==b[i+1]:\n ans *= 2\n else:\n ans *= 2\n i += 1\n else:\n if a[i+1]==b[i+1]:\n ans *= 1\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s265475850', 's542386841', 's469036728'] | [5156.0, 18216.0, 18216.0] | [19.0, 81.0, 81.0] | [390, 261, 262] |
p03627 | u581187895 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\n\ninput()\narr = Counter(list(map(int,input().split())))\nans = [0,0]\nfor a in arr:\n print(a)\n if arr[a] > 1:\n ans.append(a)\n if arr[a] > 3:\n ans.append(a)\nans.sort()\nprint(ans[-1] * ans[-2])', 'from collections import Counter\n\ninput()\narr = Counter(list(map(int,in... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s070861330', 's307559336', 's465788053', 's671065704', 's642045201'] | [18600.0, 18600.0, 24612.0, 24456.0, 18600.0] | [185.0, 159.0, 214.0, 238.0, 94.0] | [229, 197, 327, 342, 220] |
p03627 | u587589241 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['n=int(input())\na=list(map(int,input().split()))\nb=sorted(a,reverse=True)\nc=set(b)\nd=sorted([i for i in c],reverse=True)\nflag1=False\nflag2=False\nfor i in d:\n if b.count(i)>=4:\n print(i**2)\n break\n exit()\n elif flag1==False and flag2==False and b.count(i)>=2:\n tmp1=i\n ... | ['Wrong Answer', 'Accepted'] | ['s969021670', 's025828304'] | [14892.0, 14636.0] | [2104.0, 102.0] | [469, 393] |
p03627 | u597455618 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import collections\n\nn = int(input())\na = collections.Counter(list(map(int, input().split())))\n\nf = []\nt = []\nfor i in a:\n if a[i] >= 4:\n f.append(i)\n if a[i] >= 2:\n t.append(i)\nfa, ta = 0, 0\nf.sort()\nt.sort()\nif len(f) >= 1:\n fa = f[-1]**2\nif len(t) >= 2:\n ta = max(t[-1]*t[... | ['Runtime Error', 'Accepted'] | ['s758903526', 's374535808'] | [18600.0, 18728.0] | [95.0, 79.0] | [336, 250] |
p03627 | u620846115 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import collections\nn = int(input())\nalist = list(map(int,input().split()))\nadic = collections.Counter(alist)\nfor k,v in adic.items():\n if v == 1:\n del(adic[k])\nsort_adic = sorted(adic.items(), reverse = True, key = lambda x:x[1])\nli = list(sort_adic.items())\nprint(li[0][0]*li[1][0])', 'import collections... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s040708066', 's125358459', 's313761894', 's478643634', 's535415390', 's888071492', 's589177877'] | [22140.0, 22212.0, 8832.0, 8968.0, 22044.0, 8896.0, 22292.0] | [64.0, 62.0, 19.0, 22.0, 76.0, 24.0, 84.0] | [287, 287, 280, 286, 250, 281, 252] |
p03627 | u622011073 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\ninput();a=sorted(Counter(map(int,input().split())).most_common())[::-1];c=b=0\nfor i in range(len(set(a))):\n if b and c:print(c*b);exit()\n if a[i][1]>3 and a[i][0]*c<a[i][0]**2:b=c=a[i][0]\n elif a[i][1]>1:b,c=c,a[i][0]', 'from collections import Counter\ninput();a=sorted(C... | ['Wrong Answer', 'Accepted'] | ['s591749092', 's623058117'] | [24104.0, 24104.0] | [215.0, 218.0] | [258, 257] |
p03627 | u623687794 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collcections import Counter\nn=int(input())\nl=list(map(int,input().split()))\nd=[]\nL=Counter(l)\na=L.most_common()\nfor i in a:\n if a[i][1]>=4:\n d.append(a[i][1])\n d.append(a[i][1])\n elif a[i][1]>=2:\n d.append(a[i][1])\nd.sort(reverse=True)\nprint(d[0]*d[1] if len(d)>=2 else 0)', 'from collecti... | ['Runtime Error', 'Accepted'] | ['s076295372', 's262552904'] | [3064.0, 21668.0] | [18.0, 121.0] | [288, 300] |
p03627 | u686036872 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import collections\nN = int(input())\nA=sorted(list(map(int, input().split())))\na = collections.Counter(A)\nans = 0\ny = 0\nfor i in a.keys():\n if a[i] >= 2:\n x = y*i\n y = i\n if a[i] >= 4:\n z = i**2\n ans = max(ans, x, z)\nprint(ans)', 'from collections import Counter\n\nN = int(in... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s000952523', 's261316715', 's588206489', 's752238327', 's960892843', 's497974456'] | [18728.0, 18600.0, 18728.0, 18728.0, 14636.0, 18592.0] | [98.0, 62.0, 97.0, 97.0, 45.0, 88.0] | [256, 216, 258, 256, 216, 253] |
p03627 | u686254986 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['n = int(input())\na = sorted(list(map(int, input().split())), reverse=True)\nl = [0,0]\ncount = 0\nfor j in range(len(a)-1):\n if(count => 2):\n print(l[0] * l[1])\n exit()\n if(a[j] == a[j+1]):\n del l[0]\n l.append(a[j])\n j += 1\n count += 1', 'n = int(input())\na = ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s023227086', 's032912317', 's054571230', 's303184850', 's315414468', 's383834435', 's528481531', 's618945873', 's835861431', 's190342713'] | [3060.0, 2940.0, 2940.0, 2940.0, 15020.0, 14252.0, 14224.0, 2940.0, 2940.0, 14252.0] | [17.0, 17.0, 17.0, 17.0, 100.0, 100.0, 217.0, 17.0, 17.0, 117.0] | [280, 279, 265, 261, 282, 246, 253, 253, 257, 303] |
p03627 | u696449926 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['N = int(input())\na = list(map(int, input().split()))\n\na = sorted(a)\ni = len(a) - 1\nb = []\n\nwhile (i >= 1):\n\tif (a[i] == a[i - 1]):\n\t\tb.append(a[i - 1])\n\t\ti -= 2\n\n\ti -= 1\n\n\tif(len(b) == 2):\n\t\tbreak\n\n\nif(len(b) == 2):\n\tprint(b[0]*b[1])\n\nelse:\n\tprint(0)', 'N = int(input())\na = list(map(... | ['Wrong Answer', 'Accepted'] | ['s459266878', 's341814659'] | [14252.0, 14224.0] | [100.0, 108.0] | [250, 262] |
p03627 | u698176039 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import collections\n\nN = int(input())\nA = list(map(int,input().split()))\nA.sort(reverse = True)\nc = collections.Counter(A)\n\ntmp = []\nfor i in c:\n print(i,c[i])\n if c[i] >= 4:\n tmp += [i]\n break\n elif c[i] >= 2:\n tmp += [i]\n if len(tmp) == 2:\n break\n \nif len... | ['Wrong Answer', 'Accepted'] | ['s736943079', 's482563710'] | [18600.0, 18600.0] | [135.0, 179.0] | [409, 421] |
p03627 | u724742135 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\nfrom sys import stdin\nN = int(stdin.readline().rstrip())\nA = Counter([int(_) for _ in stdin.readline().rstrip().split()]).most_common()\nA.sort(reverse=True)\nif A[0][1] < 2 or A[1][1] < 2:\n print(0)\nelse:\n print(A[0][0]*A[1][0])', 'import sys\nfrom collections import Count... | ['Wrong Answer', 'Accepted'] | ['s269862901', 's382102996'] | [21388.0, 21412.0] | [178.0, 103.0] | [265, 346] |
p03627 | u750651325 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import re\nimport sys\nimport math\nimport itertools\nimport bisect\nfrom copy import copy\nfrom collections import deque,Counter\nfrom decimal import Decimal\nimport functools\ndef v(): return input()\ndef k(): return int(input())\ndef S(): return input().split()\ndef I(): return map(int,input().split())\ndef X(): r... | ['Wrong Answer', 'Accepted'] | ['s446590592', 's578408291'] | [22080.0, 22052.0] | [75.0, 82.0] | [818, 809] |
p03627 | u761989513 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['n = int(input())\na = list(map(int, input().split()))\nac = sorted(list(set(a)))\nans = []\nfor i in ac[::-1]:\n c = a.count(i)\n if len(ans) == 2:\n print(ans[0] * ans[1])\n exit()\n if not ans and c >= 4:\n print(i ** 2)\n exit()\n if c >= 2:\n ans.append(i)\nprint(0)'... | ['Wrong Answer', 'Accepted'] | ['s367006828', 's384140052'] | [14252.0, 18600.0] | [2104.0, 94.0] | [303, 308] |
p03627 | u762420987 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\nN = int(input())\nAc = Counter(list(map(int, input().split())))\nover2 = [ele for ele in Ac.items() if ele[1]>=2]\nif len(over2) == 0:\n print(0)\nelif len(over2) == 1:\n if over2[0][1] >= 4:\n print(over2[0][0]**2)\nelse:\n over2.sort()[::-1]\n if over2[0][1] >= 4:\n print(... | ['Runtime Error', 'Accepted'] | ['s489962500', 's682542516'] | [18600.0, 18600.0] | [94.0, 139.0] | [364, 361] |
p03627 | u769870836 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['n=int(input())\nl=list(map(int,input().split()))\nimport collections\nc = collections.Counter(l)\nans1=[]\nans2=[]\nfor x in c.keys():\n if c[x]>1:\n ans1.append(x)\n if c[x]>3:\n ans2.append(x)\nans1.sort()\nif len(ans1)<2:\n print(0)\nelse:\n print(max(ans1[-1]*ans1[-2],max(ans2)**2))', 'n=int(input())\nl... | ['Runtime Error', 'Accepted'] | ['s248940666', 's077741227'] | [18320.0, 18216.0] | [100.0, 99.0] | [282, 283] |
p03627 | u780475861 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\n_, *lst = map(int, input().split())\nstick = [i for i, j in Counter(lst).items() if j > 1]\nif len(stick) > 1:\n stick.sort()\n print(stick[-1] * stick[-2])\nelse:\n print(0)\n ', 'from collections import Counter\n_, *lst = map(int, open(0).read().split())\nc = Counter(lst).items(... | ['Wrong Answer', 'Accepted'] | ['s097933518', 's804026541'] | [3316.0, 18528.0] | [21.0, 76.0] | [206, 318] |
p03627 | u780962115 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import collections\nn=int(input())\nlists=list(map(int,input().split()))\nA=dict(collections.Counter(lists))\ndictdict=[]\nfor j in A.keys():\n for _ in range(A[j]//2):\n dictdict.append(j)\nA=sorted(A,reverse=True)\nprint(A[0]*A[1])\n', '\nimport collections\nn=int(input())\nlists=list(map(int,input().spli... | ['Wrong Answer', 'Accepted'] | ['s624774563', 's609507598'] | [21668.0, 21668.0] | [139.0, 94.0] | [235, 339] |
p03627 | u784022244 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\nN=int(input())\nA=list(map(int ,input().split()))\nD=Counter(A)\n#print(D.items())\nL=[]\nfor num, v in D.items():\n if v>=4:\n L.append((num,4))\n elif v>=2:\n L.append((num, 2))\n\nL=sorted(L, reverse=True)\nif len(L)==0:\n print(0)\n exit()\nelif len(L)==1... | ['Wrong Answer', 'Accepted'] | ['s876045915', 's477904223'] | [18600.0, 18600.0] | [101.0, 103.0] | [549, 549] |
p03627 | u785205215 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ["from sys import stdin, stdout\ndef readLine_int_list():return list(map(int, stdin.readline().split()))\n\n\ndef main():\n n = int(input())\n a = sorted(readLine_int_list(),reverse=True)\n\n pair = []\n ans = 0\n t = 1\n\n for i in range(n-1):\n \n if a[i] == a[i+1]:\n t += 1... | ['Wrong Answer', 'Accepted'] | ['s400797526', 's591850300'] | [14512.0, 14624.0] | [93.0, 88.0] | [622, 757] |
p03627 | u785578220 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['a = int(input())\nx = list(map(int, input().split()))\nt = x[0]\nx.sort()\nx = x[::-1]\nk = []\nfor i in range(1,a):\n if t == x[i]:\n k.append(x[i])\n t = x[i]\nif len(k)>=2:\n print(k[0]*k[1])\nelse:print(0)\n', 'n = int(input())\nA = list(map(int,input().split()))\n\nA.sort(reverse=True)\n\nfrom co... | ['Wrong Answer', 'Accepted'] | ['s856801503', 's021416741'] | [14252.0, 14252.0] | [106.0, 136.0] | [214, 382] |
p03627 | u802963389 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['# C - Make a Rectangle\n\n\nfrom collections import Counter\n\nn = int(input())\nA = list(map(int, input().split()))\n\nC = sorted(list(Counter(A).items()), key=lambda x: -x[0])\n\nprint(C)\n\nans = 0\nfor k, v in C:\n if v >= 4:\n if ans == 0:\n print(k ** 2)\n else:\n print(ans * k)\n exit()\n ... | ['Wrong Answer', 'Accepted'] | ['s508207899', 's980786338'] | [21412.0, 21412.0] | [210.0, 168.0] | [464, 454] |
p03627 | u813174766 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['n=int(input())\na=list(map(int,input().split()))\nx=[0]*(1e9+10)\nedge=[0]*2\nfor i in a:\n x[i]+=1\n if x[i]==2:\n edge.append(i)\n x[i]=0\nedge.sort(reverse=True)\nprint(edge[0]*edge[1])', 'n=int(input())\na=list(map(int,input().split()))\nx={}\nedge=[0]*2\nfor i in a:\n if i in x:\n x[i]+=1\n if x[i... | ['Runtime Error', 'Accepted'] | ['s283657905', 's234359008'] | [14252.0, 17960.0] | [41.0, 94.0] | [186, 216] |
p03627 | u814986259 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['N=int(input())\nimport collections\nA=list(map(int,input().split()))\n\ntable=collections.defaultdict(int)\nfor x in A:\n table[x]+=1\ntable=list(table.items())\ntable=[table[i][0] for i in range(N) if table[i][1]>1]\ntable.append(0)\ntable.append(0)\ntable.sort(reverse=True)\nprint(table[0]*table[1])\n ', 'im... | ['Runtime Error', 'Accepted'] | ['s566073116', 's049549057'] | [21336.0, 18592.0] | [110.0, 96.0] | [299, 284] |
p03627 | u820351940 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['input()\na=sorted(list(map(int,input().split())))\ne=[1 for x in range(10**9+1)]\nr=[]\nfor i in a:\n if e[i]:\n e[i]=0\n else:\n e[i]=1\n r.append(i)\nprint(0 if len(r) < 2 else r[-1] * r[-2])', 'input()\na=sorted(list(map(int,input().split())))\ne={}\nr=[]\nfor i in a:\n if not e.get(i):\n e[i]=1\n ... | ['Time Limit Exceeded', 'Accepted'] | ['s737683146', 's633613246'] | [529608.0, 18088.0] | [2130.0, 108.0] | [194, 177] |
p03627 | u836737505 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\nn = int(input())\na = list(map(int,input().split()))\na = Counter(a)\nb = []\nfor i,j in a:\n if j >=4:\n b.append(i)\n b.append(i)\n elif j >= 2:\n b.append(i)\nb.sort()\nif len(b)>=2:\n print(b[-1]*b[-2])\nelse:\n print(0)', 'from collections import ... | ['Runtime Error', 'Accepted'] | ['s312068516', 's040076411'] | [18592.0, 21668.0] | [59.0, 112.0] | [275, 266] |
p03627 | u846372029 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['# Make a Rectangle\nn = int(input())\na = list(map(int, input().split()))\n\nsorted(a, reverse = True)\na.append(0)\na.append(0)\na.append(0)\na.append(0)\n#print(a)\n\ni = 0\ns = 1\ncnt=0\nwhile i<n-1 and cnt <2:\n if (a[i]==a[i+1]):\n s*=a[i]\n i+=2\n cnt+=1\n else:\n i+=1\nprint(s... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s260397615', 's847122887', 's821677415'] | [14224.0, 14672.0, 14244.0] | [110.0, 115.0, 112.0] | [298, 298, 294] |
p03627 | u848647227 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['a = int(input())\nar = list(map(int,input().split(" ")))\nar = sorted(ar,reverse=True)\nA = 0\nB = 0\nj = 0\nwhile True:\n if A != 0 and B != 0:\n break\n if j == a - 1:\n break\n if ar[j] == ar[j+1] and A == 0:\n A = ar[j]\n j += 1\n elif ar[j] == ar[j+1] and A != 0:\n ... | ['Runtime Error', 'Accepted'] | ['s574722606', 's011780335'] | [14252.0, 18600.0] | [176.0, 77.0] | [368, 318] |
p03627 | u888092736 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\n\n\nN = int(input())\nc = Counter(map(int, input().split()))\nusables = sorted([(k, v) for k, v in c.items() if v >= 2])\nif len(usables) <= 1:\n print(0)\nelse:\n if usables[-1][2] >= 4:\n print(usables[-1][1] ** 2)\n else:\n print(usables[-1][1] * usables[-2][... | ['Runtime Error', 'Accepted'] | ['s435712312', 's502970035'] | [24224.0, 24232.0] | [95.0, 70.0] | [310, 445] |
p03627 | u931462344 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['N = int(input(()))\nA = list(map(int, input().split()))\n\nA.sort(reverse=True)\ntmp = 0\ntate = 0\nyoko = 0\ncnt = 0\nfor i in A:\n if tmp == i and cnt == 0:\n tate = i\n cnt += 1\n tmp = 0\n continue\n if tmp == i and cnt == 1:\n yoko = i\n cnt += 1\n if cnt == 2:\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s292509048', 's395311168', 's990560509'] | [14244.0, 14252.0, 14252.0] | [91.0, 88.0, 89.0] | [343, 326, 325] |
p03627 | u944325914 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['a=list(map(int,input().split()))\nfrom collections import Counter\nac=Counter(a)\nv=sorted(ac.items(),reverse=1)\nans=[]\nans1=[]\n\nfor i in range(len(ac)):\n if v[i][1]>=2:\n ans.append(v[i][0])\n if v[i][1]>=4:\n ans1.append(v[i][0])\nif len(ans)>=2:\n if len(ans1)>=1:\n print(max(ans[0]*ans[1],ans1[... | ['Wrong Answer', 'Accepted'] | ['s578397377', 's330703494'] | [9424.0, 26120.0] | [31.0, 145.0] | [426, 440] |
p03627 | u944643608 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nA.reverse()\nans_lis = []\ncount = 1\nbefore = A[0]\nfor i in range(1,N):\n tmp = A[i]\n if tmp == before:\n count += 1\n else:\n if count == 2 or count == 3:\n ans_lis.append(before)\n elif count >= 4 and len(ans_lis) == 0:\n ans_... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s188135326', 's288717949', 's511630754', 's558091192', 's925196847'] | [14252.0, 14668.0, 14480.0, 14224.0, 14672.0] | [109.0, 120.0, 115.0, 114.0, 119.0] | [488, 479, 560, 478, 775] |
p03627 | u946386741 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['N = int(input())\nA = sorted(list(map(int, input().split())))\nL = [0 for i in range(max(A) + 1)]\nres = []\nfor a in A:\n L[a] += 1\n\nfor i, l in enumerate(L):\n if l > 4:\n res.append(i)\n res.append(i)\n break\n elif l > 2:\n res.append(i)\n else:\n res.append(0)\n\n... | ['Wrong Answer', 'Accepted'] | ['s739445761', 's889316928'] | [527884.0, 14252.0] | [2131.0, 90.0] | [389, 339] |
p03627 | u957872856 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\nN = int(input())\nA = [int(i) for i in input().split()]\nA = Counter(A).most_common()\nA = sorted(A)[::-1]\ncnt = 0\nl = []\nans = [0]\nfor i, v in A:\n if v >= 4:\n ans.append(i*i)\n if 2<=v:\n cnt += 1\n l.append(i)\n if cnt == 2:\n ans.append(l[0]*l[1])\nprint(an... | ['Wrong Answer', 'Accepted'] | ['s541231612', 's314460551'] | [21540.0, 21540.0] | [199.0, 193.0] | [306, 311] |
p03627 | u968404618 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['from collections import Counter\n\nn = int(input())\nA = list(map(int, input().split()))\nA_dic = Counter(A)\n\nif A_dic.most_common()[0][0] == 1:\n print(0)\n exit()\n\nset_A = sorted((set(A)), reverse=True)\ntmp = 0\nfor a in set_A:\n if A_dic[a] >= 4:\n print(a * a)\n exit()\n if A_dic[a]... | ['Wrong Answer', 'Accepted'] | ['s282086249', 's132689784'] | [26340.0, 25332.0] | [130.0, 111.0] | [409, 369] |
p03627 | u983918956 | 2,000 | 262,144 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | ['import collections\nN = int(input())\nA = list(map(int,input().split()))\nc = collections.Counter(A)\nc_l = c.most_common()\nif c_l[0][1] >= 2 and c_l[1][1] >= 2:\n ans1 = max(c_l[0][0],c_l[1][0])\n ans2 = min(c_l[0][0],c_l[1][0])\n for e in c_l:\n if e[0] > ans1:\n ans2 = ans1\n ... | ['Wrong Answer', 'Accepted'] | ['s259080030', 's588930634'] | [21668.0, 18600.0] | [119.0, 91.0] | [409, 262] |
p03628 | u105124953 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['import sys\nn = int(input())\ns1 = list(input())\ns2 = list(input())\n\nli = []\ntmp = 1\nif n == 1:\n print(3)\n sys.exit()\nfor i,s in enumerate(s1):\n \n if i == len(s1) - 1:\n break\n \n if s != s1[i+1]:\n li.append(tmp)\n tmp = 1\n \n else:\n tmp = 2\n# print(l... | ['Wrong Answer', 'Accepted'] | ['s525837007', 's825244647'] | [3064.0, 3064.0] | [18.0, 17.0] | [804, 876] |
p03628 | u197457087 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['MOD = pow(10,9)+7\nN = int(input())\nS = str(input())\nT = str(input())\nif N == 1:\n print(3)\n exit()\nnow = 0\nif S[now] != T[now]: \n now = 2\n ans = 6\n Flag = True\nelse: \n now = 1\n ans = 3\n Flag = False\n\nwhile now <= N-1:\n if S[now] != T[now]: \n if Flag:\n ans = 3*ans%MOD\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s011949849', 's619197228'] | [9208.0, 9116.0] | [29.0, 32.0] | [410, 514] |
p03628 | u268516119 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['N=int(input())\nS1=input()\nS2=input()\ndominos=[]\nindex=0\nwhile index<N:\n if S1[index]==S2[index]:\n dominos.append(0)\n index+=1\n else:\n dominos.append(1)\n index+=2\nstart=3\nfor k,c in enumerate(dominos):\n if k==0:continue\n elif dominos[k-1]==0:\n start*=2\n ... | ['Wrong Answer', 'Accepted'] | ['s030421542', 's185639414'] | [3064.0, 3064.0] | [17.0, 24.0] | [350, 380] |
p03628 | u273084112 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['n = int(input())\ns1 = input() + " "\ns2 = input() + " "\n\nmod = 1000000007\n\nnum = 1\ni = 0\nb = 0\ntmp_t = -1\nwhile(b + i < n):\n if s1[i + b] == s2[i + b]: # t 0\n if tmp_t == 0:\n num = (num * 2) % mod\n elif tmp_t == 1:\n num = (num * 2) % mod\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s569281993', 's219541591'] | [3064.0, 3064.0] | [18.0, 17.0] | [550, 552] |
p03628 | u315485238 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['N = int(input())\nS1 = input()\nS2 = input()\nmod = 10**9+7\n\nif S1[0] != S2[0]:\n ans = 6\nelse:\n ans = 3\n \ni=1\nwhile i<N:\n if S1[i] != S2[i]:\n if S1[i-1] != S2[i-1]:\n ans *= 3\n else:\n ans *= 2\n i += 2\n \n else:\n if S1[i-1] != S2[i-1]:\n pass\n else:\n ans *= 2... | ['Wrong Answer', 'Accepted'] | ['s843903363', 's074925992'] | [3064.0, 3064.0] | [18.0, 17.0] | [336, 348] |
p03628 | u341087021 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['n = int(input())\ns1 = input()\ns2 = input()\nl = []\nm = 3\nmod = 10**9 + 7\n\nafter = False\nfor i in range(n):\n\tif i == n-1:\n\t\tif after:\n\t\t\tpass\n\t\telse:\n\t\t\tl.append(0)\n\telse:\n\t\tif after:\n\t\t\tafter = False\n\t\t\tpass\n\t\telse:\n\t\t\tif s1[i] == s1[i+1]:\n\t\t\t\tl.append(1)\n\t\t\t\tafter... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s023727518', 's993515071', 's118096174'] | [3064.0, 3192.0, 3064.0] | [17.0, 18.0, 17.0] | [521, 583, 583] |
p03628 | u349091349 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['N=int(input())\nS=list(input())\nT=list(input())\nstate=[]\nlim=1000000007\ni=0\nwhile i<=N:\n if S[i] == T[i]:\n state.append(0)\n i+=1\n else:\n state.append(1)\n i+=2\nans=3 \nfor i in range(1,len(state)):\n if state[i] == 1 and state[i-1] == 1:\n ans = (ans * 3) % li... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s524971637', 's758155176', 's887350675', 's123813251'] | [3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 17.0, 17.0, 17.0] | [520, 519, 519, 551] |
p03628 | u367130284 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['from itertools import*\ninput()\nmod=10**9+7\nx=[[s,len(list(t))]for s,t in groupby(len(list(v))for k,v in groupby(input()))]\n#print(x)\nif x[0][0]==1:\n ans=3\nelse:\n ans=6\nfor s,t in x:\n if s==1:\n ans*=2**(t-1)%mod\n else:\n ans*=2*3**(t-1)%mod\n\nprint(ans%mod)', 'from itertools impo... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s343786275', 's607451723', 's074077259'] | [3064.0, 3064.0, 3064.0] | [18.0, 17.0, 18.0] | [280, 292, 384] |
p03628 | u393167737 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['def f(horizontal_flag):\n if horizontal_flag[0]:\n if horizontal_flag[1]:\n return 3\n else:\n return 1\n else:\n return 2\n\nif N == 1:\n print(3) \nelse:\n if A[0] == A[1]:\n counter = 6\n initial_num = 2\n horizontal_flag = [0,1]\n e... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s014195314', 's057681967', 's732751683'] | [3064.0, 3064.0, 3064.0] | [18.0, 18.0, 17.0] | [1058, 1100, 1099] |
p03628 | u405256066 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['N = int(input())\nS1 = input()\nS2 = input()\nans = 1\nmod = 10**9+7\ncnt = 0\nformer = 0 \n\nif S1[0] == S2[0]:\n cnt += 1\n ans = 3\nelse:\n cnt += 2\n ans = 6\n\nwhile cnt < N:\n if S1[cnt] == S2[cnt]:\n if former:\n ans *= 1\n else:\n ans *= 2\n ans %= mod... | ['Wrong Answer', 'Accepted'] | ['s698951806', 's180825436'] | [3064.0, 3064.0] | [18.0, 17.0] | [502, 534] |
p03628 | u405660020 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['n=int(input())\ns1=input()\ns2=input()\nmod=10**9+7\n\ndef rle(string):\n rle_str = string[0]\n rle_cnt = 1\n ans_l = []\n for i in range(1, len(string)):\n if rle_str == string[i]:\n rle_cnt += 1\n else:\n ans_l.append([rle_str, rle_cnt])\n rle_str = string[... | ['Wrong Answer', 'Accepted'] | ['s807088413', 's751060579'] | [9052.0, 9180.0] | [26.0, 30.0] | [700, 700] |
p03628 | u466826467 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['def pop_when_x():\n S1.pop(0)\n S2.pop(0)\n global left_state\n left_state = "X"\n\n\ndef pop_when_y():\n S1.pop(0)\n S1.pop(0)\n S2.pop(0)\n S2.pop(0)\n global left_state\n left_state = "Y"\n\n\nif __name__ == \'__main__\':\n N = int(input())\n S1 = list(input())\n S2 = list(in... | ['Wrong Answer', 'Accepted'] | ['s696394511', 's436872904'] | [3064.0, 3064.0] | [18.0, 17.0] | [1112, 1156] |
p03628 | u502126017 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['n=int(input())\ns1=list(input())\ns2=list(input())\n\nans=3\nfor i in range(n-1):\n if s1[i]==s2[i]:\n ans*=2\n else:\n if s1[i]==s1[i+1]:\n continue\n else:\n if s1[i+1]!=s2[i+1]:\n ans*=3\n else:\n ans*=1\nprint(ans%1000000007... | ['Wrong Answer', 'Accepted'] | ['s991421943', 's964976768'] | [9064.0, 9004.0] | [27.0, 30.0] | [303, 345] |
p03628 | u503228842 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['N = int(input())\ns1 = input()\ns2 = input()\nans = 1\nbeing_horizontal = False\nwas_horizontal = False\nwas_vertical = False\nMOD = 10**9+7\nfor i in range(N):\n\n if not was_horizontal and not being_horizontal and not was_vertical: \n ans *= 3\n if s1[i] != s2[i]:\n being_horizontal = Tr... | ['Wrong Answer', 'Accepted'] | ['s875671166', 's290730467'] | [3064.0, 3064.0] | [17.0, 17.0] | [883, 939] |
p03628 | u536113865 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['n = int(input())\na = input()\nb = input()\n\nans = 3\ni = 0\nif a[0] != b[0]:\n i += 1\n\nwhile i < n-1:\n if a[i]==b[i]:\n if a[i+1]==b[i+1]:\n ans *= 2\n else:\n ans *= 2\n i += 1\n else:\n if a[i+1]==b[i+1]:\n ans *= 1\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s918181436', 's578636558'] | [3064.0, 3064.0] | [17.0, 17.0] | [377, 391] |
p03628 | u542190960 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ["n = int(input())\ns1 = str(input())\ns2 = str(input())\n\ncnt = 1\n\nfor i in range(n):\n if i == 0:\n if s1[i] == s2[i]:\n cnt = cnt * 3\n previous = 'tate'\n else:\n cnt = cnt * 6\n previous = 'yoko1'\n else:\n if s1[i] == s2[i]: #tate\n ... | ['Runtime Error', 'Accepted'] | ['s290643770', 's754630946'] | [3064.0, 3064.0] | [17.0, 17.0] | [603, 791] |
p03628 | u543954314 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['n = int(input())\ns1 = input()\ns2 = input()\nmod = 10**9+7\nb = 0\n2did = 0\nans = 0\nif s1[0] == s2[0]:\n b = 1\n ans += 3\nelse:\n 2did = 1\n ans = 6\nfor i in range(1,n):\n if s1[i] == s2[i]:\n if b:\n ans = ans*2%mod\n b = 1\n elif not 2did:\n if b:\n ans = ans*2%mod\n else:\n an... | ['Runtime Error', 'Accepted'] | ['s009116644', 's405707007'] | [2940.0, 3064.0] | [17.0, 17.0] | [364, 359] |
p03628 | u631277801 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['MOD = 1000000007\n\nN = int(input())\nS = []\nfor i in range(2):\n S.append(input())\n \n\n# make XYline\nxy = ""\nfor i in range(len(S[0])):\n if S[0][i] == S[1][i]:\n xy += "X"\n elif i==len(S[0])-1:\n break\n elif S[0][i] == S[0][i+1]:\n xy += "Y"\n\n# proceed\nif xy[0] == "X":\... | ['Wrong Answer', 'Accepted'] | ['s030461772', 's364445304'] | [3064.0, 3064.0] | [18.0, 18.0] | [680, 1198] |
p03628 | u653807637 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['# encoding:utf-8\nimport sys\n\ndef main():\n\tn = int(input())\n\tstr1 = input()\n\tstr2 = input()\n\n\tptrn = []\n\ti = 0\n\twhile True:\n\t\tif str1[i] == str2[i]:\n\t\t\tptrn.append("t")\n\t\t\ti += 1\n\t\telse:\n\t\t\tptrn.append("y")\n\t\t\ti += 2\n\t\tif i >= n:\n\t\t\tbreak\n\t\n\tprint(ptrn)\n\n\tif ptrn[0] ... | ['Wrong Answer', 'Accepted'] | ['s346017005', 's623082402'] | [3064.0, 3064.0] | [17.0, 17.0] | [624, 628] |
p03628 | u672620970 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['def check(i,j):\n if i > 0:\n k = S[j][i-1] \n if k in checked and not k in C:\n C.append(k)\n if j > 0:\n l = S[j-1][i]\n if l in checked and not l in C:\n C.append(l)\nN = int(input())\nS = [list(input()) for _ in range(2)]\nans = 1\nchecked = {}\nfor i in ran... | ['Wrong Answer', 'Accepted'] | ['s052438882', 's753911493'] | [3064.0, 3064.0] | [18.0, 18.0] | [839, 713] |
p03628 | u778204640 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['M = 10**9+7\nn = int(input())\ns = input()\nt = input()\nans = 3 if s[0] == t[0] else 6\nfor i in range(1, n):\n if s[i-1] == s[i]:\n continue\n if s[i-1] == t[i-1]:\n ans = ans * 2 % M\n else if s[i] != t[i]:\n ans = ans * 3 % M\nprint(ans)', 'M = 10**9+7\nn = int(input())\ns = input()\nt = input()\nans ... | ['Runtime Error', 'Accepted'] | ['s698548777', 's328390154'] | [2940.0, 3064.0] | [18.0, 17.0] | [241, 238] |
p03628 | u970197315 | 2,000 | 262,144 | We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side should be painted by different colors... | ['n=int(input())\ns=input()\nt=input()\nn=len(s)\nmod=10**9+7\nans=1\ni=0\nwhile i<n:\n if i==0:\n if s[i]==t[i]: \n ans*=3\n i+=1\n else:\n ans*=3\n i+=2\n continue\n if s[i-1]!=t[i-1] and s[i]==t[i]:\n ans*=1\n i+=1\n elif s[i-1]==t[i-1] and s[i]!=t[i]:\n ans*=2\n i+=2\n e... | ['Wrong Answer', 'Accepted'] | ['s136346228', 's174711480'] | [3064.0, 3064.0] | [18.0, 18.0] | [431, 431] |
p03629 | u102461423 | 2,000 | 262,144 | A subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters. For example, `arc`, `artistic` and (an empty string) are all subsequences of `artistic`; `abc` and `ci` are not. You are given a string A consisting of lowerca... | ["import sys\ninput = sys.stdin.readline\nimport numpy as np\n\nS = [ord(s) - ord('a') for s in input().rstrip()]\n", "import sys\ninput = sys.stdin.readline\nimport numpy as np\n\nS = [ord(s) - ord('a') for s in input().rstrip()]\n", "import sys\ninput = sys.stdin.readline\nimport numpy as np\n\nS = [ord(s) - ord('a')... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted', 'Accepted', 'Accepted', 'Accepted'] | ['s809537854', 's809537854', 's809537854', 's809537854', 's686455081', 's686455081', 's686455081', 's686455081'] | [21912.0, 21912.0, 21912.0, 21912.0, 156836.0, 156836.0, 156836.0, 156836.0] | [276.0, 276.0, 276.0, 276.0, 1069.0, 1069.0, 1069.0, 1069.0] | [108, 108, 108, 108, 842, 842, 842, 842] |
p03629 | u297574184 | 2,000 | 262,144 | A subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters. For example, `arc`, `artistic` and (an empty string) are all subsequences of `artistic`; `abc` and `ci` are not. You are given a string A consisting of lowerca... | ["from bisect import bisect_left\n\nCHARACTERs = 'abcdefghijklmnopqrstuvwxyz'\n\nAs = input()\nlenA = len(As)\n\nposChars = dict([(ch, [lenA]) for ch in CHARACTERs])\ndp = [0] * lenA + [1, 0]\nfor i in reversed(range(lenA)):\n posChars[As[i]].append(i)\n dp[i] = min([dp[posChars[ch][-1] + 1] for ch in CHARACTERs]... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted', 'Accepted', 'Accepted', 'Accepted'] | ['s898187656', 's898187656', 's898187656', 's898187656', 's139255297', 's139255297', 's139255297', 's139255297'] | [19404.0, 19404.0, 19404.0, 19404.0, 19556.0, 19556.0, 19556.0, 19556.0] | [1119.0, 1119.0, 1119.0, 1119.0, 1072.0, 1072.0, 1072.0, 1072.0] | [564, 564, 564, 564, 625, 625, 625, 625] |
p03629 | u340781749 | 2,000 | 262,144 | A subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters. For example, `arc`, `artistic` and (an empty string) are all subsequences of `artistic`; `abc` and `ci` are not. You are given a string A consisting of lowerca... | ["from string import ascii_lowercase\n\n\ndef solve(s):\n d = [('', 0)]\n while True:\n e = []\n ans = set()\n for ds, di in d:\n max_ci = -1\n for c in ascii_lowercase:\n ci = s.find(c, di) + 1\n if max_ci >= ci:\n contin... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted', 'Accepted', 'Accepted', 'Accepted'] | ['s493445484', 's493445484', 's493445484', 's493445484', 's751992509', 's751992509', 's751992509', 's751992509'] | [193476.0, 193476.0, 193476.0, 193476.0, 12524.0, 12524.0, 12524.0, 12524.0] | [2116.0, 2116.0, 2116.0, 2116.0, 171.0, 171.0, 171.0, 171.0] | [577, 577, 577, 577, 975, 975, 975, 975] |
p03629 | u353797797 | 2,000 | 262,144 | A subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters. For example, `arc`, `artistic` and (an empty string) are all subsequences of `artistic`; `abc` and `ci` are not. You are given a string A consisting of lowerca... | ['\nimport sys\nimport numpy as np\n\ndef main():\n inf = 10 ** 7\n s = sys.stdin.readline()[:-1]\n n = len(s)\n s += "".join(chr(i + 97) for i in range(26))\n # print(s)\n \n size = np.zeros(26, "i8")\n pos = [n + i for i in range(26)]\n \n nxt = [-1] * n\n \n for i in range(n - 1, ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted', 'Accepted', 'Accepted', 'Accepted'] | ['s408271928', 's408271928', 's408271928', 's408271928', 's157107151', 's157107151', 's157107151', 's157107151'] | [14540.0, 14540.0, 14540.0, 14540.0, 5860.0, 5860.0, 5860.0, 5860.0] | [153.0, 153.0, 153.0, 153.0, 388.0, 388.0, 388.0, 388.0] | [1141, 1141, 1141, 1141, 1469, 1469, 1469, 1469] |
p03629 | u466826467 | 2,000 | 262,144 | A subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters. For example, `arc`, `artistic` and (an empty string) are all subsequences of `artistic`; `abc` and `ci` are not. You are given a string A consisting of lowerca... | ['import string\n\nif __name__ == \'__main__\':\n A = input()\n\n p = {}\n for x in string.ascii_lowercase:\n p[x] = len(A)\n # print(p)\n \n tb = [(0, 0, 0)] * len(A)\n tb.append((1, 0, 0))\n tb.append((0, 0, 0))\n # print(tb)\n for i, x in reversed(list(enumerate(A))):\n p[... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted', 'Accepted', 'Accepted', 'Accepted'] | ['s503911068', 's503911068', 's503911068', 's503911068', 's203492912', 's203492912', 's203492912', 's203492912'] | [100748.0, 100748.0, 100748.0, 100748.0, 52964.0, 52964.0, 52964.0, 52964.0] | [2105.0, 2105.0, 2105.0, 2105.0, 1877.0, 1877.0, 1877.0, 1877.0] | [620, 620, 620, 620, 622, 622, 622, 622] |
p03629 | u532966492 | 2,000 | 262,144 | A subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters. For example, `arc`, `artistic` and (an empty string) are all subsequences of `artistic`; `abc` and `ci` are not. You are given a string A consisting of lowerca... | ['def main():\n import sys\n input=sys.stdin.readline\n s=input()\n alpha="abcdefghijklmnopqrstuvwxyz"\n l=len(s)\n alpha2={j:i for i,j in enumerate(alpha)}\n memo=[[0]*26 for _ in range(l,-1,-1)]\n for i in range(26):\n memo[l][i]=l+1\n for i in range(l-1,-1,-1):\n for x,y in a... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error'... | ['s094610117', 's094610117', 's129459851', 's129459851', 's282288346', 's282288346', 's568690078', 's568690078', 's652842911', 's652842911', 's760666636', 's760666636', 's913750536', 's913750536', 's094610117', 's094610117', 's129459851', 's129459851', 's282288346', 's282288346', 's568690078', 's568690078', 's652842911... | [61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 64820.0, 64820.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 61236.0, 64820.0, 64820.0, 61236.0, 61236.0, 61236.0, 61236.0, 75276.0, 75276.0, 75276.0, 75276.0] | [248.0, 248.0, 237.0, 237.0, 247.0, 247.0, 234.0, 234.0, 1449.0, 1449.0, 233.0, 233.0, 241.0, 241.0, 248.0, 248.0, 237.0, 237.0, 247.0, 247.0, 234.0, 234.0, 1449.0, 1449.0, 233.0, 233.0, 241.0, 241.0, 1962.0, 1962.0, 1962.0, 1962.0] | [917, 917, 908, 908, 908, 908, 907, 907, 873, 873, 908, 908, 913, 913, 917, 917, 908, 908, 908, 908, 907, 907, 873, 873, 908, 908, 913, 913, 954, 954, 954, 954] |
p03631 | u000113982 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['n = int(input())\nif (int)n/100==n%10:\n print("Yes")\nelse:\n print("No")', 'n = input()\nif n[0]==n[2]:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s858712974', 's559540435'] | [2940.0, 2940.0] | [17.0, 17.0] | [76, 65] |
p03631 | u004025573 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['N=int(input())\n\nif N//100=N%10:\n print("Yes")\nelse:\n print("No")\n ', 'N=int(input())\n\nif N//100==N%10:\n print("Yes")\nelse:\n print("No")\n '] | ['Runtime Error', 'Accepted'] | ['s483435093', 's359998012'] | [2940.0, 2940.0] | [17.0, 17.0] | [69, 70] |
p03631 | u007550226 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ["n = input()\nif n = n[::-1]:\n print('Yes')\nelse:\n print('No')", "n = input()\nif n == n[::-1]:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Accepted'] | ['s211000109', 's413168037'] | [2940.0, 2940.0] | [17.0, 18.0] | [62, 63] |
p03631 | u008357982 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ["print('YNeos'[input()!=input()[::-1]::2])", "n=input();print('YNeos'[n!=n[::-1]::2])"] | ['Runtime Error', 'Accepted'] | ['s395579655', 's484038897'] | [2940.0, 2940.0] | [17.0, 17.0] | [41, 39] |
p03631 | u008992227 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['a,b,c=input()\nprint("YES" if a==c else "NO")', 'a,b,c=input()\nprint("Yes" if a==c else "No")'] | ['Wrong Answer', 'Accepted'] | ['s437963994', 's298619561'] | [3064.0, 2940.0] | [17.0, 17.0] | [44, 44] |
p03631 | u015993380 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ["n = input()\nprint('Yes' if n[0] == n[1] else 'No')", "n = input()\nprint('Yes' if n[0] == n[2] else 'No')"] | ['Wrong Answer', 'Accepted'] | ['s400986185', 's417440146'] | [2940.0, 2940.0] | [17.0, 17.0] | [50, 50] |
p03631 | u027641915 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['a,b,c = input()\nprint("Yes" if a == c else: "No")', "a,b,c = input()\nprint('Yes' if a == c else: 'No')", 'a,b,c = input()\nprint("Yes" if a == c else: "No")', "a,b,c = input()\nprint('Yes' if a == c:else: 'No')", 'a,b,c=input()\nprint("Yes" if a==c else "No")'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s487515563', 's562428917', 's587968404', 's806618692', 's134098484'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0, 17.0] | [49, 49, 49, 49, 44] |
p03631 | u030726788 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['N=input()\nif(N[0]==N[1]):\n print("Yes")\nelse:\n print("No")', 'N=input()\nif(N[0]==N[2]):\n print("Yes")\nelse:\n print("No")\n'] | ['Wrong Answer', 'Accepted'] | ['s230753603', 's509419804'] | [2940.0, 2940.0] | [17.0, 17.0] | [60, 61] |
p03631 | u039192119 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['a,b,c=int(input())\nif a==c:\n print("Yes")\nelse:\n print("No")', 'a,b,c=input()\nif a==c:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s025784381', 's622581554'] | [2940.0, 2940.0] | [17.0, 17.0] | [62, 57] |
p03631 | u041075929 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ["import sys, os\n\nf = lambda:list(map(int,input().split()))\nif 'local' in os.environ :\n sys.stdin = open('./input.txt', 'r')\n\ndef solve():\n s = input()\n\n for i in range(len(s)/2):\n if s[i] = s[len(s)-1 -i]:\n print('No')\n return\n \n print('Yes')\n\nsolve()\n", "im... | ['Runtime Error', 'Accepted'] | ['s020376332', 's916198071'] | [2940.0, 2940.0] | [17.0, 17.0] | [295, 298] |
p03631 | u041297389 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['a,b,c,d = map(int, input().split())\nif a==c:\n print(abs(b-d))\nelif a>c:\n if a>d:\n print(0)\n elif a<d<b:\n print(abs(a-d))\n else:\n print(abs(a-b))\nelse:\n if c>b:\n print(0)\n elif c<b<d:\n print(abs(c-b))\n else:\n print(abs(c-d))', "x = input()↲... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s039833280', 's196348585', 's703087095', 's835305171', 's733390625'] | [3064.0, 3064.0, 3060.0, 3060.0, 2940.0] | [17.0, 18.0, 17.0, 17.0, 17.0] | [286, 82, 286, 286, 67] |
p03631 | u045408189 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['N=input()\nprint("Yes" if N[0]=N[2] else "No")', 'N=input()\nprint("Yes" if N[0]==N[2] else "No")\n'] | ['Runtime Error', 'Accepted'] | ['s094209173', 's191857224'] | [2940.0, 2940.0] | [17.0, 17.0] | [45, 47] |
p03631 | u046592970 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['n = input()\nif n == n[::-1]:\n print("YES")\nelse:\n print("NO")', 'n = input()\nx = n[::-1]\nif n == x:\n print("YES")\nelse:\n print("NO")\n', 'n = input()\nif n == n[::-1]:\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s453861038', 's803166156', 's136755274'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [67, 74, 67] |
p03631 | u047535298 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['n = int(input())\n\nlcm = 0\ngcd = 0\n\nfor i in range(n):\n t = int(input())\n if(i == 0):\n lcm, gcd = t, t\n continue\n lcm = t\n r = gcd % t\n while(r!=0):\n lcm = r\n r = t % r\n gcd *= t\n gcd //= lcm\nprint(gcd)\n', 'n = input()\nprint("Yes" if(n[0]==n[2]) else ... | ['Runtime Error', 'Accepted'] | ['s835949078', 's372076048'] | [3060.0, 2940.0] | [17.0, 17.0] | [251, 49] |
p03631 | u050641473 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['N = input()\n\nif N == N[::-1]:\n print("YES")\nelse:\n print("NO")', 'N = input()\n\nif N == N[::-1]:\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Accepted'] | ['s239207691', 's585642621'] | [2940.0, 2940.0] | [17.0, 18.0] | [64, 64] |
p03631 | u054717609 | 2,000 | 262,144 | You are given a three-digit positive integer N. Determine whether N is a _palindromic number_. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. | ['n=input()\nn=int(n)\nog=n\nrev=0\nwhile(n>0):\n d=n%10 \n n=n/10\n rev=rev*10+d\nif(rev==og):\n print("Yes")\nelse:\n print("No")\n \n \n \n\n\n \n', 'n=input()\nn=int(n)\nog=n\nrev=0\nwhile(n>0):\n d=n%10\n n=n/10\n rev=rev+d\nif(og==rev):\n print("Yes)\n else:\n p... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s012830878', 's981672710', 's221477615'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0] | [163, 137, 164] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.