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
u485716382
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_n = input().split(' ')\n \n gu = Counter(v_n[::2])\n ki = Counter(v_n[1::2])\n\n guusuu = gu.most_common()\n kisuu = ki.most_common()\n\n print(guusuu)\n print(kisuu)\n print('len: ', len(guusuu), ', ', len(kisuu))\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s601325042', 's837084853', 's966718367', 's815912484']
[26988.0, 22504.0, 26988.0, 25580.0]
[136.0, 89.0, 134.0, 86.0]
[573, 500, 620, 624]
p03244
u494058663
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(input().split(" "))\ncount = 0\nprint(v)\n\nfor i in range(0,n-2):\n if v[i]!=v[i+2]:\n v[i+2]=v[i]\n count+=1\n \n if v[i]==v[i+1]:\n count+=1\n \nprint(count) ', 'import collections\nn = int(input())\nv = [int(i) for i in input().split()]\nkisu...
['Wrong Answer', 'Accepted']
['s707031774', 's179242213']
[13160.0, 23452.0]
[91.0, 67.0]
[220, 649]
p03244
u497952650
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 main():\n \n N = int(input())\n V = list(map(int,input().split()))\n odd = V[1::2]\n even = V[0::2]\n mode_o = Counter(odd).most_common()\n mode_o.append([0,0])\n mode_e = Counter(even).most_common()\n mode_e.append([0,0])\n ans = 0\n if mode_o[0...
['Wrong Answer', 'Accepted']
['s527443625', 's244636058']
[3316.0, 21084.0]
[20.0, 84.0]
[552, 507]
p03244
u501952592
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\nx = Counter(v[::2])\ny = Counter(v[1::2])\n\nans = n\nif len(x) > 1:\n ans -= x.most_common(1)[0][1]\nif len(y) > 1:\n ans -= y.most_common(1)[0][1]\nprint(ans)', 'from collections import Counter\n\nn = int(input())\nv = lis...
['Wrong Answer', 'Accepted']
['s452273004', 's164386917']
[23176.0, 21468.0]
[71.0, 69.0]
[241, 416]
p03244
u503228842
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\nfrom collections import Counter\nl1 = Counter(l[0::2])\nmostl1 = l1.most_common()[0]\nsemimostl1 = l1.most_common()[1]\n\nl2 = Counter(l[1::2])\nmostl2 = l2.most_common()[0]\nsemimostl2 = l2.most_common()[1]\n\nif mostl1[0] != mostl2[0]:\n print(n-mostl1[1]-m...
['Runtime Error', 'Accepted']
['s239979722', 's498053346']
[19060.0, 18784.0]
[100.0, 106.0]
[376, 608]
p03244
u518042385
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\ndic1=defaultdict(int)\ndic2=defaultdict(int)\nn=int(input())\nl=list(map(int,input().split()))\nif n%2==0:\n for i in range(0,n-1,2):\n dic1[l[i]]+=1\n for i in range(1,n,2):\n dic2[l[i]]+=1\n max11=0\n i1=0\n max12=0\n i2=0\n max21=0\n i3=0\n max22=0\n i4=0\n for...
['Wrong Answer', 'Accepted']
['s283135778', 's329266299']
[18400.0, 18400.0]
[104.0, 120.0]
[715, 624]
p03244
u519078363
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 = 12\nv = list(map(int, '1 1 1 1 2 2 2 2 2 2 3 3'.split()))\n\na = Counter(v[0::2]).most_common()\nb = Counter(v[1::2]).most_common()\na.append([0,0])\nb.append([0,0])\nif a[0][0] != b[0][0]:\n print(n - (a[0][1] + b[0][1]))\nelse:\n print(min(n-(a[1][1]+b[0][1]), n-(a[0...
['Wrong Answer', 'Accepted']
['s408677925', 's949945646']
[3316.0, 20572.0]
[20.0, 84.0]
[321, 313]
p03244
u527261492
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(0,n,1):\n a.append(v[i])\n b.append(v[i+1])\nc=collections.Counter(a)\nd=collections.Counter(b)\nC=sorted(c.items(), key=lambda x:-x[1])\nD=sorted(d.items(), key=lambda x:-x[1])\nA=int(C[0][0])\nB=int(D[0][0])\ncnt=0\nf...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s305110550', 's797346532', 's765932245']
[14788.0, 40540.0, 29920.0]
[76.0, 187.0, 160.0]
[410, 416, 905]
p03244
u533232830
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\nl0 = l[::2]\nl1 = l[1::2]\n\nl0.sort()\nl1.sort()\n\n# print(l0)\n# print(l1)\n\nmemo0 = [[1, l0[0]]]\nmemo1 = [[1, l1[0]]]\nfor i in range(1, n//2):\n if memo0[-1][1] == l0[i]:\n memo0[-1][0] += 1\n else:\n memo0.append([1, l0[i]])\n\n i...
['Wrong Answer', 'Accepted']
['s395195542', 's649277352']
[21348.0, 18560.0]
[182.0, 143.0]
[690, 694]
p03244
u536034761
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()))\nx = len(set(V))\nif x == 1:\n print(n // 2)\nelse:\n V = Counter(V)\n a, b = V.most_common(2)\n a = a[1]\n b = b[1]\n if x == 2:\n y = abs(a - b)\n if y <= 1:\n print(0)\n else:\n ...
['Wrong Answer', 'Accepted']
['s517916014', 's007785204']
[25324.0, 25500.0]
[72.0, 101.0]
[384, 625]
p03244
u536113865
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...
['ai = lambda: list(map(int,input().split()))\nai_ = lambda: [int(x)-1 for x in input().split()]\n\nn = int(input())\na = ai()\nif all(i == a[0] for i in a):\n print(n//2)\n exit()\n\na1 = a[::2]\na2 = a[1::2]\n\nfrom collections import Counter\nc1 = Counter(a1)\nc2 = Counter(a2)\nm1 = c1.most_common(2)\nm2 = c2....
['Runtime Error', 'Accepted']
['s043630189', 's417097585']
[3064.0, 19040.0]
[17.0, 86.0]
[553, 569]
p03244
u537782349
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...
['a = int(input())\nb = list(map(int, input().split()))\nc = []\nfor i in range(a):\n d = False\n for j in range(0, len(c)):\n if c[j][0] == b[i]:\n c[j][1] += 1\n d = True\n break\n if not d:\n c.append([b[i], 1])\nc = sorted(c, key=lambda x: x[0], reverse=True)\...
['Wrong Answer', 'Accepted']
['s665277198', 's212903948']
[14236.0, 27284.0]
[2104.0, 343.0]
[651, 1414]
p03244
u539517139
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())\na=list(map(int,input().split()))\no=[]\ne=[]\nfor i in range(n):\n if i%2==0:\n o.append(a[i])\n else:\n e.append(a[i])\nfrom collections import Counter as co\no=co(o)\ne=co(e)\no['x']=0\ne['x']=0\nov=o.values()+[0]\nev=e.values()+[0]\nmo=max(ov)\nme=max(ev)\nif n==2:\n if a[0]==a[1]:\n pr...
['Runtime Error', 'Runtime Error', 'Accepted']
['s744215483', 's880526241', 's149962165']
[18528.0, 18656.0, 18552.0]
[82.0, 85.0, 104.0]
[461, 443, 513]
p03244
u545368057
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 numpy as np\nn = int(input())\nAs = input().split()\nAs = [int(A) for A in As]\n# n=4\n# As = [3,1,3,2,4,3,1,1]\n# As = [1,1,1,2,1,1,1,1]\n\n# print(As)\nA_odd = As[::2] \nA_even = As[1:][::2] \n\nprint(A_odd,A_even)\n\ndef num_pair(l):\n counts_pair = []\n for i in set(l):\n counts_pai...
['Wrong Answer', 'Accepted']
['s888993824', 's076162931']
[23436.0, 32900.0]
[2111.0, 351.0]
[911, 1022]
p03244
u547167033
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 Counter\nn=int(input())\nv=list(map(int,input().split()))\ns1,s2=[],[]\nfor i in range(n):\n if i%2==0:\n s1.append(v[i])\n else:\n s2.append(v[i])\nc1=Counter(s1)\nc2=Counter(s2)\nd1=c1.most_common()\nd2=c2.most_common()\nif d1[0][0]!=d2[0][0]:\n print(n-d1[0][1]-d2[0][1])\nelse:\n print(min(n-d1[0]...
['Runtime Error', 'Accepted']
['s746258247', 's509038052']
[3064.0, 23776.0]
[17.0, 122.0]
[336, 512]
p03244
u548303713
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()))\nv.insert(0,0) \ncheck=0 \nnow=v[1]\nfor i in range(2,n):\n if now!=v[i]:\n check=1\n break\n \nodd=[]\neven=[]\nfor i in range(1,n+1):\n if i%2==1:\n odd.append(v[i])\n else:\n even.append(v[i])\n \nodd2=sorted(odd)\n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s531690877', 's847411777', 's753352285']
[19584.0, 14208.0, 32644.0]
[171.0, 123.0, 221.0]
[1502, 1050, 833]
p03244
u550943777
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()))\nv_even = [0 for i in range(max(v)+1)]\nv_odd = [0 for i in range(max(v))+1]\nsum_even = 0\nsum_odd = 0\nfor i in range(N):\n if i%2 :\n v_odd[v[i]] += 1\n sum_odd += 1\n else:\n v_even[v[i]] += 1\n sum_even += 1\nmax_odd = 0\nodd ...
['Runtime Error', 'Accepted']
['s799868092', 's595852767']
[14232.0, 14200.0]
[51.0, 112.0]
[761, 762]
p03244
u557494880
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()))\nv_odd = []\nv_even = []\nfor i in range(n//2):\n v_odd.append()\n v_even.append()\np1 = 0\np2 = 0\nq1 = 0\nq2 = 0\no_max = -1\ne_max = -1\nfor i in range(n//2):\n a = v_odd[i]\n b = v_even[i]\n x = v_odd.count(a)\n y = v_even.count(b)\n if p1 ...
['Runtime Error', 'Accepted']
['s800326448', 's520858035']
[14356.0, 17312.0]
[41.0, 130.0]
[804, 860]
p03244
u558242240
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\nn = len(v)\nfrom collections import defaultdict\nc0 = defaultdict(int)\nfor vi in v[0::2]:\n c0[vi] += 1\nc1 = defaultdict(int)\nfor vi in v[1::2]:\n c1[vi] += 1\n\nsc0 = sorted(c0.items(), key=lambda x: x[1])\nsc1 = sorted(c1.items(), key=lambda x: x[1]...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s131468945', 's705593573', 's029952001']
[3064.0, 23488.0, 20976.0]
[17.0, 154.0, 121.0]
[979, 700, 1189]
p03244
u559823804
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 heapq\n\nn=int(input())\nve=[0 for _ in range(100010)]\nvo=[0 for _ in range(100010)]\nv = list(map(int,input().split()))\n\nfor nn in range(n):\n vv = v[nn]\n if(nn%2==0):\n ve[vv]+=1\n else:\n vo[vv]+=1\nhve = heapq.nlargest(2,range(len(ve)),key=ve.__getitem...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s140695415', 's769935711', 's447249133']
[16160.0, 15620.0, 16160.0]
[104.0, 105.0, 109.0]
[514, 522, 514]
p03244
u561339958
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())\nl = list(int(x) for x in input().split())\nel = []\nol = []\nfor i in range(n):\n if i % 2 == 0:\n el.append(l[i])\n else:\n ol.append(l[i])\ne1 = collections.Counter(el).most_common()[0][0]\ne2 = collections.Counter(el).most_common()[1][0]\no1 = collections.Counter(ol).m...
['Runtime Error', 'Accepted']
['s580956205', 's639332183']
[17500.0, 17548.0]
[169.0, 174.0]
[712, 713]
p03244
u564589929
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\nsys.setrecursionlimit(10 ** 6)\n# input = sys.stdin.readline ####\nint1 = lambda x: int(x) - 1\ndef II(): return int(input())\n\ndef MI(): return map(int, input().split())\ndef MI1(): return map(int1, input().split())\n\ndef LI(): return list(map(int, input().split()))\ndef LI1(): return list(map(int1,...
['Wrong Answer', 'Accepted']
['s591347970', 's415832255']
[21084.0, 21084.0]
[84.0, 84.0]
[1145, 1004]
p03244
u570018655
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\n\nn = int(input())\nv = list(map(int, input.split()))\na = v[::1]\nb = v[1::1]\nslash = mode(a)\nback_slash = mode(b)\na = [i for i in a if i == slash]\nb = [j for j in b if j == back_slash]\nprint(len(a) + len(b))\n', 'from statistics import mode\n\nn = int(input())\nv = list(map(int, in...
['Runtime Error', 'Runtime Error', 'Accepted']
['s325790621', 's850974654', 's261133987']
[5384.0, 5128.0, 22672.0]
[39.0, 36.0, 119.0]
[234, 234, 546]
p03244
u571718615
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 stdin\nimport collections\n\n\n\nn = int(stdin.readline())\nv = [int(x) for x in stdin.readline().rstrip().split()]\n\n\n# [start:stop:step]\nv1 = v[0::2]\nv2 = v[1::2]\n\ntmp = len(v1) - len(v2)\n\nv_c = collections.Counter(v)\nv1_c = collections.Counter(v1)\nv2_c = collections.Counter(v2)\n\nif v1_c...
['Wrong Answer', 'Accepted']
['s504818788', 's798614129']
[26716.0, 26716.0]
[149.0, 162.0]
[1091, 986]
p03244
u572373398
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\na = [v[i] for i in range(n) if i % 2 == 0]\nb = [v[i] for i in range(n) if not i % 2 == 0]\n\na_count = Counter(a)\nb_count = Counter(b)\n\na_sorted = sorted(a_count.items(), key=lambda x:x[1], reverse=True)\nb_sorted = sorted(b...
['Wrong Answer', 'Accepted']
['s039360732', 's479898323']
[24376.0, 21944.0]
[166.0, 116.0]
[805, 774]
p03244
u578953945
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 = map(int, input().split())\nfrom collections import defaultdict\nans = defaultdict(int)\nresult = int(n / 2)\nfor i in s:\n ans[i] += 1\n\nln = len(ans)\nif ln == 1:\n print(result)\nelif ln == 2:\n ind = 0\n a = 0\n z = sorted(ans.items(), key=lambda x: x[1], reverse=True)\n for _, v in z:...
['Wrong Answer', 'Accepted']
['s098701824', 's593234893']
[22508.0, 16176.0]
[106.0, 71.0]
[479, 406]
p03244
u580258754
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 = [i for i in map(int,input().split())]\nv_odd = v[::2]\nv_even = v[1::2]\nodd_nums = (collections.Counter(v_odd)).most_common()\neven_nums = (collections.Counter(v_even)).most_common()\nprint(odd_nums)\nprint(even_nums)\nans = 0\nif odd_nums[0][0] != even_nums[0][0]: \n for i...
['Wrong Answer', 'Accepted']
['s025635495', 's942922477']
[22228.0, 21212.0]
[136.0, 121.0]
[568, 834]
p03244
u581187895
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 = input()\nv=list(map(int,input().split()))\na=Counter(v[0::2]).most_common()\nb=Counter(v[1::2]).most_common()\na.append([0,0])\nb.append([0,0])\nif a[0][0]!=b[0][0]:\n print(n-(a[0][1]+b[0][1]))\nelse:\n print(min(n-(a[1][1]+b[0][1]),n-(a[0][1]+b[1][1])))', '\nfrom collect...
['Runtime Error', 'Accepted']
['s495185164', 's295365577']
[20700.0, 23140.0]
[84.0, 66.0]
[289, 664]
p03244
u593005350
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())\nn=list(map(int,input().split()))\n#Divide it into even and odd\nn1=[]\nn2=[]\nfor i in range(N//2):\n n1.append(n[i*2])\n n2.append(n[i*2-1])\n#end\n#make lile {key,value}\ncn1=[]\ns=0\nwhile n1!=[]:\n cn1.append([n1.count(n1[0]),n1[0]])\n for j in range(cn1[s][0]):\n n1.remove(...
['Wrong Answer', 'Accepted']
['s563308665', 's497124656']
[14008.0, 16092.0]
[2108.0, 91.0]
[1195, 609]
p03244
u597455618
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, v2 = v[::2], [1::2]\nvv1 = Counter(v1).most_common()\nvv2 = Counter(v2).most_common()\n\nif len(set(v)) == 1:\n print(n//2)\nif vv1[0] != vv2[0]:\n print(n - vv1[0][1] - vv2[0][1])\nelse:\n print(n - max(vv1[1][1] + v...
['Runtime Error', 'Accepted']
['s890086581', 's955130308']
[2940.0, 25180.0]
[17.0, 90.0]
[339, 342]
p03244
u600402037
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\ns1 = Counter(V).most_common(2)[0]\ns2 = Counter(V).most_common(2)[0]\nV1 = V[0::2]\nV2 = V[1::2]\nx1, c1 = Counter(V1).most_common(1)[0]\nx2, c2 = Counter(V2).most_common(1)[0]\nx3, c3 = Counter(V1).most_common(2)[1]\nx4, c4 =...
['Runtime Error', 'Accepted']
['s833432414', 's581981065']
[21464.0, 21944.0]
[153.0, 100.0]
[419, 849]
p03244
u602715823
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 = input().split()\n\nv1 = v[::2]\nv2 = v[1::2]\nc1 = Counter(v1).most_common(2)\nc2 = Counter(v2).most_common(2)\n\nif c1[0][0] != c2[0][0]:\n print(n=c1[0][1] - c2[0][1])\nelse:\n print(min(n - c1[0][1] - c2[1][1], n - c1[1][1] - c2[0][1]))\n', 'from colle...
['Runtime Error', 'Accepted']
['s419341491', 's658968822']
[16616.0, 20712.0]
[65.0, 73.0]
[290, 337]
p03244
u604896914
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 operator\n\nn=int(input().strip())\nlst=input().split(' ')\nmap(int, lst)\n\nd1 = {}\nd2 = {}\n\nfor i in range(len(lst)):\n if i % 2 == 0:\n if lst[i] in d1:\n d1[lst[i]] += 1\n else:\n d1[lst[i]] = 1\n else:\n if lst[i] in d2:\n d2[lst[i]] += 1\n ...
['Runtime Error', 'Accepted']
['s512051843', 's043594668']
[18228.0, 18280.0]
[89.0, 88.0]
[795, 791]
p03244
u606033239
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()))\nve=v[0::2]\nvo=v[1::2]\nprint(ve,vo)\n\nce=collections.Counter(vo).most_common(2)\nco=collections.Counter(ve).most_common(2)\nprint(ce,co)\nif ce[0][0] != co[0][0]:\n ans = len(v)-ce[0][1]-co[0][1]\nelif len(ce)==1 and len(co)==1:\n ans = len...
['Wrong Answer', 'Accepted']
['s836052873', 's213633256']
[16740.0, 16564.0]
[87.0, 82.0]
[480, 492]
p03244
u608726540
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 deque\nn=int(input())\nv=list(map(int,input().split()))\nd1={}\nd2={}\nl1=[]\nl2=[]\nfor i in range(n):\n num=v[i]\n if i%2==0:\n try:\n d1[num]+=1\n except:\n d1[num]=1\n else:\n try:\n d2[num]+=1\n except:\n d2[...
['Runtime Error', 'Accepted']
['s165873300', 's518270913']
[8980.0, 27272.0]
[22.0, 205.0]
[688, 659]
p03244
u612975321
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 copy\nimport numpy as np\n\nn = int(input())\nv = list(map(int,input().split()))\na = v[0::2] \nb = v[1::2]\n\ncnta = np.zeros(10**5+1, dtype=int)\ncntb = np.zeros(10**5+1, dtype=int)\nfor i in range(n//2):\n ca, cb = a[i], b[i]\n cnta[ca] += 1\n cntb[cb] += 1\nprint(a, cnta[:5])\nprint(b, cntb[:5])\n...
['Runtime Error', 'Accepted']
['s128219729', 's211778803']
[39072.0, 38504.0]
[191.0, 187.0]
[752, 675]
p03244
u620846115
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())\nalist = list(map(int,input().split()))\nlist1 = alist[1::2]\nlist2 = alist[0::2]\nfrom collections import Counter\ndic1 = Counter(list1)\ndic2 = Counter(list2)\nsortdic1 = sorted(dic1.items(),key=lambda x:x[1], reverse=True)\nsortdic2 = sorted(dic2.items(),key=lambda x:x[1], reverse=True)\nvlist1 =...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s103545874', 's294138787', 's732150742', 's728667284']
[27520.0, 27712.0, 20724.0, 25628.0]
[91.0, 93.0, 57.0, 88.0]
[610, 601, 281, 378]
p03244
u623601489
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 main(n:int,lst:list)->int:\n lst1 = lst[::2]\n lst2 = lst[1::2]\n ans1 =count2(lst1)\n ans2 =count2(lst2)\n if ans1[0][0] == ans2[0][0]:\n if ans1[1] and ans2[1]:\n return n - max(ans1[0][1] + ans2[1],ans2[0][1] + ans1[1])\n else:\n return n//2\n else:\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s000351755', 's028148723', 's195698448', 's623800709', 's866458172', 's728634093']
[10592.0, 3064.0, 3192.0, 2940.0, 13992.0, 10844.0]
[56.0, 19.0, 18.0, 18.0, 102.0, 102.0]
[814, 759, 1455, 449, 1528, 732]
p03244
u623687794
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())\nnums=list(map(int,input().split()))\na=set(nums)\nif len(a)==1:\n print(n//2)\nelse:\n odd=nums[::2]\n even=nums[1::2]\n o=Counter(odd)\n e=Counter(even)\n ans=n-o.most_common()[0][1]-e.most_common()[0][1]\n if o.most_common[0][0]==e.most_common[0][0]:\n prin...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s209589494', 's607192973', 's541541520']
[24672.0, 24672.0, 24672.0]
[100.0, 104.0, 149.0]
[422, 252, 434]
p03244
u623814058
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())\n*V,=map(int,input().split())\nimport Counter from collections \n\nc1=Counter(V[0::2]).most_common()+[(0,0)]\nc2=Counter(V[1::2]).most_common()+[(0,0)]\nif c1[0][0]!=c2[0][0]:\n print(N-c1[0][1]-c2[0][1])\nelse:\n print(min(N-c1[0][1]-c2[1][1],N-c1[1][1]-c2[0][1]))', 'N=int(input())\n*V,=map(int,...
['Runtime Error', 'Runtime Error', 'Accepted']
['s197002289', 's283892956', 's732858805']
[8952.0, 8864.0, 25344.0]
[30.0, 26.0, 77.0]
[277, 278, 276]
p03244
u625554679
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())\na = [int(aa) for aa in input().split()]\n\ndef add_entry(hist, aa):\n if aa in hist:\n hist[aa] += 1\n else:\n hist[aa] = 1\n\n\ndef make_hist(a):\n even_hist = {}\n odd_hist = {}\n\n for i in range(len(a)//2):\n add_entry(even_hist, a[2*i])\n add_entry(odd...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s335034351', 's405971918', 's087020712']
[23324.0, 3064.0, 20764.0]
[169.0, 17.0, 103.0]
[900, 717, 883]
p03244
u625963200
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()))\nE=Counter(V[::2]).most_common()\nO=Counter(V[1::2]).most_common()\n\nE1=E[0][1]\nO1=O[0][1]\nif E[0][0]==O[0][0]:\n print(n//2)\nelif E1==O1==n//2:\n print(0)\nelse:\n E2=E[1][1] if len(E)>1 else 0\n O2=O[1][1] if len(O)>1 else 0\n if E2!=0 and O2!=0:\n print(...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s078874710', 's352500324', 's580490544', 's274523007']
[14404.0, 20564.0, 20572.0, 20572.0]
[40.0, 129.0, 87.0, 86.0]
[396, 496, 269, 269]
p03244
u626468554
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\ndic0 = [0 for i in range(10**5+1)]\ndic1 = [0 for i in range(10**5+1)]\nfor i in range(n):\n if i%2==0: \n dic0[v[i]] += 1\n if i%2==1:\n dic1[v[i]] += 1\n\nMX0_1 = max(dic0)\nMX1_1 = max(dic1)\n\nli0 = []\nli1 = []\n\n\nfor i in range(10**5...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s488628222', 's662411274', 's081497917']
[3064.0, 14692.0, 14236.0]
[24.0, 123.0, 125.0]
[844, 733, 764]
p03244
u628581330
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()))\nodd = v[::2 ]\neven = v[1::2]\n\n# if len(set(aaa))!=1:\n\n\n\n# else:\n\n\n# return int(aaa_min),most_aaa\nif len(set(v))==1:\n print(int(n/2))\nelse:\n if len(set(even))!=1:\n even_max = Counter(even).mos...
['Runtime Error', 'Accepted']
['s370146609', 's543017343']
[17500.0, 15588.0]
[94.0, 74.0]
[1007, 413]
p03244
u629350026
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()))\ntemp1=[]\ntemp2=[]\nfor i in range(0,n):\n if i%2==0:\n temp1.append(v[i])\n else:\n temp2.append(v[i])\ncount=0\nfrom collections import Counter\nc1=Counter(temp1)\nmode1=c1.most_common()[0][1]\nmode1s=c1.most_common()[1][1]\nc2=Counter(temp2)\nmode2=c2.most_...
['Runtime Error', 'Accepted']
['s834612432', 's665907690']
[19168.0, 24272.0]
[146.0, 174.0]
[544, 834]
p03244
u638282348
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()))\na1, a2, *_ = Counter(V[0::2]).most_common() + [(0, 0)]\nb1, b2, *_ = Counter(V[1::2]).most_common() + [(0, 0)]\nprint(N - max(a1[1] + b2[1], a2[1] + b1[1]) if a1[0] == b1[0] else N - a1[1] + b1[1])\n', 'from collections import Cou...
['Wrong Answer', 'Accepted']
['s752780321', 's681563312']
[20572.0, 20572.0]
[89.0, 89.0]
[281, 283]
p03244
u640319601
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\n\nn = int(input())\nl = list(map(int, input().split()))\n\nif len(set(l)) == 1:\n print(n//2)\n exit()\n\nleven = [x for x in l[::2]]\nlodd = [x for x in l[1::2]]\n\nce = collections.Counter(leven)\nco = collections.Counter(lodd)\nce = sorted(ce.items(), key=lambda x:x[1])\nco = sorted(co...
['Runtime Error', 'Runtime Error', 'Accepted']
['s592306526', 's825389451', 's264990325']
[23764.0, 23764.0, 23764.0]
[97.0, 97.0, 99.0]
[501, 501, 501]
p03244
u642012866
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 = input().split()\no = {"":0}\ne = {"":0}\nfor s in v[::2]:\n if s in o:\n o[s] += 1\n else:\n o[s] = 1\n\nfor s in v[1::2]:\n if s in e:\n e[s] += 1\n else:\n e[s] = 1\n\no = sorted(o.items(), key=lambda x:x[1])\ne = sorted(e.items(), key=lambda x:x[1])\n\n...
['Wrong Answer', 'Accepted']
['s860658017', 's174222866']
[20040.0, 20016.0]
[81.0, 80.0]
[409, 417]
p03244
u642528832
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())\na = list(map(int,input().split()))\na1 = collections.Counter(a[0::2]).most_common()\na2 = collections.Counter(a[1::2]).most_common()\n#a1.append((0,0))\n#a2.append((0,0))\nprint(a1)\nprint(a2)\n\nif a1[0] != a2[0]:\n print(n-a1[0][1]-a2[0][1])\nelse:\n print(min(n-a1[0][1...
['Runtime Error', 'Accepted']
['s222983102', 's361757736']
[25308.0, 25124.0]
[99.0, 76.0]
[338, 338]
p03244
u642823003
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()))\neven_list = [0] * (n + 1)\nodd_list = [0] * (n + 1)\n\nfor i in range(n):\n if i % 2 == 0:\n even_list[i] += 1\n\n else:\n odd_list[i] += 1\n\nif even_list.index(max(even_list)) == odd_list.index(max(odd_list)):\n even_sorted, odd_sorted = ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s078221327', 's334339440', 's630520464', 's485329211']
[14404.0, 14404.0, 14396.0, 14268.0]
[68.0, 68.0, 68.0, 85.0]
[485, 477, 485, 501]
p03244
u645250356
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,fractions\nfrom collections import Counter\nn = int(input())\nv = [int(i) for i in input().split()]\na = Counter(v[1::2]).most_common()\nb = Counter(v[0::2]).most_common()\na.append(0,0)\nb.append(0,0)\n\nif a[0][0] != b[0][0]:\n print(n//2 - a[0][1] + n//2 - b[0][1])\nelse:\n tmp_x = n//2 - a[1][1]...
['Runtime Error', 'Accepted']
['s808515628', 's597779834']
[22348.0, 22348.0]
[105.0, 106.0]
[397, 401]
p03244
u648212584
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 corections import Counter \nn = int(input())\nv = list(map(int,input().split()))\n \nodd = []\neven = []\nfor i in range(n//2):\n\todd.append(v[2*i+1])\n\teven.append(v[2*i])\n \nodd = sorted(odd)\neven = sorted(even)\nac = Counter(odd).most_common(2)\nbc = Counter(even).most_common(2)\ndef cnt(X):\n\tcount = 0\...
['Runtime Error', 'Accepted']
['s501039437', 's909677567']
[3064.0, 16100.0]
[17.0, 137.0]
[608, 609]
p03244
u649126012
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/env python3\nimport sys\nimport statistics\nimport collections\n\ndef solve(n: int, v: "List[int]"):\n half_length = len(v) // 2\n O = [v[i] for i in range(1, n, 2)]\n E = [v[i] for i in range(0, n, 2)]\n\n co = list(collections.Counter(O).most_common())\n ce = list(collections.Counter(E).mo...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s190319454', 's290929348', 's470097670', 's572462749', 's580659674']
[29828.0, 29828.0, 29764.0, 29828.0, 29836.0]
[137.0, 139.0, 144.0, 141.0, 149.0]
[1430, 1426, 1392, 1454, 1608]
p03244
u651879504
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())\nu = list(map(int,input().split()))\n\nhantei = 0\n\nfor i in range(1,n):\n if u[0] != u[i]:\n hantei = 1\n break\n\nif hantei == 0:\n print(n // 2)\nelse:\n u1 = [] \n u2 = [] \n ans = 0\n for j in range(n):\n if j % 2 == 0:\n u2.appe...
['Runtime Error', 'Accepted']
['s006779469', 's184152360']
[2940.0, 20576.0]
[17.0, 126.0]
[553, 1214]
p03244
u652150585
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())\nl=list(map(int,input().split()))\n#print(l)\ne=[None]*(n//2)\no=[None]*(n//2)\nfor i in range(n//2):\n e[i]=l[2*i]\n o[i]=l[2*i+1]\nprint(e,o)\nce=collections.Counter(e)\nco=collections.Counter(o)\nce=ce.most_common()\nco=co.most_common()\n#print(co)\nce.append((0,0))\nco.a...
['Wrong Answer', 'Accepted']
['s253396523', 's962175762']
[19680.0, 19032.0]
[109.0, 101.0]
[429, 430]
p03244
u656995812
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(str, input().split()))\ngu_row = []\nki_row = []\n\nfor i in range(n):\n if i % 2 == 0:\n gu_row.append(v[i])\n elif i % 2 == 1:\n ki_row.append(v[i])\n\ngu_count = collections.Counter(gu_row).most_common()\nki_count = collections.Counter(ki_row)....
['Wrong Answer', 'Accepted']
['s904066276', 's838040286']
[24924.0, 23516.0]
[151.0, 118.0]
[964, 932]
p03244
u657994700
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-v_odd_common[0][1]-v_even_common[1][1]', 'from collections import Counter\n \nn = int(input())\nv_array = list(map(int,input().split()))\n \nv_odd = v_array[0::2]\nv_even = v_array[1::2]\n \nv_odd_common = Counter(v_odd).most_common()\nv_even_common = Counter(v_even).most_common()\n\nv_odd_common.append((0,0))\nv_e...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s046679602', 's137154310', 's355757321', 's848447132', 's886307799', 's968445990']
[2940.0, 3064.0, 25172.0, 3064.0, 2940.0, 21084.0]
[17.0, 18.0, 145.0, 17.0, 18.0, 88.0]
[40, 482, 1190, 482, 40, 483]
p03244
u664884522
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\nimport sys\nn = int(input())\nv = [int(x) for x in input().split()]\ntest = [x == v[0] for x in v]\nif all(test):\n print(0)\n sys.exit()\nodd = [int(x) for x in v[0::2]]\neven = [int(x) for x in v[1::2]]\nodd_count = Counter(odd)\nkey1 = list(odd_count)\neven_count = Counter(ev...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s695551149', 's802054540', 's857693767']
[24864.0, 24524.0, 22476.0]
[75.0, 83.0, 62.0]
[622, 629, 469]
p03244
u665038048
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())\ncount=0\nv=[]\nv=[int(i) for i in input().split()]\nfor i in range(n-2):\n if v[i]==v[i+2]:\n pass\n else:\n count+=1\nnum=v[0]\nfor i in range(n):\n v.remove(num)\nprint(v)\nif len(v)==0:\n if n%2==0:\n count=int(n/2)\n else:\n count=int((n-1)/2)\nprint(coun...
['Runtime Error', 'Accepted']
['s547903085', 's128432625']
[14268.0, 18520.0]
[2104.0, 78.0]
[303, 389]
p03244
u667469290
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 -*-\nfrom collections import Counter\nfrom operator import itemgetter\ndef solve():\n input()\n V = list(map(int, input().split()))\n l = sorted(Counter(V[::2]).items()+[(0,0)], key=itemgetter(1), reverse=True)\n u = sorted(Counter(V[1::2]).items()+[(0,0)], key=itemgetter(1), reverse=T...
['Runtime Error', 'Accepted']
['s136665526', 's276413388']
[15588.0, 20572.0]
[49.0, 92.0]
[508, 520]
p03244
u669173971
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()))\nc1=collections.Counter(v[::2])\nc2=collections.Counter(v[1::2])\nc1_v1=c1.most_common()[0][0]\nc2_v1=c2.most_common()[0][0]\nc1_n1=c1.most_common()[0][1]\nc2_n1=c2.most_common()[0][1]\nc1_n2=c1.most_common(2)[1][1]\nc2_n2=c2.most_common(2)[1][1]\n\...
['Runtime Error', 'Accepted']
['s889300601', 's887306860']
[18656.0, 18656.0]
[121.0, 123.0]
[583, 665]
p03244
u671446913
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\nif len(set(v)) == 1:\n print(n//2)\nelse:\n v1 = v[::2]\n v2 = v[1::2]\n \n cl1 = collections.Counter(v1)\n cl2 = collections.Counter(v2)\n \n cmc_1st_1 = cl1.most_common()[0][1]\n cmc_1st_2 = cl2.most_common()[0][1]\n cmc_2nd_1 ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s431820253', 's806439293', 's227593981']
[20572.0, 21084.0, 21084.0]
[108.0, 90.0, 90.0]
[653, 543, 504]
p03244
u673361376
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\nimport heapq\n\nN = int(input())\n\nif str(N)[0]*len(str(N)) == str(N):\n print(N//2)\n exit()\n\nVeve, Vodd = [],[]\nidx = 0\nfor v in map(int,input().split()):\n if idx%2 == 0: Veve.append(v)\n else: Vodd.append(v)\n idx += 1\n\nVeve_cnt, Vodd_cnt = [], []\n[heapq.heappush(Veve...
['Wrong Answer', 'Accepted']
['s560192609', 's578760087']
[22016.0, 19292.0]
[2105.0, 113.0]
[728, 1113]
p03244
u676496404
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()))\neven = Counter(v[::2]).most_common(2)\nodd = Counter(n[1::2]).most_common(2)\nif even[0][0] != odd[0][0]:\n ans = n - even[0][1] - odd[0][1]\nelse:\n if len(even) == 1:\n ans = n//2\n else:\n ans = n - max(...
['Runtime Error', 'Runtime Error', 'Accepted']
['s155566305', 's196132638', 's672649350']
[15588.0, 3064.0, 15588.0]
[58.0, 17.0, 76.0]
[363, 363, 420]
p03244
u677440371
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()] \n\nfrom statistics import mode\nif len(set(v)) == 1:\n print(int(len(v) / 2))\nelse:\n print(len(v[0::2]) - collections.Counter(v[0::2]).most_common()[0][1] + len(v[1::2]) - collections.Counter(v[1::2]).most_common()[0][1])', 'n = int(input())\nv = [int(...
['Runtime Error', 'Runtime Error', 'Accepted']
['s130332139', 's338233244', 's111624094']
[16412.0, 16480.0, 20512.0]
[70.0, 81.0, 97.0]
[280, 280, 452]
p03244
u677705680
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 nn in range(n):\n if nn % 2 == 0:\n even.append(V[nn])\n else:\n odd.append(V[nn])\n\ne = collections.Counter(even).most_common()\no = collections.Counter(odd).most_common()\n\nif e[0][0] != o[0][0]:\n print(n - e...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s061576829', 's585677601', 's759648353', 's122589673']
[14404.0, 22236.0, 22620.0, 21212.0]
[65.0, 152.0, 132.0, 106.0]
[585, 627, 627, 607]
p03244
u682467216
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 = [i for i in input().split()]\n \nodd = Counter(V[::2]).most_common(2)\neven = Counter(V[1::2]).most_common(2)\n\nprint(odd)\n \nif odd[0][0] != even[0][0]:\n print(N - odd[0][1] - even[0][1])\nelif len(odd) == 1:\n print(N // 2)\nelse:\n o0e1 = N - od...
['Wrong Answer', 'Accepted']
['s397042751', 's253203788']
[16228.0, 16228.0]
[69.0, 67.0]
[388, 375]
p03244
u682730715
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\nimport sys\n\nimport heapq\nimport re\nimport bisect\nimport random\nimport math\nimport itertools\nfrom collections import defaultdict, deque\nfrom copy import deepcopy\nfrom decimal import *\n\nn = int(input())\nv = list(map(int, input().split()))\na = defaultdict(int)\nb = defaultdict(int)\n\nnn =...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s610615393', 's684678718', 's192420035']
[18752.0, 3064.0, 24640.0]
[129.0, 17.0, 161.0]
[701, 889, 976]
p03244
u684204084
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 = []\nv2 = []\nfor i in range(n):\n\tif i%2 == 0:\n\t\tv1.append(v[i])\n\telse:\n\t\tv2.append(v[i])\nv1.sort()\nv2.sort()\n\ncnt1 = []\ncnt2 = []\nnow = v1[0]\ncon = 1\nfor i in range(1, len(v1)):\n\tif now == v1[i]:\n\t\tcon += 1\n\telse:\n\t\tnow = v1[i]\n\...
['Wrong Answer', 'Accepted']
['s709280580', 's880275061']
[14052.0, 19212.0]
[132.0, 178.0]
[795, 942]
p03244
u687343821
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=list(map(int,input().split(" ")))\nlist_odd=N[::2]\nlist_even=N[1::2]\nc_odd = collections.Counter(list_odd)\nc_even = collections.Counter(list_even)\nmost_odd=c_odd.most_common()[0][1]\nmost_even=c_even.most_common()[0][1]\nprint(len(list_even)+len(list_odd)-most_even-most_odd)', 'import collec...
['Runtime Error', 'Runtime Error', 'Accepted']
['s619047446', 's690489176', 's144855032']
[3316.0, 3316.0, 19040.0]
[24.0, 22.0, 123.0]
[293, 295, 789]
p03244
u691896522
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 = []\neven_c = 0\nodd = []\nodd_c = 0\nans = 0\nfor i in range(len(v)):\n print(i)\n if i % 2 == 0:\n even.append(v[i])\n even_c += 1\n else:\n odd.append(v[i])\n odd_c += 1\n \neven = collectio...
['Runtime Error', 'Accepted']
['s672282997', 's317654939']
[21472.0, 19032.0]
[239.0, 143.0]
[1680, 1387]
p03244
u695261159
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 = map(int, input().split())\nV = list(map(int, input().split()))\n\nans = 0\neve = V[0::2]\nodd = V[1::2]\ncntEve = collections.Counter(eve)\ncntOdd = collections.Counter(odd)\n\nif cntEve.most_common()[0][0] == cntOdd.most_common()[0][0]:\n ans = N - max(cntEve.most_common()[0][1],cntOdd.mos...
['Runtime Error', 'Accepted']
['s357751596', 's486604076']
[24612.0, 24620.0]
[85.0, 99.0]
[473, 913]
p03244
u705418271
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())\nalist = list(map(int,input().split()))\nlist1 = alist[1::2]\nlist2 = alist[0::2]\nfrom collections import Counter\ndic1 = Counter(list1).most_common()\ndic2 = Counter(list2).most_common()\n\nif dic1[0][0]!=dic2[0][0]:\n print(n - dic1[0][1] - dic2[0][1]+1)\nelse:\n print(min(n - dic1[0][1] - dic2...
['Runtime Error', 'Accepted']
['s079629797', 's905430347']
[25732.0, 25608.0]
[82.0, 84.0]
[347, 378]
p03244
u709304134
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\nimport numpy as np\nimport collections\nN = 1000000\nls = list(map(int,input().split()))\nls.append(N)\nls.append(N)\narray = np.array(ls).reshape(-1,2).T\nc_even = collections.Counter(array[0])\nc_odd = collections.Counter(array[1])\nif len(set(ls))==2:\n print (int((len(ls)-2)/2))\nelif c_even.mos...
['Runtime Error', 'Accepted']
['s874493491', 's669998705']
[21280.0, 33976.0]
[1059.0, 301.0]
[577, 594]
p03244
u713830790
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...
["if __name__ == '__main__': n = int(input())\n vs = list(map(int, input().split()))\n\n even = vs[::2]\n odd = vs[1::2]\n\n from collections import Counter\n\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s145564406', 's521605115', 's860326674']
[2940.0, 2940.0, 21952.0]
[17.0, 17.0, 107.0]
[1612, 1554, 1544]
p03244
u721970149
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(x) for x in input().split()]\n\neven = [v[2*i] for i in range(N//2)]\nodd = [v[2*i+1] for i in range(N//2)]\n\nfrom collections import Counter\ndev = Counter(even)\ndod = Counter(odd)\n\nevmax = sorted(dev, key=dev.get, reverse = True)[0]\nif len(dev) != 1 :\n ev2nd = sorted(dev, key=dev...
['Wrong Answer', 'Accepted']
['s982064122', 's731299254']
[19040.0, 15900.0]
[93.0, 87.0]
[803, 520]
p03244
u724892495
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...
['a = [[], []]\n[a[i%2].append(t) for i, t in enumerate(map(int, input().split()))]\nprint(sum([(lambda x: len(x) -max([x.count(xi) for xi in x]))(ai) for ai in a]))', 'N = int(input())\na = [[],[]]\n[a[i%2].append(t) for i, t in enumerate(map(int, input().split()))]\n\na_cnt = [{},{}]\nfor i in range(2):\n for j in...
['Runtime Error', 'Accepted']
['s041070766', 's730344895']
[3060.0, 19632.0]
[18.0, 123.0]
[161, 744]
p03244
u727787724
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!\nn=int(input())\nw=list(map(int,input().split()))\nans=0\nif len(set(w))==1:\n print(len(w)//2)\nelif len(set(w))==2:\n w.sort()\n print(abs(w.count(w[0])-w.count(w[len(w)-1])))\nelse:\n cnt=[]\n ans=0\n w.sort()\n t=w[0]\n for j in range(n):\n if w[j]...
['Wrong Answer', 'Accepted']
['s980430867', 's777110767']
[15736.0, 18012.0]
[125.0, 219.0]
[723, 1805]
p03244
u731368968
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\nvv = [[], []]\nfor i in range(n):\n vv[i % 2].append(v[i])\n\nimport collections\nitems0 = sorted(collections.Counter(vv[0]).items(), key=lambda x: -x[1])\nitems1 = sorted(collections.Counter(vv[1]).items(), key=lambda x: -x[1])\nkey0 = [x[0] for x in items0...
['Runtime Error', 'Accepted']
['s887635554', 's130572026']
[3064.0, 21212.0]
[17.0, 125.0]
[608, 706]
p03244
u732870425
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 = {}\n\nfor i in range(n):\n if i % 2 == 0:\n if v[i] not in even:\n even[v[i]] = 0\n even[v[i]] += 1\n else:\n if v[i] not in odd:\n odd[v[i]] = 0\n odd[v[i]] += 1\n\neven_sorted = sorted(e...
['Runtime Error', 'Accepted']
['s481705609', 's009771499']
[17404.0, 20896.0]
[98.0, 123.0]
[637, 762]
p03244
u734548018
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\nimport math\nimport sys\nimport heapq\nfrom operator import itemgetter\nimport itertools\ninput = sys.stdin.readline\n\n# a = int(input().rstrip())\n# a, b = map(int, input().rstrip().split())\n# D = list(map(int, input().rstrip().split()))\n# H = [int(input().rstrip()) for _ in range(L)]\n...
['Wrong Answer', 'Accepted']
['s961688867', 's763892352']
[16928.0, 20700.0]
[112.0, 85.0]
[1229, 455]
p03244
u736729525
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/python3\nfrom collections import Counter\nimport sys\n\ndef debug(*f):\n print(*f, file=sys.stderr)\n\ndef f(odd, even, N):\n debug(N, odd, even)\n\n\ndef main(N, V):\n debug("N=",N)\n debug("V=",V)\n N = int(N)\n V = [int(x) for x in V.split(" ")]\n\n odd = Counter(V[0::2]).most_comm...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s078758707', 's852442813', 's651556061']
[21272.0, 21276.0, 21272.0]
[88.0, 86.0, 89.0]
[1035, 817, 1042]
p03244
u740284863
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 itertools import accumulate\nfrom collections import Counter\n\nN = int(input())\nv = list(map(int,input().split()))\nd = Counter(v).most_common()\nmost_common = d[0][0]\ntry:\n second_common = d[1][0]\nexcept:\n print(N//2)\n exit()\ntry:\n third_common = d[2][0]\nexcept:\n third_common = float('...
['Runtime Error', 'Accepted']
['s347530703', 's875014234']
[21364.0, 20572.0]
[79.0, 85.0]
[707, 316]
p03244
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[...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s180590153', 's423478487', 's160260003']
[23324.0, 17760.0, 20720.0]
[162.0, 83.0, 134.0]
[2081, 1673, 2018]
p03244
u757030836
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[0::2]).most_common()\nb = Counter(v[1::2]).most_common()\na.append([0,0])\nb.append([0,0])\n\nif a[0][0] != b[0][0]:\n print(n-(a[0][1]+b[0][1]))\nelse:\n print(min(n-(a[1][1]+b[0][1]),n-(a[0][1]+b[1][1]))\n ...
['Runtime Error', 'Accepted']
['s265748019', 's599558165']
[3064.0, 20572.0]
[17.0, 85.0]
[307, 318]
p03244
u757274384
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[0::2]).most_common(2)\nA = Counter(V[1::2]).most_common(2)\nA.append((0,0))\nA.append((0,0))\nif A[0][0]!=B[0][0]:\n print(n-(A[0][1]+B[0][1]))\nelse:\n print(min(n-(A[1][1]+B[0][1]),n-(A[0][1]+B[1][1])))\n', 'f...
['Runtime Error', 'Accepted']
['s442191470', 's397981966']
[15588.0, 15588.0]
[75.0, 74.0]
[302, 302]
p03244
u760794812
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(input())\nS0 = {}\nS1 = {}\nfor i, item in enumerate(S):\n if i%2 == 0:\n if item not in S0:\n S0[item] =1\n else:\n S0[item] += 1\n else:\n if item not in S1:\n S1[item] =1\n else:\n S1[item] += 1\n\nS0list = list(S0.values()).sort(reverse=True)\nS1list = ...
['Runtime Error', 'Accepted']
['s918941406', 's995630646']
[8880.0, 17632.0]
[211.0, 101.0]
[547, 710]
p03244
u763534217
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 copy\n\nn = int(input())\nv = list(map(int, input().split()))\n# print(v)\n\nla = [0 for i in range(5+10**5)]\nlb = [0 for i in range(5+10**5)]\n\nfor i in range(0, n, 2):\n la[v[i]] += 1\nfor i in range(1, n, 2):\n lb[v[i]] += 1\n\n# print(sum(la))\n# print(sum(lb))\n# print(max(la))\n# print(max(lb))\n...
['Wrong Answer', 'Accepted']
['s040619332', 's952476820']
[21284.0, 21228.0]
[148.0, 154.0]
[940, 961]
p03244
u779455925
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=[V[i] for i in range(N) if i%2==0]\nb=[V[i] for i in range(N) if i%2==1]\n\na=collections.Counter(a)\nb=collections.Counter(b)\na=a.most_common()\nb=b.most_common()\nprint(a)\nprint(b)\nif len(a)==len(b)==1:\n if a[0][0]==b[0][0]:\n pri...
['Wrong Answer', 'Accepted']
['s389596439', 's574030317']
[18784.0, 18784.0]
[142.0, 108.0]
[684, 666]
p03244
u780962115
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())\n\nseq=list(map(int,input().split()))\noddlist=[]\nevenlist=[]\n\nfor i in range(n):\n if ( i+1)%2!=0:\n \n oddlist.append(seq[i])\n else: \n evenlist.append(seq[i])\nprint(seq)\nprint(oddlist)\nprint(evenlist)\nmaxi=n/2\nmini=n/2\nif oddlist!=evenlist:\n for j in set(evenl...
['Wrong Answer', 'Accepted']
['s717431095', 's625219520']
[14908.0, 21084.0]
[2104.0, 110.0]
[779, 481]
p03244
u782930273
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...
['input()\nV = [int(v) for v in input().split()]\ncount = 0\nc1 = Counter(V[::2] + [0]).most_common()[0][0]\nfor v in V[::2]:\n if v != c1:\n count += 1\nc2 = Counter(V[1::2] + [0]).most_common()\nc2 = c2[0][0] if c1 != c2[0][0] else c2[1][0]\nfor v in V[1::2]:\n if v != c2:\n count += 1\nprint(coun...
['Runtime Error', 'Accepted']
['s604598664', 's315800826']
[14396.0, 20636.0]
[45.0, 157.0]
[308, 649]
p03244
u785578220
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...
['a = int(input())\nx = list(map(int, input().split()))\ny=[]\nz=[]\nfrom collections import Counter\nfor i in range(a):\n if i%2==0:\n y.append(x[i])\n else:\n z.append(x[i])\ny.append(0)\nz.append(0)\nc= Counter(y)\nd = Counter(z)\nc1=c.most_common()[0][1]\nif c.most_common()[1][0]==0:c2=0\nelse:c...
['Wrong Answer', 'Accepted']
['s818104757', 's085295543']
[24156.0, 20852.0]
[231.0, 163.0]
[628, 632]
p03244
u790877102
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())\n\nv = list(map(int,input().split()))\n\ns = []\nt = []\n\n\nimport collections\n\nfor i in range(0,n//2,2):\n\ts.append(v[i])\nfor i in range(1,n//2,2):\n\tt.append(v[i])\n\nS = collections.Counter(s)\n\t\nT = collections.Counter(t)\n\nx = S.most_common()[0][0] \n\nz = T.most_common()[0][0]\n\nprin...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s628521031', 's642324885', 's894220224', 's222254634']
[14396.0, 3064.0, 3064.0, 18784.0]
[70.0, 18.0, 17.0, 105.0]
[319, 545, 551, 396]
p03244
u790905630
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 rewrite_count(vi_list):\n if len(set(vi_list)) != 1:\n vi_count_list = [(i, vi_list.count(i)) for i in set(vi_list)]\n vi_count_list = sorted(vi_count_list, key=lambda x: x[1])\n return vi_count_list[-1][0], len(vi_list) - vi_count_list[-1][1], len(vi_list) - vi_count_list[-2][1]\n else...
['Wrong Answer', 'Accepted']
['s359014599', 's371569413']
[16872.0, 16884.0]
[2104.0, 70.0]
[910, 490]
p03244
u798818115
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 collections\n\nn=int(input())\nli=list(map(int,input().split()))\nl=[]\nr=[]\n\nfor i in range(n):\n if i%2==0:\n l.append(li[i])\n else:\n r.append(li[i])\n\nl_cnt=collections.Counter(l)\nr_cnt=collections.Counter(r)\n\n\nll=l_cnt.most_common(2)\nrr=r_...
['Wrong Answer', 'Accepted']
['s146481989', 's147244777']
[19040.0, 19040.0]
[97.0, 194.0]
[381, 669]
p03244
u801807320
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())\nn2 = n/2\nv = [int(i) for i in input().split()]\nv1 = []\nv2 = []\nfor i in range(n):\n if(i % 2 == 0):\n v1.append(v[i])\n else:\n v2.append(v[i])\ncount1 = [v1.count(v1[i]) for i in range(int(n2))]\ncount2 = [v2.count(v2[i]) for i in range(int(n2))]\nif(v1[count1.index(max(coun...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s253806859', 's407585566', 's678868986']
[14268.0, 21176.0, 21184.0]
[2104.0, 95.0, 92.0]
[671, 649, 538]
p03244
u806855121
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()))\nE = {}\nO = {}\nn = 1\nfor i, v in enumerate(V):\n if n:\n if v in E.keys():\n E[v] += 1\n else:\n E[v] = 1\n else:\n if v in O.keys():\n O[v] += 1\n else:\n O[v] = 1\n n = 1 - n\nE ...
['Wrong Answer', 'Accepted']
['s288546158', 's137030693']
[17644.0, 17648.0]
[107.0, 107.0]
[787, 690]
p03244
u807772568
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...
['a = int(input())\n\nb = list(map(int,input().split()))\nd = max(b)\nc = [0 for i in range(pow(10,5)+1)]\ncc = [0 for i in range(pow(10,5)+1)]\nfor i in range(len(b)):\n if i % 2 == 0:\n c[b[i]-1] += 1\n else:\n cc[b[i]-1] += 1\n\none = 0\nonee = 0\ntwo = 0\ntwoo = 0\nk = 0\nkk = 0\nfor i in range(...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s193764617', 's781680271', 's873904726', 's644256370']
[14404.0, 14404.0, 3064.0, 17116.0]
[108.0, 111.0, 17.0, 145.0]
[536, 546, 587, 752]
p03244
u810356688
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\ndef input(): return sys.stdin.readline().rstrip()\nfrom collections import Counter\nfrom operator import itemgetter\ndef main():\n n=int(input())\n V=[int(_) for _ in input().split()]\n even=V[0::2]\n odd=V[1::2]\n even_c=Counter(even)\n odd_c=Counter(odd)\n even_ci,odd_ci=list(even_c...
['Wrong Answer', 'Accepted']
['s180788644', 's149530823']
[24376.0, 21944.0]
[132.0, 98.0]
[656, 1080]
p03244
u811000506
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()))\nans = 0\nlia = v[::2]\nlib = v[1::2]\ntmp1 = len(lia)\ntmp2 = len(lib)\nlia.sort()\nlib.sort()\nif lia[0]==lib[-1]:\n print(n//2)\n exit()\nlib.sort(reverse=True)\nlia = collections.Counter(lia)\nlib = collections.Counter(lib)\nans += tmp1-li...
['Runtime Error', 'Accepted']
['s285608595', 's223189425']
[3064.0, 20572.0]
[17.0, 87.0]
[458, 280]