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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03244 | u811436126 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\n\nif len(set(v)) == 1:\n print(n // 2)\nelse:\n v1 = [v[i] for i in range(0, n, 2)]\n v2 = [v[i + 1] for i in range(0, n, 2)]\n\n kw1 = Counter(v1)\n kw2 = Counter(v2)\n\n print(kw1)\n print(kw2)\n\n x1 =... | ['Wrong Answer', 'Accepted'] | ['s994628837', 's561435031'] | [24132.0, 20572.0] | [190.0, 137.0] | [682, 954] |
p03244 | u812576525 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['N = int(input())\nV = list(map(int, input().split()))\n\neven = []\nodd = []\nfor i in range(len(V)):\n if V[i] % 2 ==0:\n even.append(V[i])\n else:\n odd.append(V[i])\n\neven =Counter(even)\neven = list(even.items())\neven = sorted(even,key=itemgetter(1),reverse = True)\n\nodd =Counter(odd)\nodd ... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s060939087', 's069408925', 's362736149', 's526946559', 's322464473'] | [13992.0, 15588.0, 22636.0, 22636.0, 15588.0] | [67.0, 78.0, 80.0, 93.0, 78.0] | [910, 354, 499, 901, 827] |
p03244 | u814781830 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['N = int(input())\nV = list(map(int, input().split()))\no = {}\ne = {}\nfor i, v in enumerate(V):\n if i % 2 == 1:\n if not v in e.keys():\n e[v] = 0\n e[v] += 1\n else:\n if not v in o.keys():\n o[v] = 0\n o[v] += 1\n\no = sorted(o.values(), reverse=True)\ne = s... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s817894624', 's858304245', 's692832541'] | [17656.0, 20828.0, 20844.0] | [95.0, 116.0, 107.0] | [442, 470, 481] |
p03244 | u814986259 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\nn = int(input())\nv = list(map(int, input().split()))\n\nodd = [v[i] for i in range(n) if i % 2 == 0]\neven = [v[i] for i in range(n) if i % 2 == 1]\n\nt = collections.Counter(odd).most_common()\nt2 = collections.Counter(even).most_common()\n\nt = list(t.items())\nt.sort(reverse=True)\n\nt2 = list... | ['Runtime Error', 'Accepted'] | ['s436986491', 's534080226'] | [21084.0, 19040.0] | [105.0, 137.0] | [493, 571] |
p03244 | u826263061 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\n\nn = int(input())\nv = list(map(int, input().split()))\n\nv0 = [v[i] for i in range(0,n,2)]\nv1 = [v[i] for i in range(1,n,2)]\n\nv0cnt = collections.Counter(v0)\nv1cnt = collections.Counter(v1)\n\nv0most = v0cnt.most_common()[0]\nv1most = v1cnt.most_common()[0]\nv0next = v0cnt.most_common()[1]\n... | ['Runtime Error', 'Accepted'] | ['s731901666', 's948401965'] | [19032.0, 19040.0] | [110.0, 111.0] | [799, 944] |
p03244 | u827241372 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\n\ndef main() -> None:\n n = int(input())\n p = [int(i) for i in input().split()]\n\n \n l1 = [int(p[i]) for i in range(0, n, 2)]\n \n l2 = [int(p[i]) for i in range(1, n, 2)]\n\n if len(set(p)) == 1:\n \n print(n // 2)\n else:\n lc1 = Cou... | ['Wrong Answer', 'Accepted'] | ['s120552485', 's836033620'] | [3316.0, 16604.0] | [27.0, 94.0] | [718, 758] |
p03244 | u830054172 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['\nうまい寿司が食いたい。\nうまい寿司が遠慮なく食べれるようになるまで,進捗とか垂れ流すブログ\n201809-30\nABC111で学んだこと。\nABC 競技プログラミング\n昨日(2018/9/29)行われた,ABC111に参加した。\nただ,集中力が散漫でレートが落ちてしまったので,きっちり復習したいと思います。\n\nAtCoder Beginner Contest 111 - AtCoder\n\n以下,学んだことをまとめます。\n\nA問題\n猫のすぬけは文字を書く練習をしています。 すぬけは今日、数字の 1 と 9 を書く練習をしていたのですが、 間違えて 1 と 9 をあべこべに書いてしまいました。\nすぬけ... | ['Runtime Error', 'Accepted'] | ['s129737280', 's677398297'] | [2940.0, 15972.0] | [18.0, 76.0] | [10615, 372] |
p03244 | u842170774 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\nn=int(input())\nm=n//2\nv1=list(map(int,input().split()))\nv2=[]\nfor j in range(m):\n v2.append(v1.pop(j))\na1=sorted((collections.Counter(v1)).items(),key=lambda x:x[1],reverse=True)\na2=sorted((collections.Counter(v2)).items(),key=lambda x:x[1],reverse=True)\nif a1[0][1]<a2[0][1]:a1,a2=a2[:]... | ['Wrong Answer', 'Accepted'] | ['s351096662', 's142324993'] | [20912.0, 20392.0] | [853.0, 829.0] | [446, 491] |
p03244 | u842964692 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['#111\nfrom collections import Counter\nn=int(input())\nv=list(map(int,input().split()))\nL=list(Counter(v[0::2]).items())\nR=list(Counter(v[1::2]).items())\n\n\nif L[0][0]!=R[0][0]:\n ans=n-L[0][1]-R[0][1]\nelif len(R)!=1 and len(L)!=1:\n ans=n-max(L[0][1]+R[1][1],L[1][1]+R[0][1])\nelif len(R)!=1 and len(L)==1:... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s830491604', 's959099196', 's164829581'] | [3064.0, 10932.0, 20700.0] | [17.0, 25.0, 84.0] | [500, 552, 498] |
p03244 | u844005364 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\n\neven = a[1::2]\nodd = a[::2]\n\nc_even = Counter(even)\nc_odd = Counter(odd)\n\narr_even = c_even.most_common()\narr_odd = c_odd.most_common()\n\nsum_even = sum(x[1] for x in arr_even)\nsum_odd = sum(x[1] for x in arr_odd)\n\n... | ['Runtime Error', 'Accepted'] | ['s783464815', 's252797728'] | [21952.0, 21952.0] | [99.0, 125.0] | [563, 566] |
p03244 | u844646164 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\nfor_set_v = v \nset_v = set(v)\neven = []\nodd = []\ncount = 0 \ncount_list = []\nfor num in range(n):\n if num % 2 == 0:\n even.append(v[num])\n else:\n odd.append(v[num])\n\neven_most = Counter(even).most_c... | ['Wrong Answer', 'Accepted'] | ['s285992218', 's574535151'] | [30428.0, 29276.0] | [159.0, 128.0] | [1085, 1118] |
p03244 | u845620905 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n1 = [[j, 0] for j in range(100005)]\nn2 = [[j, 0] for j in range(100005)]\nn = int(input())\nv = list(map(int, input().split()))\nfor i in range(n):\n if(i % 2 == 0):\n n1[v[i]][1] += 1\n else:\n n2[v[i]][1] += 1\nn1 = sorted(n1, key=lambda x:x[1], reverse=True)\nn2 = sorted(n2, key=lambda x:x[1]... | ['Wrong Answer', 'Accepted'] | ['s260442800', 's585416720'] | [41204.0, 41204.0] | [198.0, 203.0] | [548, 548] |
p03244 | u846041485 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\nn = int(input())\nv = list(map(int, input().split()))\n\u200b\ncnt = [Counter(), Counter()]\ncmn = [0, 0]\nfor parity in range(2):\n for i in (range(parity, n, 2)):\n cnt[parity][v[i]] += 1\n cmn[parity] = cnt[parity].most_common(1)[0]\n\u200b\nif cmn[0][0] != cmn[1][0]:\... | ['Runtime Error', 'Accepted'] | ['s961377272', 's199929346'] | [2940.0, 17312.0] | [17.0, 170.0] | [611, 513] |
p03244 | u852386636 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\n\nn = int(input())\nv = list(map(int, input().split()))\n\neven_odd_length = n / 2\nreplace_total = 0\n\nlist_odd = v[0::2]\nlist_even = v[1::2]\n\ndict_c_odd = dict(collections.Counter(list_odd))\ndict_c_even = dict(collections.Counter(list_even))\n\nif len(set(v)) == 1:\n print(int(even_odd_l... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s101185227', 's213115640', 's933567780'] | [9072.0, 22916.0, 31960.0] | [28.0, 67.0, 81.0] | [1654, 396, 1342] |
p03244 | u853952087 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\na=int(input())\nA=list(map(int,input().split()))\nb=[A[i] for i in range(a) if i%2==0].sort()\nc=[A[i] for i in range(a) if i%2==1].sort()\nif b==c:\n print(a//2)\nelse:\n bc=Counter(b).most_common()\n cc=Counter(c).most_common()\n if bc[0][0]==cc[0][0]:\n print(a-m... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s059995603', 's255880353', 's483003035', 's876335171'] | [14892.0, 23644.0, 14892.0, 21084.0] | [94.0, 204.0, 65.0, 111.0] | [388, 468, 552, 550] |
p03244 | u856169020 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['\nimport collections\n\nn = int(input())\nV = list(map(int, input().split()))\n\nevel = collections.Counter()\nodd = collections.Counter()\nfor index, v in enumerate(V):\n if index % 2 == 0:\n evel[v] += 1\n else:\n odd[v] += 1\nprint(evel, odd)\nif evel == odd:\n print(int(n / 2))\nelse:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s414259320', 's786443868', 's051089256'] | [22628.0, 23700.0, 17612.0] | [2105.0, 213.0, 167.0] | [558, 1059, 849] |
p03244 | u857759499 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\nn,*v = map(int,open(0).read().split())\nv1 = Counter(v[::2])\nv2 = Counter(v[1::2])\nv1 = sorted([(i,v1[i]) for i in v1.keys()],key =lambda x:x[1],reverse=True)\nv2 = sorted([(i,v2[i]) for i in v2.keys()],key =lambda x:x[1],reverse=True)\nprint(v1,v2)\nif len(v1) == 1:\n if len(v2) =... | ['Wrong Answer', 'Accepted'] | ['s819407058', 's048734883'] | [23588.0, 23580.0] | [109.0, 91.0] | [743, 463] |
p03244 | u858742833 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\ndef main():\n N = int(input())\n V = list(map(int, input().split()))\n c0 = Counter(V[::2])\n c1 = Counter(V[1::2])\n cc0 = sorted([(0, 0)] + [(v, k) for k, v in c0.items()], reverse=True)\n cc1 = sorted([(0, 0)] + [(v, k) for k, v in c1.items()], reverse=True)\n ... | ['Wrong Answer', 'Accepted'] | ['s015944150', 's174975660'] | [27528.0, 27652.0] | [144.0, 144.0] | [484, 459] |
p03244 | u859897687 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n=int(input())\ns=list(map(int,input().split()))\nd1=dict()\nd2=dict()\nfor i in range(0,n,2):\n if i not in d1:\n d1[i]=1\n else:\n d1[i]+=1\nfor i in range(1,n,2):\n if i not in d2:\n d2[i]=1\n else:\n d2[i]+=1\ndmk,dm,dmmk,dmm=[],0,[],0\nfor i in d1.keys():\n if dm<d1[i]:\n dmm=dm\n dmmk=dmk... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s295445567', 's592225327', 's873349700', 's371190330'] | [3064.0, 19552.0, 19552.0, 18016.0] | [17.0, 119.0, 118.0, 124.0] | [792, 798, 794, 832] |
p03244 | u861141787 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\n\nn = int(input())\nv = list(map(int, input().split()))\n\nl1 = []\nl2 = []\nfor i in range(n):\n if i % 2 == 0:\n l1.append(v[i])\n else:\n l2.append(v[i])\n\ncounter1 = collections.Counter(l1)\ncounter2 = collections.Counter(l2)\n\nmode_v1 = counter1.most_common()\nmode_v2 = ... | ['Wrong Answer', 'Accepted'] | ['s026373414', 's282832324'] | [24928.0, 24016.0] | [154.0, 125.0] | [453, 696] |
p03244 | u861466636 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nvl = [int(i) for i in input().split()]\noc = Counter(a for i, a in enumerate(vl) if i % 2 == 0)\nec = Counter(a for i, a in enumerate(vl) if i % 2 == 1)\nol = sorted(((v, k) for k, v in oc.items()), reverse=True)\nel = sorted(((v, k) for k, v in ec.items()), reverse=True)\n\nif ol[0][1] != el[0][1]:... | ['Runtime Error', 'Accepted'] | ['s951050122', 's957085772'] | [14232.0, 23008.0] | [46.0, 128.0] | [619, 606] |
p03244 | u867826040 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\nn = int(input())\nv = list(map(int,input().split()))\n\nif len(set(v)) == 1:\n print(n//2)\nelse:\n\n c1 = Counter(v[::2])\n c2 = Counter(v[1::2])\n o = c1.most_common(2)\n e = c2.most_common(2)\n o.append((0,0))\n e.append((0,0))\n if o[0][0] == e[0][0]:\n ... | ['Runtime Error', 'Accepted'] | ['s236362755', 's170494111'] | [22960.0, 23124.0] | [71.0, 70.0] | [403, 397] |
p03244 | u871303155 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\n\nN = int(input())\nitems = list(map(int, input().split()))\n\n\neven_num = items[::2]\nodd_num = items[1::2]\n\n\ndev = Counter(even_num).most_common(2)\ndod = Counter(odd_num).most_common(2)\n\nif dev[0][0] == dod[0][0] :\n if len(dev) == len(dod) == 1 :\n print(N//2)\n elif len(dev... | ['Runtime Error', 'Accepted'] | ['s861790046', 's795377399'] | [14780.0, 16092.0] | [48.0, 83.0] | [651, 664] |
p03244 | u871374729 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\n\nn = input()\nnums = list(map(int, input().split()))\nodd = nums[0::2]\neven = nums[1::2]\nodd_c = collections.Counter(odd)\neven_c = collections.Counter(even)\n\n\nif odd_c.most_common(1)[0][0] == even_c.most_common(1)[0][0]:\n if len(odd_c) >= 3 and len(even_c) >= 3:\n odd_first_count... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s274086378', 's472155403', 's500373451', 's875743037'] | [19040.0, 22564.0, 19040.0, 19040.0] | [106.0, 148.0, 104.0, 104.0] | [1379, 903, 1379, 1361] |
p03244 | u871841829 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\n\nv_odd[1::2]\nv_even[0::2]\n\nv_odd_mc = Counter(v_odd).most_common()\nv_even_mc = Counter(v_even).most_common()\n\nv_odd_mc.append((0, 0))\nv_even_mc.append((0, 0))\n\nif v_odd_mc[0] != v_even_mc[0]:\n print(n-v_odd_mc[0][1... | ['Runtime Error', 'Accepted'] | ['s382461123', 's440883070'] | [14892.0, 21084.0] | [45.0, 87.0] | [412, 513] |
p03244 | u872887731 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\n\nN = int(input().split())\na = list(map(int,input().split()))\n\nb = a[::2]\nc = a[1::2]\n\nb_ =collections.Counter(b)\nc_ =collections.Counter(c)\n\nbaa = b_.most_common(b_)\ncaa = c_.most_common(c_)\n\nbaa.append([0,0])\ncaa.append([0,0])\n\nif baa[0][0] != caa[0][0]:\n print(N - baa[0][1] -... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s229127825', 's324832761', 's623756362', 's634146214', 's786796568', 's851836992', 's796113129'] | [3316.0, 4980.0, 4980.0, 10976.0, 19040.0, 10972.0, 21952.0] | [21.0, 22.0, 21.0, 29.0, 60.0, 29.0, 99.0] | [385, 575, 370, 597, 377, 591, 380] |
p03244 | u873269440 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['\ndef main():\n\n\n N = int(input())\n V = list(map(int,input().split()))\n V1 = [i for i in V[0::2]]\n V2 = [i for i in V[1::2]]\n count1 = 0\n\n if len(list(set(V)))==1:\n print(int(N/2))\n exit()\n\n for i,j in enumerate(V1[1::]):\n if V1[i-1] != j:\n count1 +=1... | ['Wrong Answer', 'Accepted'] | ['s678679559', 's896640047'] | [16612.0, 16572.0] | [63.0, 79.0] | [454, 969] |
p03244 | u875855656 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\nn=int(input())\nl=list(map(int,input().split()))\nf=l[0::2]\ns=l[1::2]\nans=[]\nif len(Counter(l).values()) == 1:\n ans.append(len(f))\nelif len(Counter(f).values()) == len(Counter(s).values()) == 1:\n ans.append(0)\nelse:\n print(Counter(f).items(),Counter(s).items())\n for fk,fv... | ['Wrong Answer', 'Accepted'] | ['s338283592', 's990660629'] | [24920.0, 21212.0] | [2105.0, 96.0] | [548, 358] |
p03244 | u879674287 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['\n\n#include <string>\n#include <cmath>\n#include <algorithm>\n#include <tuple>\nusing namespace std;\ntypedef long long ll;\n\n\n\n\nint main()\n{\n\n int n;\n cin >> n;\n int v[n];\n\n rep(i, n) cin >> v[i];\n\n int seq0[100001] = {}, seq1[100001] = {};\n for (int i = 0; i < n; i += 2)\n ++seq0[v[i]];\n f... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s202112962', 's310684079', 's417184884', 's492098689', 's717181989', 's310290272'] | [2940.0, 17564.0, 21224.0, 21216.0, 2940.0, 21140.0] | [17.0, 109.0, 122.0, 126.0, 17.0, 121.0] | [781, 650, 854, 1416, 798, 789] |
p03244 | u882359130 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nV = [int(v) for v in input().split()]\n\nV1 = [V[n] for n in range(0, n, 2)] #v1, v3, v5, ...\nV2 = [V[n] for n in range(1, n, 2)] #v2, v4, v6, ...\n\nV1_set = list(set(V1))\nV1_cnt = []\nfor i in V1_set:\n i_cnt = V1.count(i)\n V1_cnt += [i, i_cnt]\nV1_cnt += [0, 0] \nV1_cnt.sort(key=lambda x: x[... | ['Runtime Error', 'Accepted'] | ['s249819407', 's795410818'] | [14468.0, 35896.0] | [2104.0, 204.0] | [935, 949] |
p03244 | u882831132 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nv = list(map(int, input().split()))\n\nva, ve = v[0::2], v[1::2]\nda, de = {}, {}\nfor a in va:\n da[a] = da.get(a, 0)+1\nfor e in ve:\n de[e] = de.get(e, 0)+1\nadd = sorted([(k,v) for k,v in da.items()], key=lambda x:-x[1])+[(0,0)]\neven = sorted([(k,v) for k,v in de.items()], key=lambda x:-x[1])... | ['Wrong Answer', 'Accepted'] | ['s013280094', 's833052922'] | [23932.0, 21880.0] | [140.0, 108.0] | [461, 443] |
p03244 | u886274153 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\nn = int(input())\nv = [int(i) for i in input().split()]\n\ndummy = (-1, -1)\n(av1, ak1), (av2, ak2) = (collections.Counter(v[::2]).most_common(2) + dummy)[:2]\n(bv1, bk1), (bv2, bk2) = (collections.Counter(v[1::2]).most_common(2) + dummy)[:2]\n\nif av1 != bv1:\n print(n-ak1-bk1)\nelif ak1 < bk1... | ['Runtime Error', 'Accepted'] | ['s014538916', 's405533194'] | [15588.0, 15588.0] | [66.0, 79.0] | [357, 440] |
p03244 | u887207211 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['N = int(input())\nV = list(map(int,input().split()))\nnums = [v for v in V if V.count(x) != int(N/2)]\nprint(int(len(nums)/2))\n', 'from collections import Counter\n\nN = int(input())\nV = list(map(int,input().split()))\n\neven = Counter(V[1::2]).most_common() + [(0, 0)]\nodd = Counter(V[::2]).most_common() + [(0, 0)... | ['Runtime Error', 'Accepted'] | ['s458057606', 's486224455'] | [14404.0, 20572.0] | [41.0, 86.0] | [124, 309] |
p03244 | u896451538 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import math\nimport itertools\nimport fractions\nimport heapq\nimport collections\nimport bisect\nimport sys\n\nsys.setrecursionlimit(10**7)\nmod = 10**9+7\ninf = 10**20\n\ndef LI(): return list(map(int, sys.stdin.readline().split()))\ndef LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]\ndef ... | ['Wrong Answer', 'Accepted'] | ['s982077737', 's642922684'] | [19604.0, 18776.0] | [146.0, 138.0] | [1149, 1085] |
p03244 | u897328029 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ["n = int(input().split()[0])\nv_list = list(map(int, input().split()))\n\n\nodd_list = [str(v) for i, v in enumerate(v_list) if i % 2 == 1]\n\neven_list = [str(v) for i, v in enumerate(v_list) if i % 2 == 0]\n\n\nodd_counter = collections.Counter(odd_list)\nodd_1 = odd_counter.most_common()[0][0]\n\nif len(odd_counter... | ['Runtime Error', 'Accepted'] | ['s634969414', 's931318906'] | [14008.0, 23864.0] | [83.0, 156.0] | [1643, 1729] |
p03244 | u898917044 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['# abc111_c_new\n\nfrom collections import Counter\n\n\ndef solve(n, seq):\n odd = seq[::2] # odd numbers of the seq\n even = seq[1::2] # even numbers of the seq\n\n odd = Counter(odd).most_common() # example -> returns [(1, 5), (2, 5)]\n \n # even = sorted([(k, v) for k, v in Counter(even).items()],... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s401450206', 's538957181', 's714974897'] | [20828.0, 20820.0, 20820.0] | [86.0, 95.0, 94.0] | [1243, 1243, 1467] |
p03244 | u903460784 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ["\nn=int(input())\nv=input().split()\nvodd=[]\nveven=[]\nfor i in range(n):\n if i%2:\n veven.append(int(v[i]))\n else:\n vodd.append(int(v[i]))\n\nchangeCnt=0\n\nvoddNum=[vodd[0]]\nvoddCnt=[0]\nj=0\nfor i,odd in enumerate(vodd):\n if voddNum[j]!=odd:\n for k,num in enumerate(voddNum):\n ... | ['Runtime Error', 'Accepted'] | ['s741816266', 's382843300'] | [15952.0, 20912.0] | [2104.0, 108.0] | [1692, 581] |
p03244 | u903948194 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input())\nV = [int(n) for n in input().split()]\n\nif len(set(V)) == 1:\n ans = len(V) // 2\nelse:\n vp_ = [v for i, v in enumerate(V) if i%2 == 0] \n vn_ = [v for i, v in enumerate(V) if i%2 != 0] \n\n vp = Counter(vp_).most_common()\n vn = Counter(vn_).most_... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s414581363', 's607979644', 's964341817'] | [3064.0, 3064.0, 21076.0] | [24.0, 17.0, 118.0] | [813, 813, 792] |
p03244 | u904943473 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['# C\nimport collections\nn = int(input())\nlst = list(map(int, input().split()))\nlst1 = lst[::2]\nlst2 = lst[1::2]\ndct1 = sorted(dict(collections.Counter(lst1)).items(), key=lambda x:-x[1])\ndct2 = sorted(dict(collections.Counter(lst2)).items(), key=lambda x:-x[1])\n\n\nans = 0\nprint(len(dct1))\nif (len(dct1) == 1... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s086373860', 's304319278', 's338708436', 's492709556', 's108109042'] | [24152.0, 2940.0, 27848.0, 27856.0, 24152.0] | [92.0, 17.0, 104.0, 104.0, 89.0] | [885, 8, 793, 397, 842] |
p03244 | u905203728 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\nn=int(input())\nV=list(map(int,input().split()))\nV_1=[(0,0)]+sorted(Counter([V[i] for i in range(n) if i%2==0]).items(), key=lambda x:x[1])\nV_2=[(0,0)]+sorted(Counter([V[j] for j in range(n) if j%2==1]).items(), key=lambda x:x[1])\n\na,b=V_1[-1],V_2[-1]\nif a==b:b=V_2[-2]\n\ncnt=0\n... | ['Wrong Answer', 'Accepted'] | ['s735509016', 's502474117'] | [20700.0, 20700.0] | [137.0, 117.0] | [417, 490] |
p03244 | u905582793 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ["from collections import Counter\n\nN = int(input())\nl = list(map(int, input().split(' ')))\nl_odd = l[0::2]\nl_even = l[1::2]\ndict_odd = Counter(l_odd)\ndict_even = Counter(l_even)\nmost_odd = dict_odd.most_common()[0][0]\nmost_even = dict_even.most_common()[0][0]\n\nif dict_odd.most_common()[0][1] == dict_even.mos... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s463647858', 's955036946', 's092070464'] | [19040.0, 22568.0, 19040.0] | [140.0, 199.0, 152.0] | [760, 892, 865] |
p03244 | u917733926 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\n\nN = int(input())\nV = list(int(i) for i in input().split())\neven = V[0::2]\nodd = V[1::2]\nhalf_count = len(even)\neven = collections.Counter(even).most_common(1)\neven_elem = even[0][0]\neven_count = even[0][1]\nodd = collections.Counter(odd).most_common(1)\nodd_elem = odd[0][0]\nodd_count = ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s521469166', 's774473908', 's626937275'] | [15972.0, 15972.0, 15972.0] | [73.0, 94.0, 85.0] | [554, 362, 620] |
p03244 | u919633157 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ["# 2019/07/24\n\nfrom collections import Counter\n\nn=int(input())\nv=list(map(int,input().split()))\n\neven=[]\nodd=[]\n\nfor i in range(n):\n if i%2==0:even.append(v[i])\n else:odd.append(v[i])\n\ne=Counter(even).most_common(2)\ne=list([e[0][0]]+[e[1][0]])\no=Counter(odd).most_common(2)\no=list([o[0][0]]+[o[1]... | ['Runtime Error', 'Accepted'] | ['s296004406', 's415111544'] | [15964.0, 16092.0] | [213.0, 226.0] | [572, 661] |
p03244 | u919689206 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ["import sys\nfrom collections import Counter\n\ndef main():\n input = sys.stdin.readline\n \n n = int(input())\n m = [int(i) for i in input().split()]\n \n even = [m[i] for i, _ in enumerate(m) if i % 2 == 0]\n odd = [m[i] for i, _ in enumerate(m) if i % 2 == 1]\n \n even_c = Counter(even).m... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s298056996', 's791069969', 's430513513'] | [16036.0, 21140.0, 21140.0] | [98.0, 109.0, 117.0] | [519, 849, 1064] |
p03244 | u921811474 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['def solve(V):\n n = len(V)\n ac = Counter(V[::2]).most_common(2)\n bc = Counter(V[1::2]).most_common(2)\n print(ac,bc)\n if ac[0][0] != bc[0][0]:\n return n - ac[0][1] - bc[0][1]\n else:\n if len(bc) == 1 or len(ac) == 1:\n return n // 2\n else:\n return n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s465765089', 's549147318', 's523239849'] | [11492.0, 17448.0, 16808.0] | [26.0, 67.0, 69.0] | [464, 498, 473] |
p03244 | u923279197 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\nn=int(input())\nv=list(map(int,input().split()))\na=Counter(v[::2]).most_common() \nb=Counter(v[1::2]).most_common()\nif len(a)==1:\n a.append([0,0])\nif len(b)==1:\n b.append([0,0])\nif a[0,0]==b[0,0]:\n print(min(n-a[1,1]-b[0,1],n-a[0,1]-b[1,1]))\nelse:\n print(n-a[0,1]-... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s065293773', 's962187995', 's211979086'] | [20700.0, 20700.0, 24796.0] | [83.0, 84.0, 95.0] | [372, 374, 369] |
p03244 | u923662841 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nv = list(map(int, input().split()))\na = sorted(([i,v[::2].count(i)] for i in set(v[::2])), key=lambda x:x[1])\nb = sorted(([j,v[1::2].count(j)] for j in set(v[1::2])),key=lambda x:x[1])\nif a[-1]!=b[-1]:\n print(n-a[-1][1]-b[-1][1])\nelif len(a) == 1 and len(b) == 1:\n print(min(a[-1][1],b[-1... | ['Runtime Error', 'Accepted'] | ['s174141173', 's893098602'] | [9060.0, 25252.0] | [24.0, 77.0] | [474, 295] |
p03244 | u927764913 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\nn = int(input())\nv = input().split()\nv_int = [int(i) for i in v]\nv_odd = []\nv_even = []\nfor i in range(int(n/2)):\n v_even.append(v_int[i*2])\n v_odd.append(v_int[i*2+1])\nprint(v_even)\nprint(v_odd)\nc_odd = collections.Counter(v_odd)\nc_even = collections.Counter(v_even)\nmax_odd = 0\nsec... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s044522581', 's263257177', 's740127980', 's267580317'] | [3064.0, 24428.0, 24428.0, 23660.0] | [17.0, 127.0, 130.0, 126.0] | [1148, 1149, 981, 1246] |
p03244 | u934246119 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input())\nv = [int(_) for _ in input().split()]\n\n\n\n\n\nv1 = v[0:n-2:2]\nv2 = v[1:n-1:2]\nv1_count = Counter(v1)\nv2_count = Counter(v2)\n\nv1_1st_common = v1_count.most_common(1)\nv1_2nd_common = v1_count.most_common(2)\n\nv2_1st_common = v2_count.most_common(1)\nv2_2nd_... | ['Runtime Error', 'Accepted'] | ['s643382003', 's278965991'] | [19040.0, 19936.0] | [91.0, 99.0] | [1090, 1532] |
p03244 | u938486382 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input()) // 2\nns = list(map(int, input().split()))\n\nn = 200000\nns = [i for i in range(n)]\n\na = [ns[i] for i in range(len(ns)) if i % 2 == 0]\nb = [ns[i] for i in range(len(ns)) if i % 2 == 1]\nsa = set(a)\nsb = set(b)\n#ca = sorted([(a.count(s), s) for s in sa])[::-1]\n\n\nda = {}\ndb = {}\nfor s in sa:... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s095491173', 's471605572', 's061718073'] | [52060.0, 25664.0, 22168.0] | [222.0, 141.0, 129.0] | [805, 766, 875] |
p03244 | u941753895 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n=int(input())\nif n==4:\n exit()\nl=list(map(int,input().split()))\nl1={}\nl2={}\nf=0\nfor i in l:\n if f==0:\n if i not in l1:\n l1[i]=1\n else:\n l1[i]+=1\n f=1\n else:\n if i not in l2:\n l2[i]=1\n else:\n l2[i]+=1\n f=0\nl1=sorted(l1.items(),key=lambda x:x[1],reverse=True... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s258621052', 's341626042', 's412850058', 's197256919'] | [19052.0, 24604.0, 17060.0, 21532.0] | [95.0, 205.0, 124.0, 165.0] | [567, 1113, 1653, 993] |
p03244 | u944325914 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\nn=int(input())\nv=list(map(int,input().split()))\nv1=[]\nv2=[]\nfor i in range(n//2):\n v1.append(v[2*i])\n v2.append(v[2*i+1])\nv1_count=Counter(v1)\nv2_count=Counter(v2)\nif v1==v2:\n print(n//2)\nelif v1_count.most_common()[0][0]!=v2_count.most_common()[0][0]:\n print(n-v... | ['Wrong Answer', 'Accepted'] | ['s915268410', 's487145383'] | [24516.0, 24336.0] | [119.0, 88.0] | [701, 378] |
p03244 | u950708010 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\ndef solve():\n n = int(input())\n odd = []\n even = []\n a = list(int(i) for i in input().split())\n for i in range(n):\n if i%2 == 0:\n odd.append(a[i])\n else:\n even.append(a[i])\n ans = 0\n c1 = collections.Counter(odd)\n c2 = collections.Counter(even)\n n1 = len(odd)\... | ['Wrong Answer', 'Accepted'] | ['s972302160', 's672141954'] | [23264.0, 23264.0] | [146.0, 144.0] | [765, 776] |
p03244 | u957872856 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nV = list(map(int,input().split()))\ncnt = 0\ncnt1 = 0\nif len(set(V)) == 1:\n print(n//2)\n exit()\nfor i in range(n-2):\n if V[i] == V[i+2] and i%2==0:\n cnt += 1\n elif V[i] == V[i+2] and i%2==1:\n cnt1 += 1\n else:\n print(n//2)\n exit()\nprint(max(cnt,cnt1)-min(cnt,cnt1))', 'fro... | ['Wrong Answer', 'Accepted'] | ['s700290860', 's275073755'] | [15844.0, 21020.0] | [45.0, 87.0] | [296, 333] |
p03244 | u963915126 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input())\n\nv = list(map(int, input().split()))\n\nodds = []\nevens = []\n\nfor i in range(n):\n if i % 2 == 0:\n evens.append(v[i])\n else:\n odds.append(v[i])\n\nevens_c = Counter(evens).most_common()\nodds_c = Counter(odds).most_common()\n\nans = 0\n\n... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s464806703', 's645608935', 's938064626', 's981660627', 's009137439'] | [21076.0, 21212.0, 26336.0, 26460.0, 15972.0] | [2105.0, 2108.0, 2105.0, 2105.0, 100.0] | [620, 574, 584, 584, 528] |
p03244 | u964494353 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nlst = list(map(int, input().split()))\nm = 0\nfor i in range(0,n-2):\n\tif lst[i] != lst[i+2]:\n \tlst[i+2] = lst[i]\n \tm += 1\n elif lst[i] == lst[i+1]:\n\t\tm += 1\nprint(m)\n', 'n = int(input())\nlst = list(map(int, input().split()))\nm1 = {}\nm2 = {}\nfor i in range(0, n, 2):\n if l... | ['Runtime Error', 'Accepted'] | ['s791678268', 's645411848'] | [2940.0, 17056.0] | [17.0, 94.0] | [190, 557] |
p03244 | u970308980 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import defaultdict\n\nN = int(input())\nL = list(map(int, input().split()))\n\nif len(set(L)) == 1:\n print(N//2)\n exit()\nif N == 2:\n print(0)\n exit()\n\n\nd_even = defaultdict(int)\nd_odd = defaultdict(int)\n\nfor i in range(N):\n v = L[i]\n if i % 2 == 0:\n d_even[v] +=... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s188758928', 's301282003', 's987057619'] | [22484.0, 24172.0, 24300.0] | [140.0, 116.0, 118.0] | [687, 646, 651] |
p03244 | u970738863 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nv = list(map(int,input().split()))\nl = list(range(n))\nodd = [v[i] for i in l if i%2 == 0]\neven = [v[i] for i in l if i%2 == 1]\n\nimport collections\noddm = collections.Counter(odd).most_common()\nevenm = collections.Counter(odd).most_common()\n\nif oddm[0][0] == evenm[0][0]:\n a = len(odd)\ne... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s641993721', 's831848810', 's889879550'] | [24944.0, 24944.0, 24924.0] | [110.0, 112.0, 109.0] | [359, 596, 597] |
p03244 | u970899068 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\nn=int(input())\nv=list(map(int, input().split()))\nv1=v[0:n:2]\nv2=v[1:n:2]\nv10=collections.Counter(v1)\nv11=v10.most_common()\nv20=collections.Counter(v2)\nv21=v20.most_common()\nif v11[0][0]==v21[0][0] and v11[0][1]==n//2 and v21[0][1]==n//2:\n print(n//2)\nelif v11[0][0]==v21[0][0]:\n x1... | ['Runtime Error', 'Accepted'] | ['s765524276', 's339353034'] | [21944.0, 21952.0] | [94.0, 92.0] | [485, 487] |
p03244 | u973840923 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nlist = [int(i) for i in input().split()]\n\nlist_odd = list[::2]\nlist_even = list[1::2]\n\ndef cnt_element(x):\n dict = {}\n for i in x:\n if i not in dict:\n dict[i] = 1\n else:\n dict[i] += 1\n return [(v,k) for k,v in dict.items()]\n\ncnt_odd = sorted... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s074368295', 's123873498', 's339589418', 's370547508', 's786940246', 's890756387', 's528972944'] | [20636.0, 20828.0, 3064.0, 20636.0, 20636.0, 18784.0, 15972.0] | [101.0, 103.0, 17.0, 104.0, 102.0, 128.0, 79.0] | [1026, 1031, 682, 1021, 1026, 506, 415] |
p03244 | u978313283 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import defaultdict\nd = defaultdict(int)\nn=int(input())\nv=list(map(int,input().split()))\nfor i in range(n):\n d[v[i]]+=1\nD=sorted(d.items(), key=lambda x:x[1],reverse=True)\nif len(D)==1:\n print(D[0][1]//2)\nelse:\n if v[0]==D[1][0]:\n b=D[0][0]\n a=D[1][0]\n else:\n ... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s306156597', 's501269278', 's786470169', 's577597406'] | [21980.0, 3060.0, 23708.0, 21148.0] | [142.0, 18.0, 170.0, 132.0] | [524, 329, 1051, 1031] |
p03244 | u979444096 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ["from collections import Counter\n\n\ndef main():\n n = int(input())\n v = list(map(int, input().split()))\n \n \n\n # a_count = Counter.most_common(Counter(a))\n # b_count = Counter.most_common(Counter(b))\n\n half_n = n // 2\n ac = Counter(v[::2]).most_common(2)\n bc = Counter(v[1::2]).mos... | ['Wrong Answer', 'Accepted'] | ['s304061538', 's274100272'] | [15588.0, 15588.0] | [74.0, 73.0] | [1545, 1532] |
p03244 | u981767024 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['# 2019/05/15\n\n\nfrom operator import itemgetter\n\n# Input\nn = int(input())\nv = list(map(int, input().split()))\n\nl_even = list()\nl_odd = list()\n\n# Separate Odd or Even\nfor i in range(n):\n if i % 2 == 0:\n l_even.append(v[i])\n else:\n l_odd.append(v[i])\n\nl_even.sort()\nl_odd.sort()\nw... | ['Wrong Answer', 'Accepted'] | ['s833748473', 's137481762'] | [21348.0, 18660.0] | [222.0, 167.0] | [1333, 1583] |
p03244 | u990726146 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nv = list(map(int, input().split()))\nv1 = v[0::2]\nv2 = v[1::2]\n\nfrom collections import Counter\nc1 = list(Counter(v1).items())\nc2 = list(Counter(v2).items())\n\nc1 = sorted(c1, key= lambda x: x[1], reverse= True)\nc2 = sorted(c2, key= lambda x: x[1], reverse= True)\n\nc1.append((0,0))\nc2.appen... | ['Wrong Answer', 'Accepted'] | ['s761670084', 's299291133'] | [25456.0, 25592.0] | [78.0, 88.0] | [524, 525] |
p03246 | u010069411 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['#! /usr/bin/python\nfrom collections import Counter\nN = int(input())\nV = list(map(int, input().split()))\n#N = 4\n#V = list(map(int, "105 119 105 119 105 119".split()))\n\n\ndef func(l, aa):\n counter = Counter(l)\n if counter[aa] == 0:\n c, count = counter.most_common()[0]\n else:\n c, count... | ['Wrong Answer', 'Accepted'] | ['s125054721', 's707451066'] | [17364.0, 17116.0] | [97.0, 120.0] | [532, 647] |
p03246 | u024768467 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n=int(input())\nv_list = list(map(int,input().split()))\nodd_list = []\neven_list = []\n\nfor i in range(n):\n if i % 2 == 0:\n odd_list.append(v_list[i]) \n else:\n even_list.append(v_list[i])\n\nimport collections\n\nodd_list_c = collections.Counter(odd_list)\neven_list_c = collections.Counter(e... | ['Runtime Error', 'Accepted'] | ['s710786224', 's028320761'] | [3064.0, 19040.0] | [17.0, 139.0] | [898, 766] |
p03246 | u077337864 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input().strip())\nvs = list(map(int, input().strip().split()))\noddv = [v for i, v in enumerate(vs) if i % 2 == 0]\nevenv = [v for i, v in enumerate(vs) if i % 2 == 1]\n\noddc = Counter(oddv)\nevenc = Counter(evenv)\nif oddc.most_common(1)[0][0] != evenc.most_common(1)[0][0]... | ['Runtime Error', 'Accepted'] | ['s908287748', 's184061389'] | [3064.0, 19040.0] | [17.0, 168.0] | [855, 856] |
p03246 | u090649502 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter as C\nn = int(input())\na = list(map(int,input().split()))\nc1 = C(a[::2])\nc2 = C(a[1::2])\nmc1 = c1.most_common(2)\nmc2 = c2.most_common(2)\nif mc1[0][0] == mc2[0][0]:\n if mc1[1][1] >= mc2[1][1]:\n ans = n - mc1[1][1] - mc2[0][1]\n else:\n ans = n - mc1[0][1] - mc2[][1]\npri... | ['Runtime Error', 'Accepted'] | ['s496871721', 's630189656'] | [3064.0, 18656.0] | [17.0, 81.0] | [313, 534] |
p03246 | u097216046 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\ndef solve(size=int(input()), ary=list(map(int, input().split()))):\n if len(set(ary)) < 2: return len(ary) // 2\n\n even, odd = Counter(ary[::2]), Counter(ary[1::2])\n (e, em), (_, es) = even.most_common(2)\n (o, om), (_, os) = odd.most_common(2)\n return size - max(e... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s221644723', 's379311637', 's877253683', 's969284507', 's594239114'] | [18644.0, 18656.0, 18656.0, 21432.0, 14268.0] | [90.0, 86.0, 86.0, 162.0, 79.0] | [372, 442, 322, 382, 653] |
p03246 | u106778233 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ["\ndef main():\n from collections import Counter\n N=int(input())\n A=list(ma())\n evens = Counter(A[::2])\n odds = Counter(A[1::2])\n evens[0]=0 \n odds[0]=0 #\n \n e1, e2=evens.most_common(2) \n o1, o2=odds.most_common(2) #\n \n if e1[0]!=o1[0]:\n print(N - (e1[1] + o1[1]))\n else: \n print(N - ma... | ['Runtime Error', 'Accepted'] | ['s101626879', 's250344679'] | [3316.0, 18656.0] | [21.0, 72.0] | [498, 542] |
p03246 | u131405882 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\nn = int(input())\nv = list(map(int, input().split()))\na = []\nb = []\nfor i in range(n // 2):\n a.append(v[(i+1)*2-1])\n b.append(v[(i+1)*2-2])\na = collections.Counter(a)\nb = collections.Counter(b)\n\n\nif a.most_common()[0][0] != b.most_common()[0][0]:\n print(n-a.most_common()[0][1]-... | ['Runtime Error', 'Accepted'] | ['s100801726', 's596417947'] | [3064.0, 18656.0] | [17.0, 164.0] | [550, 637] |
p03246 | u218843509 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\n\none = sorted(Counter([v[i] for i in range(0, n, 2)]).items(), key=lambda x: x[1], reverse=True)\ntwo = sorted(Counter([v[i] for i in range(1, n, 2)]).items(), key=lambda x: x[1], reverse=True)\n\nprint(one, two)\nif one[0][0] ... | ['Runtime Error', 'Accepted'] | ['s920809708', 's378338044'] | [21844.0, 20692.0] | [128.0, 115.0] | [587, 588] |
p03246 | u269623316 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from copy import *\nn=int(input())\narr=list(map(int,input().split()))\narr1=[]\narr2=[]\nfor i in range(1,100001):\n\tarr1.append([0,i])\n\tarr2.append([0,i])\n\nfor i in range(0,n,2):\n\tarr1[arr[i]-1][0]+=1\n#arr1.sort()\n#print(arr1[-1])\nfor i in range(1,n,2):\n\tarr2[arr[i]-1][0]+=1\narr1.sort(reverse=True)\nar... | ['Wrong Answer', 'Accepted'] | ['s063064431', 's415072457'] | [32436.0, 32180.0] | [204.0, 222.0] | [476, 474] |
p03246 | u279136325 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['\nimport sys\nfrom collections import *\n\nn = int(input())\nv = [int(x) for x in input().split()]\n\nif not n:\n print(0)\n sys.exit()\n\nn1 = Counter(v[::2])\nn2 = Counter(v[1::2])\n\nmax1 = 0\n\nn1 = sorted([(count, k) for k, count in n1.items()], reverse=True)\nn2 = sorted([(count, k) for k, count in n2.ite... | ['Runtime Error', 'Accepted'] | ['s133062852', 's333257414'] | [18648.0, 18648.0] | [101.0, 100.0] | [877, 876] |
p03246 | u332253305 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn=int(input())\ns=list(map(int,input().split()))\ne=Counter(s[0::2])\no=Counter(s[1::2])\ne[0]=0\no[0]=0\ne1,e2=e.most_common(2)\no1,o2=o.most_common(2)\nif e1[0]!=o1[0]:\n print(n-(e1[1]+o1[1]))\nelse:\n print(n-max(e1[1]+o2[1],e2[1]+o1[1]))z', 'from collections import Counte... | ['Runtime Error', 'Accepted'] | ['s705067483', 's950254032'] | [3064.0, 18656.0] | [17.0, 78.0] | [271, 270] |
p03246 | u340781749 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\nfrom itertools import takewhile\n\nn = int(input())\nvvv = list(map(int, input().split()))\ncnt1 = Counter(vvv[0::2])\ncnt2 = Counter(vvv[1::2])\nmc1 = cnt1.most_common()\nmc2 = cnt2.most_common()\nmcs1 = list(takewhile(lambda x: x[1] == mc1[0][1], mc1))\nmcs2 = list(takewhile(lambda ... | ['Wrong Answer', 'Accepted'] | ['s040169548', 's406852386'] | [25664.0, 18656.0] | [207.0, 76.0] | [832, 405] |
p03246 | u367130284 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import*\nn,*v=open(0).read().split()\nn=int(n)\na=[v[s]for s in range(0,n,2)]\nb=[v[s]for s in range(1,n,2)]\nc=Counter(a).most_common()\nd=Counter(b).most_common()\nprint(c,d)\nif len(c)==1 and len(d)==1:\n if c==d:\n print(n//2)\n else:\n print(0)\nelif c[0][1]!=d[0][1]:\n print(sum([s[1]f... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s545241080', 's938375127', 's330490288'] | [24660.0, 24660.0, 20572.0] | [140.0, 184.0, 119.0] | [498, 566, 562] |
p03246 | u371467115 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n=int(input())\nv=list(map(int,input().split()))\na=v[0::2]\nb=v[1::2]\nc=dict()\nd=dict()\n\nfor i in a:\n if i in c:\n c[i]+=1\n else:\n c[i]=1\nfor j in d:\n if j in d:\n d[j]+=1\n else:\n d[j]=1\n\ne=sorted([[c,v] for v,c in c.items()],reverse=True)\nf=sorted([[c,v] for v,c in d.items()],reverse=T... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s555468693', 's651320828', 's874583749'] | [16872.0, 3064.0, 27104.0] | [81.0, 18.0, 125.0] | [434, 535, 686] |
p03246 | u375870553 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\n\ndef main():\n n = int(input())\n v = [int(i) for i in input().split()]\n ans = 0\n odd = Counter(v[1::2])\n even = Counter(v[::2])\n odd_mosts = odd.most_common(2)\n even_mosts = even.most_common(2)\n if odd_mosts[0][0] == even_mosts[0][0]:\n if len(... | ['Wrong Answer', 'Accepted'] | ['s175378799', 's483131507'] | [3316.0, 18656.0] | [21.0, 79.0] | [662, 701] |
p03246 | u404676457 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = input().split()\nvs = list(map(int, input().split()))\n\neve = {}\nodd = {}\n\nfor i in range(len(vs)):\n if i % 2 == 0:\n if vs[i] in eve:\n eve[vs[i]] += 1\n else:\n eve[vs[i]] = 1\n else:\n if vs[i] in odd:\n odd[vs[i]] += 1\n else:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s437264332', 's541700757', 's659609435'] | [22368.0, 28144.0, 20892.0] | [118.0, 135.0, 118.0] | [765, 755, 1201] |
p03246 | u430543459 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['\n\nsequence_list=[]\nsequence_even_value_cnt_sortlist=[]\nsequence_odd_value_cnt_sortlist=[]\nsequence_even_value_cnt={}\nsequence_odd_value_cnt={}\neven_2_maxnum=0\nodd_2_maxnum=0\n\nsequence_num=int(input())\nsequence_list=input().split()\n\nfor i in range(sequence_num):\n if i%2==0:\n sequence_even_valu... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s132520909', 's471638752', 's334296502'] | [25316.0, 14404.0, 23452.0] | [136.0, 70.0, 177.0] | [1413, 1028, 2108] |
p03246 | u452557250 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ["import collections\nimport numpy as np\n\nn = int(input())\nl = input().split()\nv = [ int(s) for s in l ]\n\nn = 8\nnpv = np.array( v, dtype=np.int32)\n#npv = np.array( [1,1,1,1,1,3,2,3], dtype=np.int32)\nnpv_dic = {}\nnpv_dic['even'] = npv[0::2]\nnpv_dic['odd'] = npv[1::2]\n\n#print('n = ', n)\n#print('npv = ', np... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s523411138', 's766409146', 's918345865', 's704391595'] | [39700.0, 39764.0, 2940.0, 39680.0] | [252.0, 439.0, 17.0, 356.0] | [877, 1171, 17, 1291] |
p03246 | u476038506 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['N = int(input())\nV = [int(i) for i in input().split()]\nV1 = [V[2*j-2] for j in range(1, N//2+1)]\nV2 = [V[2*j-1] for j in range(1, N//2+1)]\n#print(V1, V2)\n\ndef dict(x):\n D = {}\n for i in x:\n if i in D:\n D[i] += 1\n else:\n D.setdefault(i, 1)\n return D\n\ndictV1 = dict(V1)\ndictV2 = dict(... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s807658403', 's945863611', 's858573311'] | [21568.0, 21408.0, 23332.0] | [109.0, 108.0, 105.0] | [898, 790, 897] |
p03246 | u478870821 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from sys import exit, setrecursionlimit, stderr\nfrom functools import reduce\nfrom itertools import *\nfrom collections import defaultdict, Counter\nfrom bisect import bisect\n\ndef read():\n return int(input())\n\ndef reads():\n return [int(x) for x in input().split()]\n\nn = read()\nv = reads()\n\nevens = sorted... | ['Wrong Answer', 'Accepted'] | ['s669802350', 's257686642'] | [20808.0, 20808.0] | [136.0, 143.0] | [604, 616] |
p03246 | u552357043 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\nn = int(input())\nv = list(map(int, input().split()))\neven = [v[2*i] for i in range(n//2)]\nodd = [v[2**i+1] for i in range(n//2)]\ndEven = collections.Counter(even).most_common()\ndOdd = collections.Counter(odd).most_common()\nif dEven[0][0] != dOdd[0][0]:\n ans = n - dEven[0][1] - dOdd[0][1... | ['Runtime Error', 'Accepted'] | ['s195102101', 's737939625'] | [14908.0, 21084.0] | [48.0, 97.0] | [394, 620] |
p03246 | u555947166 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from statistics import mode\nn = int(input())\nvlist = list(map(int, input().split()))\n\n\na = vlist[::2]\nb = vlist[1::2]\n\nfreq_a = mode(a)\nfreq_b = mode(b)\n\n\nx = len(a) - freq_a\ny = len(b) - freq_b\n\nprint(a)\nprint(b)\nprint(freq_a)\nprint(freq_b)\n\nif len(set(vlist)) == 1:\n print(min(len(a), len(b))... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s214498701', 's449885458', 's910700749', 's754386129'] | [17680.0, 17552.0, 14396.0, 18656.0] | [101.0, 90.0, 47.0, 81.0] | [320, 274, 178, 1766] |
p03246 | u557659226 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['# coding: utf-8\n# Your code here!\n\nimport numpy as np\n\ndef canbe_solved(positions):\n flg = np.dot(positions[0],np.ones(2,int))%2\n for p in positions:\n flg ^= (np.dot(p,np.ones(2,int)) %2 )\n if flg:\n return False\n return True\n\ndef solutions(p,vals):\n u = np.dot(p, np.... | ['Runtime Error', 'Accepted'] | ['s740399902', 's013714926'] | [31372.0, 21160.0] | [308.0, 117.0] | [1444, 980] |
p03246 | u560889512 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n=int(input())\narr=map(int,input().split())\nfrom collections import Counter\neven=Counter(arr[::2])\neven[0]=0\nodd=Counter(arr[1::2])\nodd[0]=0\neven1,even2=even.most_common(2)\nodd1,odd2=odd.most_common(2)\nif even1[0]!=odd1[0]:\n print(n-(even1[1]+odd1[1]))\nelse:\n print(n-max(even1[1]+odd2[1],even2[1]+odd1[1... | ['Runtime Error', 'Accepted'] | ['s249508352', 's387804371'] | [10620.0, 18528.0] | [31.0, 76.0] | [309, 316] |
p03246 | u561992253 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nl = list(map(int, input().split()))\n\nif n == 2:\n if l[0] == l[1]:\n print(1)\n else:\n print(0)\nelse:\n a = []\n b = []\n for i in range(n):\n if i % 2 == 0:\n a.append(l[i])\n else:\n b.append(l[i])\n\n da = {}\n for e in a:... | ['Runtime Error', 'Accepted'] | ['s646554045', 's073555983'] | [23392.0, 20724.0] | [135.0, 119.0] | [864, 581] |
p03246 | u590211278 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ["import collections\nn = int(input())\nv=[]\nv=list(map(int,input().split(' ')))\n\nodv = []\nevv = []\n\nfor i in range(n):\n if i%2 == 1:\n odv.append(v[i])\n else:\n evv.append(v[i])\n\nodvc=collections.Counter(odv)\nevvc=collections.Counter(evv)\n\nodvs=len(odvc.most_common())\nevvs=len(evvc.mo... | ['Wrong Answer', 'Accepted'] | ['s602785778', 's005203693'] | [20576.0, 20568.0] | [181.0, 156.0] | [857, 910] |
p03246 | u624475441 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\nN = int(input())\nA = list(map(int, input().split()))\nc1 = Counter(A[::2])\nc2 = Counter(A[1::2])\nc1m = max(c1.items(), key=lambda x:x[1])\nc2m = max(c2.items(), key=lambda x:x[1])\nc1m[0] = 0\nc2m[0] = 0\nc1c2 = max(c for k,c in c2.items() if c1m[0]!=k)\nc2c1 = max(c for k,c in c1.... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s149330120', 's244139605', 's852847158'] | [18648.0, 18656.0, 18656.0] | [74.0, 78.0, 76.0] | [378, 302, 302] |
p03246 | u631277801 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import sys\nstdin = sys.stdin\n\ndef li(): return map(int, stdin.readline().split())\ndef li_(): return map(lambda x: int(x)-1, stdin.readline().split())\ndef lf(): return map(float, stdin.readline().split())\ndef ls(): return stdin.readline().split()\ndef ns(): return stdin.readline().rstrip()\ndef lc(): return list... | ['Wrong Answer', 'Accepted'] | ['s748771861', 's873171026'] | [20736.0, 18720.0] | [107.0, 82.0] | [880, 764] |
p03246 | u652737716 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nl = list(map(int, input().split()))\nl1 = [li for i, li in enumerate(l) if i % 2 == 0]\nl2 = [li for i, li in enumerate(l) if i % 2 == 1]\nprint(l1, l2)\ndef cnt(l):\n d = {}\n for li in l:\n if li in d:\n d[li] += 1\n else:\n d[li] = 1\n d = [(li, cnt) f... | ['Runtime Error', 'Accepted'] | ['s612164797', 's873253587'] | [16356.0, 17116.0] | [90.0, 115.0] | [722, 676] |
p03246 | u667084803 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\n\ncnt1 = Counter(v[::2]).most_common()\ncnt2 = Counter(v[1::2]).most_common()\ncnt1 += [(-1,0)]\ncnt2 += [(-1,0)]\nprint(cnt1, cnt2)\nif cnt1[0][0] != cnt2[0][0]:\n print(n - (cnt1[0][1] + cnt2[0][1]))\nelse:\n print(n - m... | ['Wrong Answer', 'Accepted'] | ['s961192212', 's186147194'] | [21852.0, 20572.0] | [119.0, 84.0] | [358, 340] |
p03246 | u692453235 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import Counter\n\nn = int(input())\nv = list(map(int, input().split()))\n\ndef f(x, y):\n return n - ( x + y )\n\nv0 = Counter(v[::2])\nv1 = Counter(v[1::2])\nL = v0.most_common(2)\nR = v1.most_common(2)\n\nprint(L, R)\n\nif L[0][0] != R[0][0]:\n print(f(L[0][1], R[0][1]))\nelif len(L) > len(R):\n ... | ['Wrong Answer', 'Accepted'] | ['s718856822', 's982411007'] | [18656.0, 18656.0] | [81.0, 82.0] | [472, 473] |
p03246 | u698919163 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nv = list(map(int,input().split()))\n\nv1 = []\nv2 = []\n\n\n\nif max(v) == min(v):\n print(int(n/2))\nelif v[0] == v[1]:\n j=0\n for i in range(int(n/2)):\n v1.append(v[j])\n j+=2\n j=0\n for i in range(int(n/2)):\n v2.append(v[j+1])\n j+=2\n\n import co... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s271356503', 's341090018', 's505810401', 's532356402', 's303739258'] | [24112.0, 24112.0, 24240.0, 14396.0, 19040.0] | [146.0, 143.0, 179.0, 46.0, 175.0] | [949, 668, 693, 277, 664] |
p03246 | u729133443 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['from collections import*\nn,*v=map(int,open(0).read().split())\na=Counter(v[::2]).most_common()+[(0,0)]\nb=Counter(v[1::2]).most_common()+[(0,0)]\nprint(a,b)\nif a[0][0]==b[0][0]:\n print(min(n-a[0][1]-b[1][1],n-a[1][1]-b[0][1]))\nelse:\n print(n-a[0][1]-b[0][1])', 'from collections import*\nn,*v=map(int,open(0... | ['Wrong Answer', 'Accepted'] | ['s273126297', 's895539687'] | [20572.0, 20524.0] | [118.0, 87.0] | [261, 250] |
p03246 | u745561510 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['n = int(input())\nv = list(map(int, input().split()))\n\nodd = {}\neven = {}\n\nfor i in range(len(v)):\n if i % 2 == 1:\n if v[i] in odd:\n odd[v[i]] += 1\n else:\n odd[v[i]] = 1\n else:\n if v[i] in even:\n even[v[i]] += 1\n else:\n even[... | ['Runtime Error', 'Accepted'] | ['s950595333', 's193287304'] | [21940.0, 20764.0] | [107.0, 136.0] | [1700, 1628] |
p03246 | u786153999 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['import collections\nN = int(input())\na = input().split( )\n\nret = [0]\n\nodds = []\nevens = []\nfor i in range(N):\n if i % 2 == 0:\n odds.append(int(a[i]))\n else:\n evens.append(int(a[i]))\n\ncodds = collections.Counter(odds)\ncevens = collections.Counter(evens)\n\nif codds.most_common()[0][0]... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s188112882', 's672919100', 's758749841', 's596038626'] | [26092.0, 26032.0, 29548.0, 25904.0] | [145.0, 135.0, 184.0, 173.0] | [1244, 1263, 1309, 1735] |
p03246 | u810735437 | 2,000 | 1,048,576 | A sequence a_1,a_2,... ,a_n is said to be /\/\/\/ when the following conditions are satisfied: * For each i = 1,2,..., n-2, a_i = a_{i+2}. * Exactly two different numbers appear in the sequence. You are given a sequence v_1,v_2,...,v_n whose length is even. We would like to make this sequence /\/\/\/ by replacing... | ['\n# arr1, arr2\n\nfrom collections import *\nN = int(input())\nAs = list(map(int, input().split()))\n\ndef solve(arr1, arr2):\n cnt1 = Counter(arr1)\n cnt2 = Counter(arr2)\n\n \n \n most1 = cnt1.most_common(1)\n most2 = cnt2.most_common(1)\n\n if len(most1) > 1 or len(most2) > 1:\n return ... | ['Wrong Answer', 'Accepted'] | ['s963236907', 's010853839'] | [19040.0, 21944.0] | [86.0, 98.0] | [1063, 842] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.