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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03062 | u460745860 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import sys\ninput=sys.stdin.readline\nN=int(input())\nnum = list(map(int,input().split()))\nc=0\nans=0\nfor i in range(N):\n if num[i]<0:\n c+=1 \nans = list(map(lambda x: abs(x),num))\nif c%2==0:\n print(ans)\nelse:\n print(sum(ans) - min(num,key=lambda x: abs(x))*2)', 'import sys\ninput=sys.stdin.readline\nN=... | ['Wrong Answer', 'Accepted'] | ['s814824203', 's973178950'] | [14252.0, 15180.0] | [85.0, 82.0] | [261, 266] |
p03062 | u466331465 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nx = [int(x) for x in input().split()]\ndp = [[0 for _ in range(2)] for _ in range(N+1)]\ndp[0][0] = 0\ndp[0][1] = -10**9\nfor i in range(N-1):\n dp[i+1][0] = max(dp[i][0]+x[i],dp[i][1]-x[i])\n dp[i+1][1] = max(dp[i][0]-x[i],dp[i][1]+x[i])\nprint(max(dp[N][0],dp[N][1]))', 'N = int(input())\nx = [in... | ['Wrong Answer', 'Accepted'] | ['s687136040', 's483312035'] | [27044.0, 27028.0] | [241.0, 256.0] | [281, 265] |
p03062 | u472534477 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import collections\n\nN,X,Y=map(int,input().split())\nif X > Y:\n exc=X\n X=Y\n Y=exc\nL=[]\nfor i in range(N-1):\n for j in range(i+1,N):\n if i >= Y-1 or j <= X-1:\n L.append(j-i)\n elif j-i == 1:\n L.append(1)\n elif i <= X-1 and j >= Y-1:\n L.appen... | ['Runtime Error', 'Accepted'] | ['s585790618', 's072575726'] | [3316.0, 23272.0] | [21.0, 257.0] | [593, 303] |
p03062 | u483645888 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import numpy as np\nn = int(input())\n*a, = map(int, input().split())\nb = np.abs(a)\n#print(b)\nprint(np.sum(b)-2*np.min(b) if (i<0 for i in a) else np.sum(b)) ', 'import numpy as np\nn = int(input())\n*a, = map(int, input().split())\nb = np.abs(a)\n#print(b)\nprint(np.sum(b)-2*np.min(b) if (np.sum(i<0 for i in a)%2... | ['Wrong Answer', 'Accepted'] | ['s358618111', 's745742491'] | [23320.0, 23320.0] | [184.0, 191.0] | [156, 166] |
p03062 | u488611616 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(map(int, input().split()))\n\nfor i in range(N - 1):\n if A[i] < 0 :\n print(A[i])\n A[i] *= -1\n A[i + 1] *= -1\n elif i == N - 2 and A[i] == 0:\n A[i + 1] *= -1\nprint(sum(A))', 'N = int(input())\nA = list(map(int,input().split()))\ncount = 0\n\nfor i in range(N):\n if A[i]... | ['Wrong Answer', 'Accepted'] | ['s019481467', 's750806147'] | [14412.0, 14412.0] | [114.0, 68.0] | [208, 184] |
p03062 | u497952650 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(map(int,input().split()))\n\nB = [abs(i) for i in A]\nif N%2 == 0:\n print(sum(B))\nelse:\n print(sum(B)-min(B))', 'N = int(input())\nA = list(map(int,input().split()))\n\nB = [abs(i) for i in A]\nminus = [int(i<0) for i in A]\nif sum(minus)%2 == 0:\n print(sum(B))\nelse:\n prin... | ['Wrong Answer', 'Accepted'] | ['s089865059', 's026476655'] | [14284.0, 14412.0] | [52.0, 66.0] | [138, 179] |
p03062 | u508927589 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int,input().split()))\n\nfor i in range(n-1):\n if a[i] <= 0 and a[i+1] <= 0:\n a[i] = -a[i]\n a[i+1] = -a[i+1]\n \nfor i in range(n-2):\n if a[i] < 0 and a[i+1] >= 0 and a[i+2] <= 0:\n a[i] = -a[i]\n a[i+2] = -a[i+2]\n \nfor i in range(n-... | ['Runtime Error', 'Accepted'] | ['s392074273', 's883302252'] | [14412.0, 14224.0] | [103.0, 149.0] | [507, 283] |
p03062 | u516949135 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = map(int,input())\nif 0 in A:\n print(sum(A))\nelse:\n count=0\n min_A =100000000000000000\n for i in range(N):\n if A[i]<0:\n count=count+1\n if abs(A[i])<min_A:\n min_A = abs(A[i])\n print(sum(A)-min_A)', 'N = int(input())\nA = map(int,input().split())\nif 0 in A:\n print(... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s086446302', 's359480341', 's677458394', 's326840413'] | [5380.0, 11196.0, 14252.0, 14412.0] | [21.0, 43.0, 84.0, 77.0] | [234, 242, 296, 341] |
p03062 | u517447467 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(map(int, input().split()))\n \ncount = len([i for i in A if i < 0])\n \nif count % 2 == 1: \n print(sum(A)-2*min(A))\nelse:\n print(sum(A))', 'N = int(input())\nA = list(map(int, input().split()))\n\nprint(sum(A)-2*min(A))', 'N = int(input())\nA = list(map(int, input().split()))\n\ncount ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s151837371', 's509512736', 's874375295', 's213631401'] | [14324.0, 14412.0, 14412.0, 14412.0] | [52.0, 45.0, 48.0, 55.0] | [160, 76, 158, 184] |
p03062 | u518042385 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n=int(input())\nl=list(map(int,input().split()))\na=abs(l[0])\nm=0\nd=0\nz=0\ns=0\nfor i in range(n):\n if l[i]<0:\n d+=1\n elif l[i]=0:\n z+=1\nif d%2==0 or (d+z)%2==0:\n for i in range(n):\n s+=abs(l[i])\n print(s)\nelse:\n for i in range(1,n):\n if a>=abs(l[i]):\n a=abs(l[i])\n m=i\n s=... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s072481402', 's359025111', 's859186667', 's338797885'] | [2940.0, 14412.0, 2940.0, 14224.0] | [17.0, 90.0, 17.0, 86.0] | [411, 231, 407, 292] |
p03062 | u528388170 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\nA = list(map(int,input().split()))\nabs_A = [abs(i) for i in A]\nzero = 0\nminus = 0\nfor i in A:\n if i < 0:\n minus += 1\n elif i == 0:\n zero += 1 \nprint(minus)\nif minus % 2 == 0 or (zero in A):\n print(sum(abs_A))\nelse:\n print(sum(abs_A) - min(abs_A)*2)', 'n = int(... | ['Wrong Answer', 'Accepted'] | ['s041180540', 's622108425'] | [14224.0, 14412.0] | [64.0, 63.0] | [292, 279] |
p03062 | u534308356 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['\nN = int(input())\ndata = list(map(int, input().split()))\n\ndef ary_abs(data):\n for i in range(len(data)):\n data[i] = abs(data[i])\n\n\nfor i in data:\n count = 0\n if data <= 0:\n count += 1\n\nif count % 2 == 0:\n \n \n ary_abs(data)\n print(sum(data))\nelse:\n \n \n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s567271897', 's718867829', 's435008344'] | [14412.0, 14284.0, 14412.0] | [43.0, 66.0, 63.0] | [469, 465, 497] |
p03062 | u539517139 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n=int(input())\na=list(map(int,input().split()))\nb=[]\nfor _ in range(n):\n if a[_]<0:\n b.append(a.pop(_)*(-1))\nif 0 in a or len(b)%2==0:\n print(sum(a)+sum(b))\nelse:\n b.sort()\n print(sum(a)+sum(b)-(b[0]*2))', 'n=int(input())\na=list(map(int,input().split()))\nb=[]\nfor _ in range(n):\n if a[_]<0:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s036217758', 's726312696', 's270620317'] | [15020.0, 14332.0, 14332.0] | [799.0, 800.0, 110.0] | [210, 210, 188] |
p03062 | u547167033 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n=int(input())\na=list(map(int,input().split()))\ncnt=0\nfor i in range(n):\n if a[i]<0:\n cnt+=1\nif min(a)>=0 or cnt%2==0:\n print(sum(a))\n exit()\nb=[abs(a[i]) for i in range(n)]\ns=sum(b)\nans=-10**18\nfor i in range(n):\n ans=max(ans,s-2*b[i])\nprint(ans)\n', 'n=int(input())\na=list(map(int,input().split... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s771293352', 's915449573', 's209956249'] | [14412.0, 14224.0, 14332.0] | [110.0, 95.0, 107.0] | [255, 193, 276] |
p03062 | u549383771 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na_list = list(map(int,input().split()))\ndp = [[0] * 2 for _ in range(n-1)]\ndp[0][0] = a_list[0] + a_list[1]\ndp[0][1] = -1*(a_list[0] + a_list[1])\n\nfor i in range(1,n-1):\n dp[i][0] = max(dp[i-1][0] + a_list[i+1] , dp[i-1][1] + a_list[i+1])\n dp[i][1] = max(dp[i-1][1] + a_list[i+1] -2*a_li... | ['Wrong Answer', 'Accepted'] | ['s726814431', 's289497514'] | [25616.0, 25200.0] | [270.0, 254.0] | [398, 394] |
p03062 | u552823722 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(map(int,input().split()))\n\ndebug = True\n\nwhile True:\n changed = False\n i = 1\n while i < N - 1:\n if (A[i] > 0) and (A[i - 1] < 0) and (A[i + 1] < 0):\n A[i] = A[i] * -1\n A[i - 1] = A[i - 1] * -1\n changed = True\n if debug:... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s161456163', 's812747574', 's756793407'] | [145176.0, 145176.0, 20076.0] | [1253.0, 1260.0, 85.0] | [1509, 1509, 381] |
p03062 | u556849401 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['# -*- coding: utf-8 -*-\n"""\nCreated on Tue May 14 10:45:22 2019\n\n@author: avina\n"""\n\nN = int(input())\nL = list(map(int, input().strip().split()))\ndp = [[0,0] for i in range(N+1)]\nif L[0] >= 0:\n dp[0][1] = -L[0]\nelse:\n dp[0][1] = L[0]\nfor i in range(N):\n dp[i+1][0] = max(dp[i][0] + L[i], dp[i][... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s340922506', 's562360875', 's000907174'] | [25644.0, 25644.0, 25576.0] | [203.0, 190.0, 239.0] | [387, 305, 340] |
p03062 | u562935282 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ["import numpy as np\n\ninf = float('inf')\n\nN = int(input())\na = map(int, input().split())\n\ndp = np.zeros((N + 1, 2))\ndp[0][1] = -inf\n\n\n\nfor i, aa in enumerate(a, 0):\n dp[i + 1][0] = max(dp[i][0] + aa, dp[i][1] - aa)\n dp[i + 1][1] = max(dp[i][0] - aa, dp[i][1] + aa)\nprint(dp[N][0])\n", 'import numpy ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s118468972', 's916299636', 's642347604'] | [20988.0, 13668.0, 14412.0] | [999.0, 151.0, 96.0] | [436, 437, 312] |
p03062 | u566935164 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['\nl = int(input())\ntmp = list(map(int, input().split()))\nlst = list(map(lambda x: x if x > 0 else x*-1, tmp))\n\nans = 0\nif l % 2 == 0:\n ans = sum(lst)\nelse:\n ans = sum(lst)-(min(lst)*2)\n\nprint(ans)\n', 'l = int(input())\ntmp = list(map(int, input().split()))\nlst = list(map(lambda x: x if x > 0 else x*... | ['Wrong Answer', 'Accepted'] | ['s293628195', 's929425119'] | [14332.0, 14208.0] | [59.0, 69.0] | [202, 261] |
p03062 | u571128069 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nAn = list(map(int, input().split()))\n\nAn_neg = [ -a for a in An if a < 0]\n\nans = sum(An)\n\nif len(An_neg) % 2 == 1:\n ans -= 2 * min(An)\n pass\n\nprint(ans)\n', 'from itertools import *\nfrom collections import *\n\nN = int(input())\nAn = list(map(int, input().split()))\n\nAn_pos, An_neg... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s125647995', 's203504610', 's573919501', 's205175329'] | [14284.0, 14668.0, 14748.0, 11212.0] | [51.0, 64.0, 100.0, 105.0] | [176, 373, 928, 319] |
p03062 | u576432509 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['from bisect import bisect_left,bisect,bisect_right\nimport sys\n\nicase=1\nif icase==0:\n n=int(input())\n a=list(map(int,input().split()))\n\na.sort()\nii=bisect(a,0)\n\nif ii==n:\n if ii%2==0:\n asum=-sum(a)\n else: \n asum=-sum(a[0:ii-1])+a[ii-1]\n print(asum)\n sys.exit()\n\nif ... | ['Runtime Error', 'Accepted'] | ['s898314873', 's786279540'] | [9172.0, 20388.0] | [28.0, 75.0] | [484, 485] |
p03062 | u577138895 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = map(int, input().split())\nplus_count = 0\ntotal = 0\nminimum = 999999999999999999\n\nfor a in A:\n\ttotal += abs(a)\n\tif abs(a) < minimum:\n\t\tminimum = abs(a)\n\tif a >= 0:\n\t\tplus_count += 1\n\t\t\t\nif plus_count % 2 == 0 or plus_count == N:\n\tprint(total)\nelse:\n\tprint(total + 2 * mi... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s074712900', 's205181837', 's245843221', 's323177937', 's905825472', 's516049378'] | [11212.0, 11196.0, 11212.0, 11196.0, 11212.0, 11196.0] | [76.0, 73.0, 76.0, 74.0, 72.0, 79.0] | [296, 304, 310, 276, 310, 279] |
p03062 | u578501242 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['x=int(input())\ny=list(map(int, input().split()))\nt=1\nfor i in range(x):\n\tif y[i]<0:\n\t\tt=t*-1\n\ty[i]=abs(y[i])\n\nif y==1:\n\tprint(sum(y))\nelse:\n\tprint(sum(y)-(min(y)*2))', 'x=int(input())\ny=list(map(int, input().split()))\nt=1\nfor i in range(x):\n\tif y[i]<0:\n\t\tt=t*-1\n\ty[i]=abs(y[i])\n\nif t==1:\n... | ['Wrong Answer', 'Accepted'] | ['s195886114', 's574917116'] | [14412.0, 14412.0] | [76.0, 82.0] | [165, 165] |
p03062 | u581511366 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(map(int,input().split()))\n\nans = 0\ncount = 0\nfor i in range(N):\n if A[i] < 0:\n A[i] = -A[i]\n count += 1\nprint(A)\n\nif count%2==0:\n print(sum(A))\nelse :\n print(sum(A)-2*min(A))', 'N = int(input())\nA = list(map(int,input().split()))\n\nans = 0\ncount = 0\nf... | ['Wrong Answer', 'Accepted'] | ['s828954783', 's144769053'] | [14412.0, 14412.0] | [84.0, 75.0] | [223, 214] |
p03062 | u583701239 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(map(int,input().split()))\n\ncount = 0\nfor i in range(N):\n if A[i] < 0:\n count += 1\n \nAabs = [abs(i) for i in A]\nprint(sum(Aabs))\n\nif count % 2 == 0:\n print(sum(Aabs))\nelse:\n mini = min(Aabs)\n print(Asum - 2*mini)', 'N = int(input())\nA = list(map(int,i... | ['Runtime Error', 'Accepted'] | ['s936833692', 's667443424'] | [14284.0, 14412.0] | [68.0, 65.0] | [263, 251] |
p03062 | u586759271 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import numpy as np\nn=int(input())\na=np.array([int(i) for i in input().split()])\n\nif n%2==0: print(sum(abs(a)))\nelse: print(sum(abs(a))-2*abs(a[(np.argmin(abs(a)))]))', 'import numpy as np\nn=int(input())\na=np.array([int(i) for i in input().split()])\n\nif n//2==0: print(sum(abs(a)))\nelse: print(sum(abs(a))-2*a... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s505866491', 's560344992', 's934097344'] | [23300.0, 23300.0, 23296.0] | [217.0, 216.0, 537.0] | [165, 166, 172] |
p03062 | u588829932 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\na =list(map(int, input().split()))\n\nret = 0\nfor i in range(len(a)-1):\n if a[i] < 0:\n a[i] *= -1\n a[i+1] *= -1\n ret += a[i]\n print(a[i], ret)\nret += a[-1]\n\nabs_list = list(map(abs, a))\ntest = sorted(enumerate(abs_list), key=lambda x:x[1])\nprint(max(solve(a), solve(... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s139813984', 's592633006', 's809625584'] | [22492.0, 14412.0, 14412.0] | [302.0, 212.0, 72.0] | [370, 205, 301] |
p03062 | u591503175 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import collections\n\nN =int(input())\n\nAs = [int(item) for item in input().split()]\n\ncnt = 0\n\nBs = collections.deque()\n\nmin1 = 1000000000000\n\nfor i in As:\n\n\tif As < 0:\t\tcnt +=1\n\n\tBs.append(abs(i))\n\n\tmim1=min(min1, abd(i))\n\n\t\n\nif cnt % 2 =0:\n\n\tprint(sum(list(Bs)))\n\nelse:\n\n\tprint(sum(l... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s352164825', 's498591093', 's600423858'] | [8972.0, 8964.0, 20600.0] | [27.0, 25.0, 104.0] | [303, 303, 289] |
p03062 | u595893956 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n=input()\na=list(map(int,input().split()))\nn=sum(x<0 for x in a)\na=[map(abs,a)]\ns=sum(a) if n%2==0 else sum(a)-min(a)*2\nprint(s)\n', 'n=int(input())\na=list(map(int,input().split()))\na=list(map(lambda x: abs(x),a))\nneg_sum=sum(x<0 for x in a)\nm = min(a)\ns=sum(a)\ns-=m if neg_sum%2\nprint(s)', 'n=input()\na=l... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s275252502', 's283695994', 's706375658'] | [14224.0, 2940.0, 14412.0] | [50.0, 17.0, 58.0] | [129, 154, 133] |
p03062 | u597455618 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['def main():\n n = int(input())\n a = list(map(int, input().split()))\n s = [abs(i) for i in a]\n print(sum(s) - 2*min(s))\n\nif __name__ == "__main__":\n main()', 'def main():\n n = int(input())\n a = list(map(int, input().split()))\n s, cnt = [0]*n, 0\n for i in a:\n s[i] = abs(i)\n... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s012699572', 's042221635', 's280864467'] | [20124.0, 20152.0, 20136.0] | [62.0, 51.0, 72.0] | [168, 289, 302] |
p03062 | u604412462 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\nm = 10**9\ncn = 0\ns = 0\nfor x in input().split():\n y = int(x)\n z = abs(y)\n if y < 0:\n cn += 1\n print("cn+=1",y,cn)\n s += z\n print("sum:",s)\n if m > z:\n m = z\n print("m:updated",m)\nif cn%2 == 0:\n print(s)\nelse:\n print(s - m*2)', 'n =... | ['Wrong Answer', 'Accepted'] | ['s521442055', 's753091508'] | [15692.0, 11516.0] | [357.0, 89.0] | [293, 216] |
p03062 | u608088992 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import sys\n\ndef solve():\n input = sys.stdin.readline\n N = int(input())\n A = [int(a) for a in input().split()]\n DP = [[-10 ** 20] * 2 for _ in range(N)]\n DP[0][0] = A[0]\n DP[0][1] = -1 * A[0]\n for i in range(1, N):\n a = A[i]\n DP[i][0] = max(max(DP[i-1][0] + a, DP[i-1][1] -... | ['Wrong Answer', 'Accepted'] | ['s547872729', 's949109811'] | [25580.0, 31012.0] | [218.0, 154.0] | [464, 468] |
p03062 | u614734359 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = [int(i) for i in input().split()]\nmin = (10**9,None)\nfor i in range(n-1):\n if a[i] < 0:\n a[i] *= (-1)\n a[i+1] *= (-1)\n if min[0] > abs(a[i]):\n min = (abs(a[i],i))\nif a[-1] < 0:\n a[-1]**=(-1)\n a[min[1]]**=(-1)\nprint(sum(a))\n', 'n = int(input())\na = [i... | ['Runtime Error', 'Accepted'] | ['s310135380', 's248078228'] | [14332.0, 14224.0] | [81.0, 103.0] | [277, 280] |
p03062 | u616117610 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(abs,list(map(int, input().split()))))\n\na.sort()\nif n % 2 == 0:\n ans = sum(a)\nelse:\n ans = sum(a) - (a[0]*2)\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nb = list(map(abs, a))\nb.sort()\n\nnum = 0\nfor i in range(n):\n if a[i] < 0:\n num = n... | ['Wrong Answer', 'Accepted'] | ['s280265982', 's587799699'] | [14412.0, 14284.0] | [86.0, 98.0] | [154, 229] |
p03062 | u617228707 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\nA = list(map(int, input().split()))\nfor i in range(n):\n if A[i]<0:\n A[i] = -A[i]\nif n % 2 == 1:\n print(sum(A)-2*min(A))\nelse:\n print(sum(A))', 'n = input()\nA = list(map(int, input().split()))\nfor i in range(n):\n if A[i]<0:\n A[i] = -A[i]\nif n % 2 == 1:\n print... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s211227188', 's321489186', 's034686105'] | [14224.0, 14284.0, 14412.0] | [67.0, 42.0, 75.0] | [173, 181, 206] |
p03062 | u626881915 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int, input().split()))\nif 0 in a:\n print(sum(map(abs, a)))\n exit()\nminus = len([i for i in range(n) if a[i]<0 ])\nif minus % 2 == 0:\n print(print(sum(map(abs, a))))\nelse:\n a = sorted(a, key=lambda x: abs(x))\n print(sum(map(abs, a[1:])))', 'n = int(input())\na = list(map(int... | ['Wrong Answer', 'Accepted'] | ['s108786299', 's283830972'] | [14284.0, 14412.0] | [110.0, 111.0] | [270, 274] |
p03062 | u635958201 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N=int(input())\nA=list(map(int,input().split()))\n#N=9\n#A=[10,-4,-8,-11,3,90,78,3,999]\ncount=0\nB=[]\nfor i in range(N):\n if A[i]<0:\n B.append((-1)*A[i])\n count+=1\n else:\n B.append(A[i])\nprint(B)\nif count%2==0:\n print(sum(B))\nelse:\n print(sum(B)-2*min(B))', 'A=list(map(int... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s097225121', 's182917451', 's149833407'] | [14412.0, 3060.0, 14284.0] | [86.0, 17.0, 76.0] | [284, 223, 238] |
p03062 | u636489589 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import numpy as np\nn = int(input())\nl = np.array(list(map(int,input().split()))).astype("i")\n\nif n % 2 == 0:\n print(np.sum(np.abs(l)))\nelse:\n print(np.sum(np.abs(l)) - 2 * np.min(np.abs(l)))', 'import numpy as np\nn = int(input())\nl = np.array(list(map(int,input().split()))).astype("i")\n\nm = np.sum(l < 0)... | ['Wrong Answer', 'Accepted'] | ['s963845968', 's732661300'] | [23308.0, 23304.0] | [183.0, 183.0] | [192, 211] |
p03062 | u638456847 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N=int(input())\na=[int(i) for i in input().split()]\n\ncount=0\nans=0\nfor i in range(N):\n if a[i]<0:\n c+=1\n \na[i]=abs[i]\nif c%2==0\n ans=sum(a)\nelse:\n a.sort()\n ans=sum(a)-a[0]', 'N=int(input())\na=[int(i) for i in input().split()]\n \ncount=0\nans=0\nfor i in range(N):\n if a[i]... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s497775587', 's662962533', 's789732187', 's945679343', 's424398741'] | [2940.0, 2940.0, 14332.0, 2940.0, 14284.0] | [17.0, 17.0, 70.0, 17.0, 115.0] | [197, 205, 206, 200, 231] |
p03062 | u644804947 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(map(int, input().split()))\n\ndp = np.zeros((N+1, 2), dtype=int)\ndp[0, 1] = -10**9\n\nfor i in range(N):\n dp[i+1, 0] = max(dp[i, 0] + A[i], dp[i, 1] - A[i])\n dp[i+1, 1] = max(dp[i, 0] - A[i], dp[i, 1] + A[i])\nprint(dp[N, 0])', 'import numpy as np\nN = int(input())\nA = list(map(in... | ['Runtime Error', 'Accepted'] | ['s727994609', 's702660531'] | [14412.0, 23300.0] | [43.0, 824.0] | [252, 271] |
p03062 | u645250356 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ["from collections import Counter,defaultdict,deque\nfrom heapq import heappop,heappush,heapify\nimport sys,bisect,math,itertools,fractions,copy\nsys.setrecursionlimit(10**8)\nmod = 10**9+7\nINF = float('inf')\ndef inp(): return int(sys.stdin.readline())\ndef inpl(): return list(map(int, sys.stdin.readline().split()))\... | ['Wrong Answer', 'Accepted'] | ['s530214363', 's435572520'] | [16344.0, 16384.0] | [108.0, 120.0] | [392, 467] |
p03062 | u652656291 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\nA = list(map(int,input().split()))\nfor i in range(n):\n if A[i]<0 and A[i+1]<0:\n A[i] = -A[i]\n A[i+1] = -A[i]\n elif A[i]<0:\n if A[i]-A[i+1]<0:\n A[i] = -A[i]\n A[i+1] = -A[i]\nprint(sum(A))\n ', 'N = int(input())\nA = list(map(int, input().split()))\nINF = 10**9\n\ndp0 =... | ['Runtime Error', 'Accepted'] | ['s561645785', 's052374732'] | [14412.0, 24240.0] | [107.0, 134.0] | [228, 222] |
p03062 | u660245210 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int, input().split()))\nfor i in range(n):\n a[i] = abs(a[i])\na.sort()\na[0] *= -1\nprint(sum(a))\n ', 'n = int(input())\na = list(map(int, input().split()))\nk = 1\nfor i in range(n):\n if a[i] < 0:\n a[i] *= -1\n k *= -1\na.sort()\nif k == -1:\n a[0] *= -1\n... | ['Wrong Answer', 'Accepted'] | ['s965391875', 's159237489'] | [14412.0, 14224.0] | [98.0, 103.0] | [131, 184] |
p03062 | u677267454 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['# -*- coding: utf-8 -*-\nn = int(input())\na = list(map(int, input().split()))\n\nans = 0\ncount = 0\nfor i in range(n):\n if a[i] < 0:\n a[i] = -a[i]\n ans += a[i]\n count += 1\n\nif count % 2 == 0:\n print(ans)\nelse:\n print(ans - min(a) * 2)\n', '# -*- coding: utf-8 -*-\nn = int(inpu... | ['Wrong Answer', 'Accepted'] | ['s583504222', 's640051117'] | [14412.0, 14412.0] | [87.0, 78.0] | [261, 246] |
p03062 | u685263709 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(map(int, input().split()))\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\nif N == 2:\n print(max(A[0], A[1]))\n quit()\nif N == 3:\n print(max(gcd(A[0], A[1]), gcd(A[0], A[2]), gcd(A[1], A[2])))\n quit()\n\nans0 = A[0]\nans1 =... | ['Wrong Answer', 'Accepted'] | ['s992433151', 's499396797'] | [14480.0, 14224.0] | [351.0, 103.0] | [469, 274] |
p03062 | u686230543 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(abs, map(int, input().split())))\nprint(sum(a) - 2 * min(a))', 'n = int(input())\nsum_abs_a = 0\nmin_abs_a = 10 ** 9\nminus_odd = False\nfor a in map(int, input().split()):\n if a < 0:\n minus_odd = not minus_odd\n a = -a\n sum_abs_a += a\n min_abs_a = min(min_abs_a, a)\nif min... | ['Wrong Answer', 'Accepted'] | ['s960805408', 's890676820'] | [14412.0, 11516.0] | [51.0, 86.0] | [89, 280] |
p03062 | u690781906 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int, input().split()))\nmin_b = 10**9\nsum_b = 0\nfor i in range(n):\n sum_b += abs(a[i])\n if abs(a[i]) < min_b:\n min_b = abs(a[i])\nprint(sum_b - 2*min_b)', 'n = int(input())\na = list(map(int, input().split()))\nne_num = 0\n\nfor i in range(n):\n if a[i] < 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s122671346', 's622294672'] | [14412.0, 14212.0] | [75.0, 76.0] | [193, 311] |
p03062 | u691018832 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int, input().split()))\nb = 0\nans = sum(a)\n\nfor i in range(n):\n if a[i] < 0:\n b += 1\n \nif (0 in a) or ((b % 2) == 0):\n pass\nelse:\n ans -= min(a)\n\nprint(ans)', 'import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = ... | ['Wrong Answer', 'Accepted'] | ['s382395091', 's826817084'] | [14412.0, 12508.0] | [60.0, 68.0] | [208, 339] |
p03062 | u692498898 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n=int(input())\na=list(map(int,input().split()))\n\nsum=0\nmin=10**9\nfor i in a:\n if i>=0:\n sum=sum+i\n if min>i:\n min=i\n else:\n sum=sum-i\n if min>-i:\n min=-i\nprint(sum if len(a)%2==0 else sum-min)', 'n=int(input())\na=list(map(int,input().split()))\n\nsum=0\nmin=10**9\nminus=0\nfor i... | ['Wrong Answer', 'Accepted'] | ['s881102001', 's075525429'] | [14412.0, 14412.0] | [66.0, 69.0] | [216, 243] |
p03062 | u698849142 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int, input().split(" ")))\nfor i in range(1, n-1):\n print(a)\n if 0 <= a[i-1] and 0 <= a[i] and 0 <= a[i+1]:\n continue\n elif a[i-1] < 0 and 0 <= a[i] and a[i+1] < 0:\n a[i-1] = abs(a[i-1])\n a[i+1] = abs(a[i+1])\n elif a[i-1] < 0 and a[i] < 0:\n ... | ['Runtime Error', 'Accepted'] | ['s397421156', 's398455816'] | [142692.0, 14412.0] | [2104.0, 60.0] | [634, 201] |
p03062 | u711238850 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import math\n\ndef main():\n n = int(input())\n a = [int(t) for t in input().split()]\n\n m = 0\n if 0 in a:\n m = sum([abs(x) for x in a])\n else:\n a_ = [abs(x) for x in a]\n m = sum(a_)-2*min(a_)\n\n print(m)\n\nif __name__ == "__main__":\n main()', 'import math\n\ndef mai... | ['Wrong Answer', 'Accepted'] | ['s333757999', 's012615165'] | [14412.0, 14500.0] | [56.0, 59.0] | [276, 311] |
p03062 | u711295009 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\nlistA = list(map(int, input().split()))\n\nsum1=0\nindex=0\nwhile index < len(listA):\n sum1+=listA[index]\n index+=1\n\nif len(listA)%2==0:\n leng = len(listA)-1\nelse:\n leng = len(listA)-2\nwhile leng > 1:\n index=0\n max1 = 0\n startI=0\n endI=0\n while index < len(lis... | ['Runtime Error', 'Accepted'] | ['s950163451', 's517056998'] | [14464.0, 14412.0] | [2104.0, 104.0] | [698, 394] |
p03062 | u712975113 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N=int(input())\nA=list(map(int,input().split()))\nAabs=[abs(A[i]) for i in range(N)]\nc=sum([A[i]<0 for i in range(N)])\nprint([A[i]<0 for i in range(N)])\nif c%2==0:\n print(sum(Aabs))\nelse:\n print(sum(Aabs)-2*min(Aabs))', 'N=int(input())\nA=list(map(int,input().split()))\nAabs=[abs(A[i]) for i in range(N)]\... | ['Wrong Answer', 'Accepted'] | ['s926626966', 's132853710'] | [14332.0, 14412.0] | [76.0, 65.0] | [221, 187] |
p03062 | u730043482 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\naList = [int(x) for x in input().split(" ")]\n\nfor x in range(0, len(aList)):\n\taList[x] = -aList[x] if aList[x] < 0 else aList[x]\n\naMin = min(aList)\n\nprint(sum(aList) - ((aMin if len(aList)%2 == 1 else 0)*2))\n\n\n', 'n = int(input())\naList = [int(x) for x in input().split(" ")]\n\nminNum = ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s261899318', 's602433305', 's954065812'] | [14412.0, 14332.0, 14260.0] | [74.0, 83.0, 85.0] | [227, 301, 299] |
p03062 | u730318873 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(map(int,input().split()))\nfor i in range(N-1):\n if A[i] + A[i+1] < -1 * (A[i] + A[i+1]):\n A[i] = A[i] * -1\n A[i+1] = A[i+1]\nsum(A)', 'N = int(input())\nA = list(map(int,input().split()))\nx = 0\nfor i in range(N):\n if A[i] < 0:\n x = x + 1\n\nif x % 2 == 0:\... | ['Wrong Answer', 'Accepted'] | ['s455821628', 's106373008'] | [14412.0, 14480.0] | [125.0, 84.0] | [173, 545] |
p03062 | u733608212 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\nli = list(map(int, input().split()))\ntemp = li.copy()\nfor i in range(n-1):\n if li[i] < 0:\n li[i] *= -1\n li[i+1] *= -1\nans = sum(li)\nli = temp\nfor i in reversed(range(1,n)):\n if li[i] < 0:\n li[i] *= -1\n li[i-1] *= -1\nans = max(ans, sum(li))', 'n = int(inp... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s294390417', 's308375665', 's807194512'] | [14224.0, 14332.0, 14412.0] | [88.0, 88.0, 57.0] | [290, 290, 188] |
p03062 | u748241164 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\ns = list(map(int, input().split()))\n\n#print(s)\n\ncount = 0\n\n# if s[i] < 0:\n# s[i] -= 2 * s[i]\n# s[i+1] -= 2 * s[i+1]\n#for j in range(N):\n# count += int(s[j])\n#print(count)\n\nmin1 = abs(s[0])\n#print(min1)\nfor i in range(N):\n min1 = min(min1, abs(s[i]))\n count += abs(s[i])\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s125378948', 's185628016', 's211272194', 's219474425', 's427543668', 's985491346', 's456054284'] | [14764.0, 14412.0, 14412.0, 14412.0, 14332.0, 14412.0, 14412.0] | [96.0, 80.0, 79.0, 75.0, 113.0, 77.0, 120.0] | [359, 303, 301, 296, 301, 296, 301] |
p03062 | u759412327 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(map(int,input().split()))\nB = sum(a<0 for a in A)\nC = sum(a==0 for a in A)\nD = sum([abs(a) for a in A])\n\nif 2<=C:\n print(D)\nelse:\n if B%2==0:\n print(C)\n else:\n print(C-2*min(A,key=abs))', 'N = int(input())\nA = list(map(int,input().split()))\nB = list(map(abs,A))\nprint(... | ['Wrong Answer', 'Accepted'] | ['s103791589', 's083921082'] | [20024.0, 19888.0] | [74.0, 65.0] | [220, 119] |
p03062 | u762420987 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nAlist = list(map(int, input().split()))\ndp = [[0, 0] for i in range(N+1)]\ndp[0][1] = -(3*10**9)\nfor i in range(1, N+1):\n dp[i][0] = max(dp[i-1][0]+Alist[i], dp[i-1][1]-Alist[i])\n dp[i][1] = max(dp[i-1][0]-Alist[i], dp[i-1][1]+Alist[i])\nprint(dp[N][0])\n', 'N = int(input())\nAlist = list(... | ['Runtime Error', 'Accepted'] | ['s406528120', 's975834243'] | [25580.0, 25572.0] | [205.0, 196.0] | [275, 271] |
p03062 | u771007149 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int,input().split()))\nimport bisect\na.sort()\n\nidx = bisect.bisect_left(a, 0)\n\nif idx % 2 == 0:\n print(sum(abs(a)))\nelse:\n sm = [abs(x) for x in a]\n print(sum(sm) - 2*min(abs(a[idx]), abs(a[idx-1])))', 'n = int(input())\na = list(map(int,input().split()))\nimport bisec... | ['Runtime Error', 'Accepted'] | ['s115262679', 's289828933'] | [20140.0, 20012.0] | [77.0, 80.0] | [237, 204] |
p03062 | u777215291 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import numpy as np\nN = int(input())\nA = list(map(int,input().split()))\nn = sum(1 for x in A if x<0)\nprint(n)\nB = np.abs(A)\nif n % 2 == 1:\n print(sum(B) - 2*min(B))\nelse:\n print(sum(B))', 'import numpy as np\nN = int(input())\nA = list(map(int,input().split()))\nn = sum(1 for x in A if x<0)\nB = np.abs(A)\n... | ['Wrong Answer', 'Accepted'] | ['s436797330', 's108240519'] | [25172.0, 23300.0] | [326.0, 226.0] | [186, 177] |
p03062 | u781262926 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n, *A = map(int, open(0).read().split())\nprint(sum(map(abs, A)) - 2*min(map(abs, A)))', 'n, *A = map(int, open(0).read().split())\nans = sum(map(abs, A))\nif len([a for a in A if a < 0]) % 2 == 1:\n ans -= 2*min(map(abs, A))\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s085073007', 's981159682'] | [14084.0, 14084.0] | [52.0, 58.0] | [85, 146] |
p03062 | u785578220 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int,input().split()))\nma = []\npa = []\nl =[]\nt = 0\nfor i in a:\n print(i)\n if i < 0:\n ma.append(i)\n l.append(i*-1)\n elif i> 0:\n pa.append(i)\n l.append(i)\n else:\n t = 1\npa.sort()\nma.sort()\ns = sum(l)\nprint(s if len(ma)%2==0 or t==1 else max(s+ma[-1]*2,s... | ['Runtime Error', 'Accepted'] | ['s173055511', 's522694683'] | [14636.0, 14212.0] | [187.0, 59.0] | [312, 204] |
p03062 | u793174294 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['# Coding: Utf-8\n\nN=in(input())\na=list(map(int, input().split()))\ncount=0\nzero=0\ntotal=0\n\nfor i in range(N):\n if a[i]<0:\n count+=count\n total=toal+abs(a[1])\n if a[1]<0:\n zero+=zero\n \nif count%2==0 or zero>0:\n print(total)\nelse:\n print(total-np.abs(a))\n \n', '#Conding: Utf-8\n\nN= in... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s857272067', 's965992435', 's565992734'] | [2940.0, 14496.0, 14224.0] | [17.0, 138.0, 87.0] | [270, 361, 364] |
p03062 | u797937830 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = list(int(i) for i in input().split())\ncount_m = 0\ncount_z = 0\n\nfor i in A:\n if i < 0:\n count_m += 1\n elif i == 0:\n count_z += 1\n\nA_abs = [abs(i) for i in A]\nif count_m%2 == 0 || count_m+count_z%2 == 0:\n print(sum(A_abs))\n \nelse:\n A_min = A.index(min(A_abs))\n A_abs[A_m... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s479295743', 's836851515', 's813509940'] | [2940.0, 2940.0, 14224.0] | [17.0, 17.0, 68.0] | [340, 342, 350] |
p03062 | u802772880 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n=int(input())\na=list(map(int,input().split()))\nb=[abs(i) for i in a]\nm=len([i for i in a if i<0])\nM=len([i for i in a if i>0])\nans=0\nif m%2!=M%2:\n ans=sum(b)-2*min(b)\nelse:\n ans=sum(b)\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\nb=[abs(i) for i in a]\nm=len([i for i in a if i<0])\... | ['Wrong Answer', 'Accepted'] | ['s891649745', 's945228739'] | [14412.0, 14412.0] | [59.0, 59.0] | [202, 230] |
p03062 | u803848678 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int,input().split()))\n\nminus = []\nplus = []\n\nfor i in a:\n elif i < 0:\n minus.append(i)\n else:\n plus.append(i)\nplus.sort()\nminus.sort(reverse=True)\n\nif len(plus)*len(minus) == 0:\n plus[133],minus[133]\n print(sum(plus)-sum(minus))\n exit()\n\nif... | ['Runtime Error', 'Accepted'] | ['s232172514', 's579193549'] | [2940.0, 15140.0] | [17.0, 92.0] | [486, 213] |
p03062 | u807889603 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import numpy as np\nn = int(input())\na = list(map(int, input().split()))\n\nmynas=0\nfor i in range(n):\n if a[i]<0:\n mynas += 1\n\na=np.array(a)\na2 = a\nnp.abs(a)\ngoukei=0\n\nif mynas % 2 ==0:\n for j in range(n):\n goukei += a[j]\nelse:\n a2=np.sort(a)\n for k in range(n):\n gou... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s536366209', 's748436185', 's785780466', 's809216975', 's040601646'] | [23256.0, 23384.0, 23384.0, 23272.0, 23292.0] | [249.0, 253.0, 249.0, 249.0, 252.0] | [342, 343, 342, 328, 332] |
p03062 | u811132356 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n=int(input())\na=list(map(int,input().split()))\nct=0\nb=[0]*n\nprint(b)\nfor i in range(n):\n if a[i]<0:\n ct+=1\n b[i]=-a[i]\n else:\n b[i]=a[i]\nb.sort()\nif ct%2==0:\n print(sum(b))\nelse:\n print(sum(b)-min(b)*2)', 'n=int(input())\na=list(map(int,input().split()))\nct=0\nb=[0]*... | ['Wrong Answer', 'Accepted'] | ['s793385634', 's703212596'] | [14412.0, 14412.0] | [115.0, 110.0] | [237, 228] |
p03062 | u814663076 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA = [int(_) for _ in input().split()]\n\ndp = [[0]*2 for _ in range(N)]\ndp[1][0] = A[0]+A[1]\ndp[1][1] = -A[0]-A[1]\n\nif N > 2:\n\tfor i in range(2, N):\n\t\tdp[i][0] = max(dp[i-1][0]+A[i], dp[i-1][1]+A[i])\n\t\tdp[i][1] = max(dp[i-1][0]-A[i-1]*2-A[i], dp[i-1][1]+A[i-1]*2+A[i])\n\nprint(max(dp[-1]... | ['Wrong Answer', 'Accepted'] | ['s351004323', 's633911446'] | [25616.0, 24780.0] | [246.0, 239.0] | [303, 303] |
p03062 | u815878613 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import sys\nimport numpy as np\n\nN = int(input())\n\nA = input().split()\nA = np.array([int(x) for x in A])\n\nif np.sum(A==0) != 0:\n\n \n z = np.max(np.where(A==0))\n B = A[z:N]\n\n \n if B.shape[0] == 2 and B[-1] < 0:\n sign = 1\n break\n\n elif np.sum(B < 0)%2 ==0:\n sign =... | ['Runtime Error', 'Accepted'] | ['s354257201', 's345229380'] | [3064.0, 19956.0] | [17.0, 82.0] | [583, 321] |
p03062 | u816732092 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ["import numpy as np\nn = int(input())\na = [int(i) for i in input().split()]\na = np.array(a, dtype='int64')\na.sort()\nprint(a)\nfor i in range(n):\n if a[i] > 0:\n k = i\n print(i)\n break\na = np.absolute(a)\na.sort()\n\nif k % 2 == 0:\n print(np.sum(a))\nelse :\n print(np.sum(a)- a[0]... | ['Runtime Error', 'Accepted'] | ['s493504877', 's112595096'] | [23376.0, 23268.0] | [292.0, 190.0] | [304, 251] |
p03062 | u818724291 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import math\n\nn = int(input())\na = list(map(int,input().split()))\n\na.sort()\n\nif n == 2:\n print(a[1])\nelif n == 3:\n gcd1 = math.gcd(a[0],a[1])\n gcd2 = math.gcd(a[1],a[2])\n gcd3 = math.gcd(a[0],a[2])\n ans = [gcd1, gcd2, gcd3]\n ans.sort()\n\n print(ans[-1])\n\nelse:\n gcd1 = math.gcd... | ['Runtime Error', 'Accepted'] | ['s196146196', 's580483147'] | [14412.0, 15020.0] | [78.0, 120.0] | [755, 256] |
p03062 | u819593641 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nAn = list(map(int, input().split()))\nAn = [abs(a) for a in An]\nif N % 2 == 0:\n print(sum(An))\nelse:\n print(sum(An) - 2*min(An))', 'N = int(input())\nAn = list(map(int, input().split()))\nprint(sum(An) - min(An))', 'N = int(input())\nAn = list(map(int, input().split()))\nM = sum([0 if a >=0 el... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s077574923', 's248157997', 's324773545'] | [14412.0, 14412.0, 14412.0] | [51.0, 46.0, 58.0] | [146, 78, 188] |
p03062 | u822725754 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import numpy as np\nimport sys\nn = int(input())\na = np.array([int(x) for x in input().split()])\ndp = np.zeros((n + 1, 2))\ndp[0][1] = -2000000001\nfor i in range(n):\n\tdp[i + 1][0] = dp[i][0] + a[i]\n\tdp[i + 1][1] = dp[i][0] - a[i]\nprint(int(dp[n][0]))', 'import numpy as np\nimport sys\nn = int(input())\na = np... | ['Wrong Answer', 'Accepted'] | ['s438692714', 's736448324'] | [23288.0, 23316.0] | [459.0, 690.0] | [247, 291] |
p03062 | u825981710 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N=int(input())\nA=list(map(int,input().split()))\n\nA[0]=A[0]*(-1)\nA[1]=A[1]*(-1)\nsum=0\n\nfor a in A:\n if a>0:\n sum+=a\n\nprint(sum)', 'N=int(input())\nA=list(map(int,input().split()))\n\nA[0]=A[0]-1\nA[1]=A[1]-1\nmax=A[0]\n\nfor a in A:\n if a>max:\n max=a\nprint(max)', 'N=int(input())\nA=li... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s005657934', 's418240395', 's485994426'] | [14212.0, 14332.0, 14412.0] | [57.0, 48.0, 61.0] | [136, 133, 181] |
p03062 | u826929627 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ["N = int(input())\nA = list(map(int,input().split(' ')))\nA.sort()\n\nfrom fractions import gcd\nfrom functools import reduce\nimport functools\n\ndef gcd(a,b):\n if a==0:\n return b \n else:\n return gcd(b%a,a)\n \nmax_gcd = 0\nloop_range = min(200,len(A))\n\n\nfor i in range(loop_range):\n if i... | ['Wrong Answer', 'Accepted'] | ['s834115384', 's105875929'] | [14428.0, 14412.0] | [2108.0, 106.0] | [802, 1153] |
p03062 | u827202523 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\nnums = list(map(int,input().split()))\ncnt = 0\nfor num in nums:\n if num < 0:\n cnt += 1\n \nif cnt % 2 == 0:\n ans = sum(nums)\nelse:\n ans = sum(nums) - min([abs(i) for i in nums])*2\nprint(ans)', '\nn = int(input())\nnums = list(map(int,input().split()))\ncnt = 0\nfor num in nums:\n if... | ['Wrong Answer', 'Accepted'] | ['s528329239', 's843504444'] | [14284.0, 14332.0] | [63.0, 61.0] | [213, 234] |
p03062 | u830742419 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['def getNumNeg(L):\n return sum([i<0 for i in L])\n\ndef findmax(L):\n numNeg = getNumNeg(L)\n if numNeg % 2 == 0: # end-point: all positive\n while getNumNeg(L) != 0:\n i = L.index(min(L[:-1]))\n j = i + 1\n L[i] = L[i] * (-1)\n L[j] = L[j] * (-1)\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s232126484', 's482814114', 's614481133', 's861582015', 's632072266'] | [2940.0, 11196.0, 2940.0, 11192.0, 14284.0] | [18.0, 26.0, 17.0, 28.0, 57.0] | [703, 293, 720, 276, 278] |
p03062 | u832409298 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import sys\nfrom functools import lru_cache\nsys.setrecursionlimit(10**7)\nINF = 10 ** 18\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef II(): return int(sys.stdin.readline())\n\nN = II()\nA_li = LI()\nN = len(A_li)\n\n@lru_cache(maxsize=None)\ndef dp(i,j):\n print(i,j)\n if i == 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s537126206', 's648620543'] | [304580.0, 303128.0] | [2117.0, 1717.0] | [549, 534] |
p03062 | u843135954 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import sys\nstdin = sys.stdin\n \nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nnn = lambda: list(stdin.readline().split())\nns = lambda: stdin.readline().rstrip()\n\nn = ni()\na = na()\nc=0\nfor i in a:\n if i < 0:\n c+=1\n\nb = [abs(i) for i in a]\n\nif c%2 == 0:\n prin... | ['Wrong Answer', 'Accepted'] | ['s553797900', 's750294155'] | [15180.0, 15180.0] | [98.0, 97.0] | [346, 351] |
p03062 | u854428142 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int, input().split()))\n\na.sort()\nminus = n\nfor i in range(n):\n if a[i] >= 0:\n s = i\n break\n\na = list(map(abs, a))\na.sort()\n\nif minus % 2 == 0:\n print(sum(a))\nelse:\n print(sum(a) - 2 * a[0])\n', 'n = int(input())\na = list(map(int, input().split()))\n\na.sort()\nm... | ['Wrong Answer', 'Accepted'] | ['s051956597', 's803291935'] | [20136.0, 19972.0] | [79.0, 83.0] | [229, 233] |
p03062 | u863150907 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['\nN = int(input())\nA = list(map(int,input().split()))\n# N=3\n# A = [-10,5,-4]\nans = 0\nminnum = abs(A[0])\nfor i in range(N):\n ans += abs(A[i])\n minnum = min(minnum,abs(A[i]))\n #print(minnum,ans)\nans -= minnum*2\nprint(ans)', '\nN = int(input())\nA = list(map(int,input().split()))\n# N=3\n# A = [-10,5... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s029056484', 's946915300', 's689646270'] | [14224.0, 15020.0, 14332.0] | [93.0, 96.0, 108.0] | [267, 284, 339] |
p03062 | u875377810 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import math\nfrom functools import reduce\ndef mkt(a, b):\n while b:\n a, b = b, a % b\n return a\ndef gcd_list(numbers):\n return reduce(mkt, numbers)\nn=int(input())\na=list(map(int,input().split()))\nmax=1\nfor i in range(n):\n q=gcd_list(a[:i]+a[i+1:])\n if q>max:\n max=q\nprint(max)'... | ['Wrong Answer', 'Accepted'] | ['s295880224', 's908632155'] | [14924.0, 15020.0] | [2104.0, 77.0] | [302, 201] |
p03062 | u884982181 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = list(map(int,input().split()))\nmi = 0\nfor i in range(a):\n if a[i] < 0:\n mi+=1\n a[i]= abs(a[i])\nif mi %2 == 1:\n print(sum(a)-min(a))\nelse:\n print(sum(a))', 'n = int(input())\na = list(map(int,input().split()))\nmi = 0\nfor i in range(n):\n if a[i] < 0:\n mi+=1\n a[i]= abs(a[i... | ['Runtime Error', 'Accepted'] | ['s301103969', 's322429312'] | [14412.0, 14412.0] | [44.0, 80.0] | [180, 182] |
p03062 | u885523920 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n=int(input())\na=list(map(int,input().split()))\nf=0\nfor i in range(n-1):\n if a[i]<=0 and a[i+1]<=0 and f==0:\n a[i]=a[i]*(-1)\n a[i+1]=a[i+1]*(-1)\n f=1\n elif a[i]*a[i+1]<=0:\n a[i]=max(a[i]+a[i+1],-a[i+1]-a[i])\n a[i+1]=0\n f=0\n else:\n f=0\ns=0\nfor i in range(n):\n s=s+a[i]\nprint(s)... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s359412176', 's591247546', 's276425027'] | [14496.0, 2940.0, 14412.0] | [135.0, 17.0, 116.0] | [302, 187, 305] |
p03062 | u887207211 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['#include "bits/stdc++.h"\n\nusing namespace std;\n\nint i;\n\nint main(){\n int N, neg_cnt = 0;\n cin >> N;\n vector<int> A(N), B(N);\n for (i = 0; i < N; i++){\n cin >> A[i];\n if (A[i] < 0){\n neg_cnt++;\n }\n }\n for (i = 0; i < N; i++){\n B[i] = abs(A[i]);\n }\n int acm = 0;\n int min = ... | ['Runtime Error', 'Accepted'] | ['s300292260', 's185384249'] | [2940.0, 14284.0] | [17.0, 60.0] | [470, 196] |
p03062 | u895333128 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\nw = input().split(" ")\n\na = []\nk = False\nfor i in range(n):\n a.append(int(w[i]))\n if a[i] < 0:\n \ta[i] *= -1\n k= not(k)\n if i == 1:\n min = a[i]\n if a[i] < min:\n min = a[i]\n2\nsum = sum(a)\nif k:\n sum -= min\nprint(sum)', 'n = int(input())\nw = inp... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s082598313', 's196825826', 's328325097', 's372294857', 's807680471', 's808168065', 's882223349', 's996135275', 's418800587'] | [2940.0, 11212.0, 11196.0, 11212.0, 11196.0, 11212.0, 11212.0, 11196.0, 14412.0] | [17.0, 26.0, 29.0, 26.0, 26.0, 26.0, 27.0, 28.0, 100.0] | [270, 273, 271, 273, 330, 272, 273, 273, 275] |
p03062 | u900688325 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\na_list = list(map(int, input().split()))\n\nfor i in range(N-2):\n if a_list[i] <0 and a_list[i+1] < 0:\n a_list[i] *= -1\n a_list[i+1] *= -1\n\nfor i in range(N-2):\n if a_list[i] + a_list[i+1] < 0:\n a_list[i] *= -1\n a_list[i+1] *= -1\n\nans = sum(a_list)\n\nmin_list... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s597880131', 's905088359', 's731009450'] | [14480.0, 14480.0, 14496.0] | [103.0, 104.0, 87.0] | [610, 650, 571] |
p03062 | u902577051 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['# -*- coding: utf-8 -*-\nN = int(input())\nA = list(map(int, input().split()))\n\ndp = [[0] * 2 for _ in range(N)]\ndp[0][0] = A[0] + A[1]\ndp[0][1] = - A[0] - A[1]\n\nfor i in range(1, N - 1):\n bidx = i - 1\n nidx = i + 1\n for j in range(2):\n dp[i][0] = max(dp[bidx][0] + A[nidx],\n ... | ['Wrong Answer', 'Accepted'] | ['s969496316', 's692661172'] | [24760.0, 24816.0] | [420.0, 270.0] | [471, 406] |
p03062 | u905203728 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n=int(input())\nA=list(map(int,input().split()))\nB=[abs(i) for i in A]\nP=0\nfor i in A:\n if i<0:P +=1\n elif i==0:print(sum(B));exit()\n\nprint(B if P%2==0 else sum(B)-2*min(B))', 'n=int(input())\nA=list(map(int,input().split()))\ncnt,po=0,0\nfor i in range(n):\n if A[i]<0:po +=1\n A[i]=abs(A[i])\n ... | ['Wrong Answer', 'Accepted'] | ['s062408850', 's644741661'] | [14332.0, 14224.0] | [70.0, 89.0] | [178, 172] |
p03062 | u905582793 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n=int(input())\na=list(map(int,input().split()))\nmn=10**18\nng=0\nfor i in a:\n mn=min(mn,abs(i))\n if i<0:\n ng+=1\nif ng%2==0:\n print(sum(a))\nelse:\n print(sum(a)-mn*2)', 'n=int(input())\na=list(map(int,input().split()))\nmn=10**18\nng=0\nsm=0\nfor i in a:\n sm+=abs(i)\n mn=min(mn,abs(i))\n if i<0:\n ... | ['Wrong Answer', 'Accepted'] | ['s845587327', 's931830259'] | [14412.0, 14412.0] | [82.0, 97.0] | [169, 179] |
p03062 | u916806287 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = map(int, input().split()\nabs_a = list(map(abs, a)))\nprint(sum(abs_a) if len([i for i in a if i < 0]) % 2 == 0 else sum(abs_a) - 2 * min(a))\n', 'n = int(input())\na = map(int, input().split())\nprint(sum(a) - 2 * min(a))\n', 'n = int(input())\na = list(map(int, input().split()))\nabs_a = list(... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s587559543', 's827980306', 's567345552'] | [2940.0, 11212.0, 14412.0] | [17.0, 41.0, 54.0] | [161, 74, 171] |
p03062 | u918845030 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['def solve(n, a_list):\n total = [abs(item) for item in a_list]\n negative = [abs(item) for item in a_list if item < 0]\n print(negative)\n if len(negative) % 2 == 0:\n return sum([abs(item) for item in a_list])\n else:\n minimum = sorted(total)[0]\n return sum([abs(item) for item i... | ['Wrong Answer', 'Accepted'] | ['s118541670', 's885033104'] | [20604.0, 19444.0] | [110.0, 101.0] | [559, 560] |
p03062 | u919730120 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ["import sys\nfrom fractions import gcd\ninput = sys.stdin.readline\n\ndef main():\n n=int(input())\n a=list(map(int,input().split()))\n f,b=[0]*(n+2),[0]*(n+2)\n f[1],b[n]=a[0],a[-1]\n for i in range(2,n+1):\n f[i],b[n-i+1]=gcd(a[i-1],f[i-1]),gcd(a[n-i],b[n-i+2])\n ans=0\n for i in range(1,... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s141437534', 's387981944', 's453376258'] | [16360.0, 16400.0, 15180.0] | [189.0, 447.0, 86.0] | [407, 451, 380] |
p03062 | u921199520 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\na = input().split()\nmi = int(a[0])\nans = 0 \nfor i in range(n):\n ans = ans + abs(int(a[i]))\n if mi > int(a[i]):\n mi = int(a[i])\nprint(ans-2*mi)\n', 'n = int(input())\na = input().split()\nmi = abs(int(a[0]))\nans = 0 \ncount = 0\nfor i in range(n):\n ans = ans + abs(int(a[i])... | ['Wrong Answer', 'Accepted'] | ['s584378172', 's640964254'] | [11196.0, 11212.0] | [88.0, 131.0] | [174, 286] |
p03062 | u921830178 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = map(int, input().split())\nA_list = list(map(int, input().split()))\nA_sum = sum(A_list)\narray1 = A_list[1:]\narray2 = A_list[:-1]\narray_add = max(list(map(lambda x,y: -(x+y), array1, array2)))*2\nB_set =A_sum+ array_add\nprint(B_set)', 'import numpy\nN = map(int, input().split())\nA_list = list(map(int, input(... | ['Wrong Answer', 'Accepted'] | ['s619268829', 's167715720'] | [14412.0, 23344.0] | [63.0, 226.0] | [233, 341] |
p03062 | u922487073 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['N = int(input())\nA_list = list(map(int, input().split()))\n\nmin_v = 10**9+1\ncnt_min = 0\nres = 0\nfor i, a in enumerate(A_list):\n print(i, a)\n if a < 0:\n cnt_min += 1\n a = -1 * a\n min_v = min(min_v, a)\n res += a\n\nif cnt_min%2 == 1:\n res -= 2*min_v\nprint(res)', 'N = int(input(... | ['Wrong Answer', 'Accepted'] | ['s850731108', 's587031631'] | [14332.0, 14412.0] | [244.0, 100.0] | [284, 268] |
p03062 | u930574673 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['import numpy as np\n\nn = int(input())\nl = np.array([int(x) for x in input().split()])\nans = 0\nif 0 in l:\n for i in range(n):\n ans += abs(l[i])\n sys.exit()\nm = abs(l[0])\nfor i in range(n):\n if l[i] < 0:\n p += 1\n if m < abs(l[i])\nfor i in range(n):\n ans += abs(l[i])\nif p % 2 == 0:\n print(ans... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s125497717', 's202721896', 's986743142'] | [2940.0, 23296.0, 23344.0] | [17.0, 355.0, 372.0] | [327, 371, 377] |
p03062 | u945418216 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, arranged in a row in this order. You can perform the following operation on this integer sequence any number of times: **Operation** : Choose an integer i satisfying 1 \leq i \leq N-1. Multiply both A_i and A_{i+1} by -1. Let B_1, B_2, ..., B_N be the integer sequence after ... | ['n = int(input())\naa = list(map(int, input().split()))\n\nmin_abs = 10*10\nnegative_count = 0\nans = 0\nfor a in aa:\n if a<0: negative_count += 1\n min_abs = min(min_abs, abs(a))\n ans += abs(a)\n print(negative_count, ans, min_abs) \n\nif negative_count%2==1:\n ans -= min_abs*2\nprint(ans)\n', 'n = i... | ['Wrong Answer', 'Accepted'] | ['s151695618', 's153090935'] | [14224.0, 14224.0] | [285.0, 92.0] | [294, 194] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.