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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03061 | u925364229 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['import sys\nsys.setrecursionlimit(sys.getrecursionlimit())\nN = int(input())\nA = list(map(int,input().split(" ")))\n\ndef gcd (a: int,b: int) -> int:\n if a < b: a,b = b,a\n return a if b == 0 else gcd(b,a%b)\ndef lcm (a: int,b: int) -> int:\n return a // gcd(a,b) * b\n\ngcdForward = [0] * N\ngcdBackWard = ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s596149076', 's775472247', 's558351870'] | [14400.0, 14624.0, 14428.0] | [372.0, 388.0, 242.0] | [708, 744, 685] |
p03061 | u933341648 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['N = int(input())\nA = [int(i) for i in input().split()]\n\ndef gcd(x, y):\n if x < y:\n x, y = y, x\n while y != 0:\n x, y = y, x%y\n return y\n\nL = [0]\nR = [0]\nfor i in range(N):\n L.append(gcd(A[i], L[i]))\n R.append(gcd(A[-i-1], R[i]))\n\nR.reverse()\n\nM = []\nfor i in range(0, N):... | ['Wrong Answer', 'Accepted'] | ['s397314830', 's268714541'] | [14060.0, 14524.0] | [152.0, 178.0] | [347, 347] |
p03061 | u934868410 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['import math\nn = int(input())\na = []\na.append(list(map(int, input().split())))\ndef gcd(x,y):\n if y == 0:\n return x\n return gcd(y, x % y)\n\npow_2 = 1\nexp = 0\nwhile pow_2 < n:\n pow_2 *= 2\n exp += 1\n\na[0].extend([0]*(pow_2 - n))\nfor i in range(1, exp):\n a.append([])\n for j in range(pow_2 / math.... | ['Runtime Error', 'Accepted'] | ['s064423669', 's290146050'] | [14180.0, 14436.0] | [44.0, 1485.0] | [560, 565] |
p03061 | u938486382 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ["import sys\nsys.setrecursionlimit(100001)\n\n\nn = int(input())\nl = list(map(int, input().split(' ')))\ndef gcd(b, s):\n return s if b % s == 0 else gcd(s, b % s)\n\nmemo = {}\nmmm = int(1e10)\ndef ggcd(l, i, skip, current):\n global mmm\n if i == len(l) or current == 1 or current <= mmm:\n if mmm > current:\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s382047747', 's601109475', 's388287415'] | [53180.0, 14488.0, 14428.0] | [962.0, 2104.0, 202.0] | [660, 559, 511] |
p03061 | u944325914 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['n=int(input())\na=list(map(int,input().split()))\nfrom collections import deque\nfrom math import gcd\na_left=deque()\n\na_left.append(a[0])\n\n\na_right=deque()\n\na_right.append(a[-1])\n\nfor i in range(n-1):\n a_left.append(gcd(a_left[-1],a[i+1]))\n a_right.appendleft(gcd(a_right[0],a[n-i-2]))\n\n\na_right=l... | ['Runtime Error', 'Accepted'] | ['s631186661', 's177312384'] | [22604.0, 22436.0] | [133.0, 132.0] | [450, 450] |
p03061 | u949620431 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['from functools import reduce\n\ndef gcd_base(x, y):\n if x >= y:\n while y != 0:\n x, y = y, x % y\n return x\n else:\n while x != 0:\n y, x = x, y % x\n return y\n\ndef gcd(numbers):\n return reduce(gcd_base, numbers)\n\nN = int(input())\nA = list(map(int, i... | ['Runtime Error', 'Accepted'] | ['s362293085', 's653396664'] | [14652.0, 14432.0] | [49.0, 206.0] | [407, 472] |
p03061 | u951492009 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['from fractions import gcd\n#from functools import reduce\na=int(input())\nli=list(map(int,input().split()))\nleft_gcd=[]\nleft_gcd.append(li[0])\nright_gcd=[]\nright_gcd.append(li[a-1])\n\nfor i in range(a-1):\n left_gcd.append(gcd(left_gcd[i],li[i+1]))\nk=0\nfor i in range(a-1,0,-1):\n right_gcd.append(gcd(rig... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s247382812', 's369325402', 's546419050', 's892067556', 's266902018'] | [16156.0, 16148.0, 15156.0, 34504.0, 14076.0] | [161.0, 60.0, 300.0, 2104.0, 292.0] | [686, 696, 711, 454, 713] |
p03061 | u951672936 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['def gcd(a, b):\n if b > a:\n a, b = b, a\n if a % b == 0:\n return b\n return gcd(a%b, b)\n\n\nN = int(input())\nA = [int(s) for s in input().split(" ")]\n\nleft = A.copy()\nright = A.copy()\n\nfor i in range(1, N):\n left[i] = gcd(left[i-1], left[i])\n\nfor i in reversed(range(0, N-1)):\n ... | ['Wrong Answer', 'Accepted'] | ['s493054167', 's546525777'] | [17292.0, 14428.0] | [200.0, 178.0] | [475, 453] |
p03061 | u952656646 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['import fractions as mt\nfrom functools import reduce\ndef gcd(nums):\n return reduce(mt.gcd, nums)\nN = int(input())\nA = list(map(int, input().split()))\ng = []\nfor i in range(N):\n g.append(gcd(A[:i]+A[i+1:]))\nprint(max(g))', 'def gcd(a, b):\n if b==0:\n return a\n while b>0:\n a, b = b,... | ['Time Limit Exceeded', 'Accepted'] | ['s148649801', 's841805681'] | [16100.0, 14436.0] | [2104.0, 213.0] | [224, 480] |
p03061 | u969708690 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['maxa=10**10*(-1)\ndef euclid(a, b):\n if b == 0:\n return a\n else:\n return euclid(b, a%b)\nN=int(input())\nL=list(map(int,input().split()))\nA=[0]*N\nB=[0]*N\na=L[0]\nA[0]=a\nb=L[-1]\nB[0]=b\nfor i in range(N-1):\n A[i+1]=euclid(A[i],L[i+1])\n B[i+1]=euclid(B[i],L[-(i+2)])\nmaxa=max(B[-1],A[-1])\nfor i in... | ['Wrong Answer', 'Accepted'] | ['s314056539', 's478005310'] | [20756.0, 20608.0] | [190.0, 190.0] | [363, 383] |
p03061 | u970197315 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['# ABC125 C - GCD on Blackboard\nfrom fractions import gcd\nn = int(input())\na = list(map(int, input().split()))\n\nl = n*[0]\nr = n*[0]\nans = 0\n\nfor i in range(n-1):\n l[i+1] = gcd(l[i],a[i])\n\nfor i in range(n-1,0,-1):\n r[i-1] = gcd(r[i],a[i])\n\nfor i in range(n-1):\n ans = max(ans,gcd(l[i],r[i]))\np... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s566267349', 's846950445', 's035795610'] | [16116.0, 16144.0, 20668.0] | [199.0, 190.0, 122.0] | [311, 307, 247] |
p03061 | u971632623 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['def gcd(a, b):\n while a:\n a, b = b % a, a\n return b\n\n\nN = int(input())\nA = list(map(int, input().split()))\nb = -1\n\nfor i in range(N):\n a = gcd(r, A[i]) if r != 0 else A[i]\n if a < r:\n b = i\n r = a\n\nr3 = 0\nfor i in range(N):\n if i == b - 1:\n continue\n r3 = ... | ['Runtime Error', 'Accepted'] | ['s785726872', 's601613985'] | [14076.0, 20460.0] | [43.0, 380.0] | [793, 799] |
p03061 | u981931040 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ["import sys\nsys.setrecursionlimit(500000)\ndef gcd(x , y):\n while y != 0:\n x , y = y , x % y\n return x\nN = int(input())\nA = list(map(int ,input().split()))\nmax_val = 0\nif N == 2:\n print(max(A[1], A[0]))\n exit()\nright = []\nleft = []\nwork_right = gcd(A[N - 2] , A[N - 1])\nright.append(A[N... | ['Runtime Error', 'Accepted'] | ['s357573635', 's752870880'] | [3064.0, 14076.0] | [17.0, 201.0] | [1098, 1102] |
p03061 | u985376351 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['import copy\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\nn = int(input())\ns_all = list(map(int, input().split()))\n\nif n>2:\n memo = list([])\n\n for k in range(n):\n t = copy.copy(s_all)\n t.pop(k)\n\n c = gcd(t[0], t[1])\n\n for i in s:\n c... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s465536557', 's553111151', 's264442649'] | [14820.0, 14816.0, 23144.0] | [49.0, 48.0, 308.0] | [387, 343, 373] |
p03061 | u985648232 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['# coding:UTF-8\n\n\ndef calc_gcd(num1, num2):\n \n if num1 < num2:\n num1, num2 = num2, num1\n\n while num2 > 0:\n remainder = num1 % num2\n\n num1 = num2\n num2 = remainder\n\n return num1\n\n\n\nnum_count = int(input())\n\n\ntarget_num = list(map(int, input().split()))\n\n\nl... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s397901807', 's714257719', 's301788467'] | [14620.0, 14492.0, 14488.0] | [205.0, 205.0, 186.0] | [1092, 1082, 1086] |
p03061 | u990670021 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['print(1)', 'N = int(input())\nA = list(map(int,input().split()))\nA.sort()\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n divisors.sort(reverse=True)\n... | ['Wrong Answer', 'Accepted'] | ['s866701934', 's812926957'] | [2940.0, 14488.0] | [17.0, 100.0] | [8, 726] |
p03061 | u993435350 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['import fractions\nimport functools\n\nN = int(input())\nA = list(map(int,input().split()))\n\ngcdlist = []\n\ndef gcdpy(numbers):\n\treturn functools.reduce(fractions.gcd, numbers)\n\nfor i in range(0,N):\n\tI = A[i]\n\tA[i] = A[i-1]\n\tgcdlist.append(gcdpy(A))\n\tA[i] = I\n\t\nprint(max(gcdlist))', '\ndef gcd(x,y):\... | ['Time Limit Exceeded', 'Accepted'] | ['s089646770', 's684544041'] | [16060.0, 14080.0] | [2104.0, 214.0] | [275, 607] |
p03061 | u995102075 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ['import fractions\nfrom functools import reduce\nimport copy\n\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd, numbers)\n\n\nN = int(input())\nA = [int(i) for i in input().split()]\n\nans = 1\nfor i in range(N):\n a = copy.deepcopy(A)\n print(a)\n a.pop(i)\n g = gcd_list(a)\n if g > ans:\n ... | ['Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Accepted'] | ['s149136979', 's786795587', 's794506667', 's598385613'] | [38416.0, 14052.0, 16144.0, 14052.0] | [2104.0, 2104.0, 2104.0, 771.0] | [324, 619, 307, 600] |
p03061 | u998733244 | 2,000 | 1,048,576 | There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte... | ["\na = (list(map(int, input().split())))\n\nif n==2:\n print(max(a))\n exit()\n'''\nL = [gcd(a[0], a[1])]\nR = [gcd(a[n-2], a[n-1])]\n'''\nL = [0 for i in range(n+1)]\nR = [0 for i in range(n+1)]\nfor i in range(1,n+1):\n L[i] = gcd(L[i-1], a[i-1])\n\nfor i in range(n)[::-1]:\n R[i] = gcd(R[i+1], a[i])\n\n... | ['Runtime Error', 'Accepted'] | ['s708857172', 's195778394'] | [3064.0, 14400.0] | [17.0, 229.0] | [374, 491] |
p03062 | u010069411 | 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#_N = 5\n#A = [10, -4, -8, -11, 3]\n_N = int(input())\nA = map(int, input().split(" "))\n\nn = len([*filter(lambda a:a<=-1, A)])\na = [*map(abs, A)]\nres = sum(a)\nif n % 2 == 1:\n res -= min(a) * 2\nprint(res)\n', '\n#_N = 5\n#A = [10, -4, -8, -11, 3]\n_N = int(input())\nA = list(map(int, input().split(" ")))\n... | ['Runtime Error', 'Accepted'] | ['s540199017', 's198298830'] | [2940.0, 14412.0] | [17.0, 60.0] | [205, 217] |
p03062 | u013756322 | 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()))\nans = 0\nabs_A = [abs(a) for a in A]\ncount = sum([1 if a < 0 else 0 for a in A])\nif (count % 2 == 0):\n print(sum(A))\nelse:\n print(sum(abs_A) - min(abs_A))\n', 'n = int(input())\nA = list(map(int, input().split()))\nans = 0\nabs_A = [abs(a) for a in A]\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s049939366', 's401839596', 's362421119'] | [14224.0, 14224.0, 14412.0] | [58.0, 58.0, 60.0] | [213, 217, 220] |
p03062 | u014333473 | 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()))\nminus = [i for i in A if i < 0]\nif len(minus) % 2 == 0:\n max_num = [abs(i) for i in A]\nelse:\n max_num = [abs(i) for i in A]\n if min(max_num) in A:\n print(sum(max_num) - 2*min(max_num))\n else:\n print(sum(max_num) + min(max_num))', 'N = int(input()... | ['Wrong Answer', 'Accepted'] | ['s655431559', 's555334896'] | [14412.0, 14332.0] | [60.0, 57.0] | [289, 206] |
p03062 | u021548497 | 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(x) for x in input().split()]\nb = [x for x in map(abs, a)]\n\np = min(b)\nans = sum(b) - 2 * p\nprint(ans)', 'n = int(input())\na = [int(x) for x in input().split()]\n\ndp = [[0, -100000000000] for i in range(n+1)]\n\nfor i in range(n):\n dp[i+1][0] = max(dp[i][0] + a[i], dp[i][1] - a[i]... | ['Wrong Answer', 'Accepted'] | ['s589106424', 's561252131'] | [14412.0, 25588.0] | [57.0, 206.0] | [127, 253] |
p03062 | u023229441 | 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()))\nc=0\nfor i in A:\n if i<0:\n c+=1\nprint(sum(A) if c%2==0 else sum(A)-2*min(A))', 'n=int(input())\nA=list(map(int,input().split()))\nc=0\nfor i in range(len(A)):\n if A[i]<0:\n c+=1\n A[i]=-A[i]\nprint(sum(A) if c%2==0 else sum(A)-2*min(A))\n'] | ['Wrong Answer', 'Accepted'] | ['s774851538', 's157371936'] | [14284.0, 14284.0] | [55.0, 73.0] | [127, 158] |
p03062 | u024782094 | 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 bisect\nn=int(input())\na=sorted(list(map(int,input().split())))\nind=bisect.bisect_left(a,0)\nprint(ind)\n\nif ind==0:\n print(sum(a))\n\nelif ind%2==0 or a[ind]==0:\n\n print(-sum(a[:ind])+sum(a[ind:]))\nelse:\n print(-sum(a[:ind])+sum(a[ind:])-2*min(abs(a[ind]),abs(a[ind-1])))', 'import bisect\nn=int(inp... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s473294338', 's952526678', 's573713293'] | [14480.0, 3068.0, 14500.0] | [83.0, 17.0, 82.0] | [277, 343, 344] |
p03062 | u024807881 | 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 sys import stdin\n\nreadline = stdin.readline\n\n_, *a = map(int, open(0).read().split())\nres = 0\nmi = 1_000_000_000\nrem = True\nfor v in a:\n if v < 0:\n rem != rem\n b = abs(v)\n res += b\n mi = min(b, mi)\nif rem:\n res -= mi*2\nprint(res)\n', 'from sys import stdin\n\nreadline = stdi... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s021926855', 's521987299', 's541120964', 's653754423', 's686447872', 's687898792', 's732700420', 's377609107'] | [2940.0, 11496.0, 14084.0, 14116.0, 5376.0, 14116.0, 2940.0, 14116.0] | [17.0, 81.0, 99.0, 51.0, 19.0, 50.0, 17.0, 61.0] | [257, 257, 257, 252, 202, 242, 260, 181] |
p03062 | u029234056 | 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()))\nans=0\nc=0\ntmp=10**9\nfor a in A:\n if a<0:\n c+=1\n ans+=abs(a)\n tmp=min(tmp,abs(a))\nprint(tmp)\nif c%2==0:\n print(ans)\nelse:\n print(ans-tmp*2)', 'N=int(input())\nA=list(map(int,input().split()))\nans=0\nc=0\ntmp=10**9\nfor a in A:\n if... | ['Wrong Answer', 'Accepted'] | ['s928892737', 's761825385'] | [14412.0, 14284.0] | [100.0, 98.0] | [208, 197] |
p03062 | u036514535 | 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(n) for n in input().split()]\n\nsum = 0\nminus = 0\nminn = 10 ** 10\nfor a in A:\n b = abs(a)\n sum += b\n if b < minn:\n minn = b\n if a < 0:\n minus += 1\n\nprint(sum)\nprint(minn)\nprint(minus)\n\nif minus % 2 == 0:\n print(sum)\nelse:\n print(sum - 2*minn... | ['Wrong Answer', 'Accepted'] | ['s816380009', 's163709047'] | [14412.0, 14412.0] | [87.0, 88.0] | [299, 270] |
p03062 | u043236471 | 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 ... | ['# D\n\nN = int(input())\nA = [int(x) for x in input().split()]\n\n# abs_list = sorted([abs(x) for x in A])[::-1]\n\nfor i in range(N-1):\n if A[i] < 0:\n A[i] *= -1\n A[i+1] *= -1\n \ntmp = [A]\nfor i in reversed(range(0, N-1)):\n A[i] *= -1\n A[i+1] *= -1\n tmp.append(sum(A))\n \nprin... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s038145422', 's045255700', 's597349020'] | [14412.0, 14212.0, 14332.0] | [2104.0, 2104.0, 60.0] | [311, 310, 224] |
p03062 | u046158516 | 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()))\ntotal=0\nminloss=100000000000\nzeroflag=0\nfor i in range(N):\n total+=abs(a[i])\n if a[i]==0:\n zeroflag=1\n if abs(a[i])<minloss:\n minloss=abs(a[i])\nif N%2==0 or zeroflag==1:\n print(total)\nelse:\n print(total-2*minloss)', 'N=int(input())\na=list(map(i... | ['Wrong Answer', 'Accepted'] | ['s391719959', 's269863962'] | [14332.0, 14412.0] | [84.0, 102.0] | [272, 310] |
p03062 | u046411741 | 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\nB = False\nif all(A):\n print("not contain")\n M = 0\n for i in range(N):\n if A[i] < 0:\n A[i] *= -1\n M += 1\n print(M)\n if M%2 == 0:\n B = True\n else:\n B = False\n\nelse:\n for i in range(N... | ['Wrong Answer', 'Accepted'] | ['s928129697', 's550319866'] | [14496.0, 14412.0] | [73.0, 74.0] | [457, 424] |
p03062 | u047023156 | 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, sys\nfrom bisect import bisect_left, bisect_right\nfrom collections import Counter, defaultdict, deque\nfrom copy import deepcopy\nfrom functools import lru_cache\nfrom heapq import heapify, heappop, heappush\nfrom itertools import accumulate, combinations, permutations\ninput = sys.stdin.readline\nmod =... | ['Wrong Answer', 'Accepted'] | ['s018239933', 's620753526'] | [15008.0, 14992.0] | [63.0, 68.0] | [640, 669] |
p03062 | u050708958 | 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 = [abs(int(i)) for i in input().split()]\ns = sum(a)\nif n % 2 == 0 or 0 in a:\n print(s)\nelse:\n print(s - 2 * min(a))', 'n = int(input())\na = [int(i) for i in input().split()]\nm = len(list(filter(lambda x: x < 0, a)))\ns = [abs(i) for i in a]\nif m % 2 == 0 or 0 in a:\n print(sum(s))... | ['Wrong Answer', 'Accepted'] | ['s251841573', 's933695928'] | [14412.0, 14332.0] | [53.0, 66.0] | [140, 201] |
p03062 | u054514819 | 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\nn = int(input())\nM = list(map(int, input().split()))\nX = [math.abs(x) for x in M]\nprint(sum(X) - min(X)*2)', 'import math\nn = int(input())\nM = list(map(int, input().split()))\np = [q < 0 for q in M].count(True)\nX = [abs(x) for x in M]\nif p % 2 == 0:\n print(sum(X))\nelse:\n print(sum(X) - mi... | ['Runtime Error', 'Accepted'] | ['s245138302', 's697082768'] | [15020.0, 15020.0] | [44.0, 57.0] | [118, 191] |
p03062 | u061984624 | 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_list = list(map(abc, A))\nsort(abs_list)\npos = list(filter(lambda x: x > 0, A))\nneg = list(filter(lambda x: x < 0, A))\n\n# A has 0\nif abs_list[0] == 0:\n\tprint(sum(abs_list))\nelse if len(neg) % 2 == 0:\n\tprint(sum(abs_list))\nelse if abs(pos[0]) < a... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s026877753', 's082685390', 's877758581', 's350580706'] | [2940.0, 14428.0, 14412.0, 14412.0] | [17.0, 42.0, 42.0, 139.0] | [402, 396, 180, 429] |
p03062 | u069602573 | 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 gcd(a, b):\n while b > 0:\n a, b = b, a % b\n return a\n\n\nn = int(input()) \na = list(map(int, input().split())) \n\nli = []\nfor i in range(n - 1):\n li.append(gcd(a[i], a[i + 1]))\n\n if (n - 2) != i and n != 2:\n li.append(gcd(a[i], a[i + 2]))\n\nif(n == 2):\n print(max(a[0], a... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s462375696', 's582672008', 's932544422', 's851657136'] | [14412.0, 14412.0, 14412.0, 14332.0] | [426.0, 428.0, 425.0, 103.0] | [1159, 1159, 1156, 518] |
p03062 | u070449185 | 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()]\nB = [abs(i) for i in A]\nfor i in range(N-1):\n if(A[i]<0):\n A[i] = -A[i]\n A[i+1] = -A[i+1]\nif(A[N]<0):\n flag = False\nelse:\n flag = True\n\nif(flag):\n print(sum(A))\nelse:\n m = min(B)\n print(sum(B))', 'N = int(input())\n... | ['Runtime Error', 'Accepted'] | ['s142675223', 's558463584'] | [14260.0, 14252.0] | [78.0, 78.0] | [280, 286] |
p03062 | u089142196 | 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\nmini=float("inf")\nsumm=0\nfor i in range(N):\n mini = min(mini,abs(A[i]))\n summ += abs(A[i])\n \nprint(summ-2*mini)', 'N=int(input())\nA=list(map(int,input().split()))\nB=[A[0]]\n\nfor i in range(1,N):\n B.append(B[-1]+A[i])\n \nmaxi= -1*float("inf")\nprint(m... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s132108628', 's275595249', 's199994778'] | [15020.0, 14412.0, 24796.0] | [95.0, 121.0, 271.0] | [163, 225, 352] |
p03062 | u102275718 | 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())\nA = np.array(map(int, input().split()))\nif len(A[A<0])%2 == 0:\n ans = sum(abs(A))\nelse:\n A = sorted(abs(A))\n ans = sum(A[1:] - A[0])\nprint(ans)', 'import numpy as np\n\nN = int(input())\nA = np.array(map(int, input().split()))\nif len(A[A<0])%2 == 0:\n ans = s... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s150093476', 's466278874', 's119189696'] | [20364.0, 20364.0, 14412.0] | [159.0, 158.0, 55.0] | [189, 189, 169] |
p03062 | u103902792 | 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()))\nminus = 0\nans = 0\nabs_min = float('inf')\nfor a in A:\n if a < 0:\n minus += 1\n ans += abs(a)\n abs_min = min(abs_min, abs(a))\nif mins%2:\n ans -= abs_min*2\n\nprint(ans)", "n = int(input())\nA = list(map(int,input().split()))\nminus = 0\nans = 0\nabs_m... | ['Runtime Error', 'Accepted'] | ['s222300020', 's625604430'] | [14412.0, 15020.0] | [103.0, 102.0] | [222, 225] |
p03062 | u124025116 | 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()))\nnp.abs(A)\nX=sum(A)\nans = X - 2*min(A)\nprint(ans)', 'import numpy as np\nN = int(input())\nA = list(map(int, input().split()))\nB = A.copy()\nB.sort()\nC=[]\nfor i in range(N):\n if B[i]<0:\n C.append(B[i])\n else:\n continue\ncount ... | ['Wrong Answer', 'Accepted'] | ['s659536366', 's289356129'] | [23376.0, 23304.0] | [187.0, 280.0] | [120, 302] |
p03062 | u130900604 | 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 in a)\nprint(f)\nimport numpy as np\n\na=np.array(a)\n\nb=abs(a)\n\nc=min(b)\n\nd=sum(a==b)\n\nif d%2==1 or f:\n print(sum(b))\nelse:\n print(sum(b)-2*c)\n', 'from numpy import*\n\n\nn=int(input())\na=array(list(map(int,input().split())))\nb=abs(a)\n\n\nif 0 in... | ['Wrong Answer', 'Accepted'] | ['s714060903', 's354954782'] | [17272.0, 23304.0] | [535.0, 190.0] | [194, 224] |
p03062 | u142400400 | 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())\n\nA = list(map(int), input().split())\nif N % 2 == 0:\n print(sum(map(abs, A)))\nelse:\n neg = [a for a in A if a < 0]\n c = max(neg) if len(neg) > 0 else 0\n print(sum(map(abs, A)) - 2 * c)', 'N = int(input())\n\nA = list(map(int), input().split())\nif N % 2 == 0:\n print(sum(map(abs... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s774539028', 's839577983', 's657031671'] | [3060.0, 3060.0, 15020.0] | [17.0, 18.0, 55.0] | [212, 166, 182] |
p03062 | u144980750 | 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,input())\nsum=0\nc=0\nfor i in range(n):\n if a[i]<0:\n a[i]=a[i]*-1:\n c=c+1\n sum=sum+a[i]\n if c%2==0:\n print(sum)\n else:\n print(sum-min(a)*2)', 'n=int(input())\na=list(int,input())\nsum=0\nc=0\nfor i in range(n):\n if a[i]<0:\n a[i]=a[i]*-1:\n c=c+1\n sum=... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s000948458', 's594808899', 's754286562'] | [2940.0, 3064.0, 14228.0] | [17.0, 17.0, 86.0] | [181, 181, 183] |
p03062 | u146066372 | 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\ncnt=0\nans=0\n\nfor i in range(n):\n if a[i]<0:\n cnt+=1\n a[i]*=-1\n\nprint(a)\n\n\n\nif cnt%2==0:\n ans=sum(a)\n\nelse:\n ans=sum(a)-2*min(a)\n\nprint(ans)\n', 'n=int(input())\na=list(map(int,input().split()))\n\ncnt=0\nans=0\n\nfor i in ran... | ['Wrong Answer', 'Accepted'] | ['s115738284', 's741462231'] | [19980.0, 19984.0] | [79.0, 72.0] | [212, 202] |
p03062 | u146597538 | 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(long, input().split()))\n\nans = 0\nfor i in a:\n ans += abs(i)\n\nprint (ans)', 'n = int(input())\na = list(map(int, input().split()))\n\nans = 0\nminus_cnt = 0\nmin_num = 10000000000000\nfor i in a:\n if i < 0:\n minus_cnt += 1\n if abs(i) < min_num:\n min_num = abs(i)\n\nca... | ['Runtime Error', 'Accepted'] | ['s962092852', 's602216044'] | [3060.0, 14412.0] | [17.0, 77.0] | [104, 288] |
p03062 | u164474813 | 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()))\nmina = 10*10\nminus = False\nsumA = 0\nfor a in A:\n if a < 0:\n if minus:\n minus = False\n else:\n minus = True\n \ta = -a\n sumA += a\n mina = min(a, mina)\n\n\nif minus:\n sumA -= 2*mina\nprint(sumA)', 'n = i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s538320178', 's758414216', 's605022457'] | [2940.0, 2940.0, 14332.0] | [18.0, 18.0, 87.0] | [290, 290, 234] |
p03062 | u167681750 | 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\nm = 10**9\nsum = 0\nfor i in a:\n i = abs(i)\n m = min(m,i)\n sum += i\n count += 1\n \nif count % 2 == 1:\n sum -= m * 2\n \nprint(sum)', 'n = int(input())\na = list(map(int, input().split()))\n\ncount = 0\nm = 10**9\nsum = 0\nf... | ['Wrong Answer', 'Accepted'] | ['s528346931', 's218659265'] | [14284.0, 14332.0] | [93.0, 99.0] | [210, 221] |
p03062 | u177411511 | 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\nstdin = sys.stdin\n\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nns = lambda: stdin.readline().rstrip()\n\nn = ni()\nli = na()\nif n == 2:\n print(abs(sum(li)))\nelse:\n for i in range(n-2):\n if li[i] < 0:\n if li[i+1] < 0:\n if ... | ['Wrong Answer', 'Accepted'] | ['s860763214', 's449708948'] | [14412.0, 14412.0] | [104.0, 105.0] | [1311, 376] |
p03062 | u178192749 | 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()\nl = list(map(abs,map(int,input().split())))\nprint(sum(l) - min(l)*2)', 'n = input()\nl = list(map(int,input().split()))\ncnt = len([i for i in l if i<0])\nabs_l = list(map(abs,l))\nprint(sum(abs_l) if cnt%2==0 else sum(abs_l)-2*min(abs_l))'] | ['Wrong Answer', 'Accepted'] | ['s234846537', 's671538907'] | [14332.0, 14412.0] | [51.0, 54.0] | [80, 163] |
p03062 | u187205913 | 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 n==2:\n print(max(a[0],a[1]))\n exit()\ndef gcd(a,b):\n if b==0:\n return a\n else:\n return gcd(b,a%b)\ng = gcd(max(a[0],a[1]),min(a[0],a[1]))\nind = [0,1]\nfor i in range(1,n):\n tmp = gcd(max(g,a[i]),min(g,a[i]))\n if tmp<g:\n... | ['Wrong Answer', 'Accepted'] | ['s719159217', 's194106501'] | [14480.0, 25644.0] | [336.0, 233.0] | [553, 256] |
p03062 | u189188797 | 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())\nn-=1\na=list(map(int,input().split()))\ncnt=0\nans=0\nfor i in range(n):\n if cnt>0:\n a[i]=a[i]*(-1)\n if a[i]<0:\n cnt=2\n a[i]=a[i]*(-1)\n else:\n pass\n ans+=a[i]\n cnt-=1\nif cnt>0:\n a[n]=abs(a[n])\n m=min(a)\n if m==a[n]:\n ans-=m\n ... | ['Wrong Answer', 'Accepted'] | ['s124750258', 's591858753'] | [14468.0, 14492.0] | [90.0, 89.0] | [357, 345] |
p03062 | u203843959 | 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()\nalist = list(map(int,input().split()))\n\nans = 0\nfor i in range(N):\n ans += abs(alist[i])\n \nprint(ans)', 'N = int(input())\nalist = list(map(int,input().split()))\n\nneg_cnt = 0\nabs_min = 999999999999999\nfor an in alist:\n if an < 0:\n neg_cnt += 1\n if abs_min > abs(an):\n abs_min = abs(a... | ['Runtime Error', 'Accepted'] | ['s934321616', 's464074717'] | [14412.0, 14284.0] | [43.0, 85.0] | [113, 303] |
p03062 | u204208382 | 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()))\ncount=0\na_abs=[0 for j in range(n)]\nmin_abs=abs(a[0])\nfor i in range(n):\n a_abs[i]=abs(a[i])\n if a[i]<0:\n count+=1\n if abs(a[i])<min_abs:\n min_abs=abs(a[i])\n \n\nif count%2==0:\n ans=sum(a_abs)\nelse:\n ans=sum(a_abs)-2*min... | ['Wrong Answer', 'Accepted'] | ['s910942034', 's888158441'] | [14224.0, 14412.0] | [94.0, 95.0] | [350, 322] |
p03062 | u225463683 | 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 = input()\nA = np.array([int(x) for x in input().split(" ")])\n\nary = []\n\nold_idx = 0\nsumm = 0\nfor i in range(len(A)-1):\n if A[i] >= 0 and A[i+1] >= 0:\n A_tmp = np.array(A[old_idx:i+1])\n if len(np.where(A_tmp<0)[0])//2 == 0:\n summ += np.abs(A_tmp).sum()\n else:\n s... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s044456984', 's253829926', 's494684015', 's553075373'] | [23316.0, 23296.0, 23316.0, 23324.0] | [2100.0, 185.0, 2067.0, 185.0] | [586, 202, 584, 199] |
p03062 | u226400521 | 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 ... | ['input()\nA=list(map(int,input()))\ns=0\nfor a in A:\n if a < 0:\n s += 1\nS=0\nif s % 2 == 0:\n S = sum([abs(a) for a in A])\nelse:\n B = [abs(a) for a in A]\n m = min(B)\n S = sum(B) - 2*m\nprint(S)', 'input()\nA=list(map(int,input()))\ns=0\nfor a in A:\n if a < 0:\n s += 1\nif s % 2 == 0:\n S = sum([ab... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s119731724', 's608326755', 's935557739', 's775530543'] | [5372.0, 5376.0, 5372.0, 15020.0] | [19.0, 19.0, 19.0, 66.0] | [194, 190, 194, 202] |
p03062 | u227082700 | 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()))\ndp=[[0,0]for _ in range(n)]\ndp[0]=[a[0],-a[0]]\nfor i in range(1,n):\n dp[i][0]=max(dp[i-1][0]+a[i],dp[i-1][1]-a[i])\n dp[i][1]=max(dp[i-1][0]-a[i],dp[i-1][1]+a[i])\nfor i in dp:print(i)\nprint(dp[n-1][0])', 'n=int(input())\na=list(map(int,input().split()))\ndp=[[0... | ['Wrong Answer', 'Accepted'] | ['s505093967', 's620915579'] | [31288.0, 30912.0] | [238.0, 178.0] | [250, 229] |
p03062 | u227085629 | 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()))\ni = 10**9\ns = 0\nz = 0\nc = 0\nfor b in a:\n if b < 0:\n s += 1\n elif b == 0:\n z += 1\n if abs(b) < i:\n i = abs(b)\n c += abs(b)\nprint(s,z,c)\nif z > 0 or s%2 == 0:\n print(c)\nelse:\n print(c-2*i)', 'n = int(input())\na = list(map(int,input().... | ['Wrong Answer', 'Accepted'] | ['s615253580', 's916439387'] | [14412.0, 14412.0] | [82.0, 84.0] | [253, 240] |
p03062 | u227170240 | 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()))\nabsmin = 0\nminnum = 0\nfor i in range(n):\n if abs(a[i]) < abs(a[absmin]):\n i = absmin\n if a[i] <= 0:\n minnum += 1\n a[i] = abs(a[i])\nif minnum % 2 == 1:\n a[absmin] = -1 * abs(a[absmin])\nans = 0\nfor i in range(n):\n ans += a[i]\nprint(ans)', 'n... | ['Wrong Answer', 'Accepted'] | ['s180585710', 's154554356'] | [14412.0, 14412.0] | [107.0, 114.0] | [298, 298] |
p03062 | u252828980 | 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()))\n\ndef sel2(a,b,c):\n if a <= 0 and b <= 0 and c >= 0:\n return (-a,-b,c)\n elif a >= 0 and b <= 0 and c <= 0:\n return (a,-b,-c)\n elif a <= 0 and b >= 0 and c <= 0:\n return (-a,b,-c)\ndef sel1(a,b,c):\n if a <= 0 and b >= 0 and c... | ['Runtime Error', 'Accepted'] | ['s893446898', 's326021953'] | [14480.0, 14332.0] | [44.0, 110.0] | [1310, 216] |
p03062 | u255499778 | 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()))\nbox = []\n\nfor num in range(n):\n box.append(abs(a[num]))\n\nbox.sort()\n\nbox[0] = -box[0]\n\nprint(sum(box))', 'n = int(input())\na = list(map(int, input().split()))\npbox = []\nnbox = []\nif 0 in a:\n count = 0\n for i in a:\n count += abs(i)\... | ['Wrong Answer', 'Accepted'] | ['s855100283', 's219206516'] | [14412.0, 14412.0] | [98.0, 90.0] | [158, 570] |
p03062 | u259046272 | 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(" ")))\ndp = [[0 for i in range(2)] for i in range(n)]\n\ndp[1][0] = a[0] + a[1]\ndp[1][1] = -(a[0] + a[1])\n\nfor i in range(2, n):\n dp[i][0] = max(dp[i-1][0]+a[i], dp[i-1][1]+a[i])\n dp[i][1] = max(dp[i-1][0]+(-2*a[i-1])+(-a[i]), dp[i-1][1]+2*a[i-1]+(-a[i]))\... | ['Wrong Answer', 'Accepted'] | ['s372242744', 's081626856'] | [29172.0, 26224.0] | [552.0, 278.0] | [433, 346] |
p03062 | u259755734 | 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())\nn = N//3 + (1 if N % 3 == 0 else 2)\ncur_i = []\n\nfor i in range(n):\n a = A[i]\n b = A[i+1]\n c = A[i+2]\n\n if a < 0 and b < 0 and c < 0:\n if A[i-1] * -1 > A[i+3] * -1:\n cur_i.append(i-1)\n else:\n cur_i.append(i+3)\n\nans ... | ['Runtime Error', 'Accepted'] | ['s926985337', 's447440276'] | [14500.0, 14116.0] | [2104.0, 58.0] | [418, 242] |
p03062 | u260216890 | 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()]\nans=None\na_pos=[abs(i) for i in a]\na_min=min(a_pos)\nif n%2==0:\n ans=sum(a_pos)\nelse: ans=sum(a_pos)-2*a_min', 'n=int(input())\na=[int(i) for i in input().split()]\nans=None\na_pos=[abs(i) for i in a]\na_min=min(a_pos)\nif n%2==0:\n ans=sum(a_pos)\nelse: ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s322750752', 's380746347', 's883475808', 's955925349', 's539095198'] | [14332.0, 14412.0, 14412.0, 14260.0, 14412.0] | [58.0, 55.0, 53.0, 60.0, 63.0] | [161, 173, 392, 217, 216] |
p03062 | u263830634 | 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())\nlst_A =list(map(int, input().split()))\nneg_count = 0\nzero_count = 0\ntotal = 0\n\nif lst_A[0] < 0:\n neg_count += 1\nelif lst_A[0] == 0:\n zero_count +=1\ntotal += abs(lst_A[0])\nprint (total)\nmemo = abs(lst_A[0])\ni = 1\nwhile i < N:\n if lst_A[i] < 0:\n neg_count += 1\n elif ... | ['Wrong Answer', 'Accepted'] | ['s341278044', 's456676929'] | [14496.0, 14480.0] | [199.0, 117.0] | [558, 526] |
p03062 | u279493135 | 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, re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, di... | ['Wrong Answer', 'Accepted'] | ['s637113203', 's023406422'] | [15136.0, 15144.0] | [91.0, 85.0] | [744, 748] |
p03062 | u283520984 | 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()]\ncnt=0\nans=0\nB=[]\nfor i in range(N):\n if A[i]<0:\n cnt+=1\nif cnt%2==0:\n ans=sum(abs(A))\n print(ans)\nelse:\n for i in range(N):\n if A[i]<0:\n B.append(A[i])\n max(B)\n ans=sum(abs(A))\n ans=ans+2*B\n print(a... | ['Runtime Error', 'Accepted'] | ['s605094011', 's796348235'] | [14224.0, 14252.0] | [84.0, 87.0] | [303, 270] |
p03062 | u286201019 | 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().split() )\nA = np.array(list( map( int, input().split() ) ))\n\n\n\nA_abs = np.abs(A)\n\nif 0 in A:\n print(np.sum(A_abs))\n\nelse:\n num = 0\n for i in range(N):\n if A[i] < 0:\n num += 1\n\n if num % 2 == 0:\n print(np.sum(A_abs))\n else... | ['Runtime Error', 'Accepted'] | ['s513980438', 's813696489'] | [12500.0, 25060.0] | [149.0, 319.0] | [658, 651] |
p03062 | u288087195 | 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 = int(input())\nA = list(map(int, input().split()))\n\nabs_A = [abs(A[i]) for i in A]\nans = 0\nif N % 2 == 0:\n ans = sum(abs_A)\nelse:\n ans = sum(abs_A) - 2*min(abs_A)\n\nprint(ans)', '# -*- coding: utf-8 -*-\n\nN = int(input())\nA = list(map(int, input().split()))\n\ncnt = 0\nab... | ['Runtime Error', 'Accepted'] | ['s071478930', 's278108861'] | [14412.0, 14332.0] | [43.0, 75.0] | [207, 285] |
p03062 | u294385082 | 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 = [i if i>=0 else i*(-1) for i in a]\nMIN = min(aabs)\nans = 0\nmcount = 0\n\nfor i in range(n):\n if a[i] < 0:\n mcount += 1\n \nif mcount%2 == 0:\n for i in a:\n ans += abs(i)\n print(ans)\nelse:\n for i in a:\n ans += abs(i)\n print(ans ... | ['Wrong Answer', 'Accepted'] | ['s249992234', 's764184101'] | [14412.0, 14332.0] | [151.0, 83.0] | [311, 450] |
p03062 | u294630296 | 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\nabsA=[0 for i in range(N)]\nfor i in range(N):\n absA[i]=abs(A[i])\n\nres = sum(absA)-min(absA)\nprint(res)\n', 'N = int(input())\nA = list(map(int,input().split()))\n\nc=0\nabsA=[0 for i in range(N)]\nfor i in range(N):\n if A[i] <=0:\n c+=1\n a... | ['Wrong Answer', 'Accepted'] | ['s195406743', 's353764679'] | [14412.0, 14412.0] | [67.0, 82.0] | [159, 236] |
p03062 | u297756089 | 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()))\nc=0\nk=0\nfor i in range(0,n):\n if a[i]<0:\n c=c+1\n k=k+abs(a[i])\n a[i]=abs(a[i])\na.sort()\nprint(a)\nif c%2==1:\n k=k-2*a[0]\n print(k)\nelse:\n print(k)', 'n=int(input())\na=list(map(int,input().split()))\nc=0\nk=0\nfor i in range(0,n):\n if a[i]<0:\n ... | ['Wrong Answer', 'Accepted'] | ['s446381907', 's041504763'] | [14412.0, 14412.0] | [141.0, 129.0] | [202, 194] |
p03062 | u300269535 | 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)-min(a))', 'n = int(input())\na = list(map(int, input().split()))\n\ncnt = 0\nfor i in a:\n if i < 0:\n cnt += 1\n\na = list(map(abs, a))\ntotal = sum(a)\n\nif cnt % 2 == 0:\n print(total)\nelse:\n print(total - 2 * min(a))\... | ['Wrong Answer', 'Accepted'] | ['s221120501', 's400006895'] | [14332.0, 14224.0] | [51.0, 60.0] | [83, 215] |
p03062 | u307516601 | 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\nsys.setrecursionlimit(10**6)\n\nn = int(input())\nA = list(map(int, input().split()))\nINF = 10**9\n\ndp = [[0]*2 for _ in range(n+1)]\u3000\n\ndp[0][0] = 0 \ndp[0][1] = -INF\n\nfor i in range(1,n+1):\n dp[i][0] = max(dp[i-1][0]+A[i-1], dp[i-1][1]-A[i-1]) \n dp[i][1] = max(dp[i-1][0]-A[i-1], dp[i-1]... | ['Runtime Error', 'Accepted'] | ['s538766559', 's775111737'] | [8984.0, 31312.0] | [23.0, 190.0] | [849, 847] |
p03062 | u310233294 | 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()))\nminus_count = 0\nfor i in a:\n if i < 0:\n minus_count += 1\na = [abs(e) for e in a]\nif minus_count % 2 != 0:\n a_min = a.pop(a.index(min(a)))\nans = sum(a) - a_min\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\na_min = 0\nmin... | ['Runtime Error', 'Accepted'] | ['s164722908', 's885726358'] | [14332.0, 14332.0] | [61.0, 61.0] | [235, 245] |
p03062 | u320511454 | 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())\nA=np.array(list(map(int,input().split())))\nA = np.abs(A)\n\nif 0 in A:\n print(np.sum(A))\nelse:\n print(np.sum(A) - np.min(A))', 'import numpy as np\n\nn = int(input())\nA = np.array(list(map(int,input().split())))\nminus = np.count_nonzero(A < 0)\nA = np.abs(A)\n\nif minus %... | ['Wrong Answer', 'Accepted'] | ['s386209700', 's310346643'] | [38076.0, 38164.0] | [143.0, 144.0] | [159, 207] |
p03062 | u334712262 | 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 -*-\nimport bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, prod... | ['Wrong Answer', 'Accepted'] | ['s518811787', 's703877748'] | [17436.0, 16704.0] | [234.0, 83.0] | [1266, 1311] |
p03062 | u338824669 | 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()))\npbox=[]\nnbox=[]\nif 0 in A:\n count=0\n for i in A:\n count += abs(i)\n print(count)\nelse:\n for i in a:\n if i > 0:\n pbox.append(i)\n else:\n nbox.append(i)\n if len(nbox)%2==0:\n count=0\n for i in a:\n count += abs(i)\n prin... | ['Runtime Error', 'Accepted'] | ['s691436497', 's718535888'] | [14440.0, 14496.0] | [56.0, 90.0] | [455, 455] |
p03062 | u345483150 | 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 a:\n i=abs(i)\nprint(sum(a))', 'n=int(input())\na=list(map(int,input().split()))\nfor i in range(n-1):\n\tif -a[i]-a[i+1]>=a[i]+a[i+1]:\n a[i]=-a[i]\n a[i+1]=-a[i+1]\nprint(sum(a))', 'n=int(input())\na=list(map(int,input().split()))\nfu=0\nfor i ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s383584163', 's519182220', 's314738571'] | [14412.0, 2940.0, 14224.0] | [58.0, 19.0, 70.0] | [86, 151, 180] |
p03062 | u349836672 | 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\n if N == 2:\n print(max(A[0]+A[1], (-A[0])+(-A[1])))\n return\n\n a_sum, a1, a2 = 0, A[0], A[1]\n b_sum, b1, b2 = 0, -A[0], -A[1]\n for i in range(2, N):\n #print(a_sum, a1, a2)\n #print(b_sum, b1, b2... | ['Runtime Error', 'Accepted'] | ['s530568227', 's009608516'] | [14480.0, 14480.0] | [45.0, 128.0] | [729, 999] |
p03062 | u350578302 | 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 fractions\nimport functools\nN = int(input())\nA = [int(i) for i in input().split()] \nmax_gcd = functools.reduce(fractions.gcd, A)\nfor i in range(N):\n\ttmp = A.copy()\n\tif A[i]%2==1:\n\t\ttmp.pop(i)\n\t\tgcd = functools.reduce(fractions.gcd, tmp)\n\telse:\n\t\tgcd = functools.reduce(fractions.gcd, tmp)\n\t... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s457749722', 's881743993', 's948735499', 's086210375'] | [16432.0, 23300.0, 23316.0, 23292.0] | [2104.0, 207.0, 209.0, 209.0] | [345, 221, 187, 243] |
p03062 | u350836088 | 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()))\ndp = [[0,0]]*(n+1)\ndp[0][0] = 0\ndp[0][1] = -float('inf')\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])\n\nprint(dp[n][0])\n \n\n", 'n = int(input())\na = list(map(int,input().split()))\nd... | ['Wrong Answer', 'Accepted'] | ['s690288330', 's648265258'] | [14412.0, 25572.0] | [180.0, 199.0] | [246, 254] |
p03062 | u358791207 | 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())\nA = [int(i) for i in input().split()]\n\nab = len([n for n in A if n <0]) % 2\n\nB = np.sort(np.abs(A))\nif ab == 0:\n print(sum(A))\nelse:\n print(sum(A[1 :] - A[0]))', 'import numpy as np\n\nN = int(input())\nA = [int(i) for i in input().split()]\n\nab = len([n for n in A i... | ['Runtime Error', 'Accepted'] | ['s010429899', 's821132353'] | [23344.0, 23300.0] | [196.0, 228.0] | [198, 199] |
p03062 | u366959492 | 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=(map(int,input().split()))\naa.append(0)\naaa=tuple(a)\na=list(aaa)\nfor i in range(n-1):\n if a[i]<0:\n a[i]=-1*a[i]\n a[i+1]=-1*a[i+1]\nb=list(aaa)\nfor i in range(n,0,-1):\n if b[i]<0:\n b[i]=-1*b[i]\n b[i-1]=-1*b[i-1]\n\nprint(max(sum(a),sum(b))\n', 'n=int(inpu... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s065485438', 's315030453', 's540808242', 's647505544', 's660610781', 's526496771'] | [3064.0, 14284.0, 14496.0, 14412.0, 14224.0, 14412.0] | [17.0, 42.0, 173.0, 44.0, 43.0, 80.0] | [288, 205, 326, 62, 70, 205] |
p03062 | u370429695 | 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 -= 1000000000000\n break\n elif a[i] < 0:\n cnt += 1\na = [abs(a[i]) for i in range(n)]\nif cnt < 0 or num % 2 == 0:\n print(sum(a))\nelse:\n print(sum(a) - 2*min(a))', 'n = int(inp... | ['Runtime Error', 'Accepted'] | ['s619345716', 's500366079'] | [14412.0, 14332.0] | [74.0, 75.0] | [290, 290] |
p03062 | u370576244 | 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()))\nneg = 0\nr = \nfor i in a:\n r = r + abs(i)\n if i < 0 :\n neg = neg + 1\nif neg % 2 != 0:\n s = 10000000000\n for i in a:\n s = min(s,abs(i))\n r = r - 2*s\n \nprint(r)\n\n \n', 'n = int(input())\na = list(map(int,input().split()))\nneg = 0\nfor i i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s382563311', 's619222094', 's287319589'] | [2940.0, 14412.0, 14412.0] | [17.0, 43.0, 90.0] | [227, 221, 226] |
p03062 | u374802266 | 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()))\ncount=0\ncountk=0\nsaidaiti=0\nwhile True:\n saidaiti=saidaiti+abs(a[count])\n count=count+1\n if a[count]%2==1:\n countk=countk+1\n if count==n:\n break\nif countk%2==1:\n saidaiti=saidaiti-2*a[-1]\nprint(saidaiti)', 'n=int(input())\na=li... | ['Runtime Error', 'Accepted'] | ['s031398105', 's128454056'] | [14252.0, 20136.0] | [86.0, 68.0] | [280, 114] |
p03062 | u395202850 | 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 B = list(map(lambda x: abs(x), A))\n print(sum(B) - 2 * min(B))\n\n\nif __name__ == '__main__':\n main()\n", "def main():\n n = int(input())\n A = list(map(int, input().split()))\n B = [None] * n\n cnt = 0\n for i in ... | ['Wrong Answer', 'Accepted'] | ['s983200949', 's439057422'] | [20132.0, 20132.0] | [62.0, 69.0] | [183, 294] |
p03062 | u396824275 | 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(list(map(int,input().split())))\nans=np.sum(np.abs(A))-2*np.min(np.abs(A))\nprint(ans)', 'import numpy as np\n\ndef rev(i):\n if i==0:\n return 1\n return 0\n\nN=int(input())\nA=np.array(list(map(int,input().split())))\ns=[]\nfor i in range(N):\n if A[i]>... | ['Wrong Answer', 'Accepted'] | ['s701029616', 's730849172'] | [23308.0, 23384.0] | [336.0, 312.0] | [129, 424] |
p03062 | u398910192 | 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 = [int(v) for v in input().split(' ')]\n\n\n\n\nsign = 1\nfor a in A:\n sign *= a/abs(a)\n \nif sign > 0:\n print(sum(A))\nelse:\n print(sum(A)-min(A))", "# -*- coding: utf-8 -*-\nN = int(input())\nA = [int(v) for v in input().split(' ')]\n\n\n\n\nsign = 1\nfor... | ['Runtime Error', 'Accepted'] | ['s119901465', 's804991138'] | [14284.0, 14412.0] | [65.0, 77.0] | [321, 379] |
p03062 | u400221789 | 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()))\ncount=0\nflag=1\nnum=10*9+1\nfor i in range(n):\n if a[i]<0:\n count+=1\n a[i]*=-1\n elif a[i]==0:\n flag=0\n if num>a[i]:\n num=a[i]\nif count%2==0 or flag=0:\n print(sum(a))\nelse:\n print(sum(a)-2*num)', 'n=int(input())\na=list(map(int,input().spli... | ['Runtime Error', 'Accepted'] | ['s292277875', 's359261202'] | [3064.0, 14412.0] | [17.0, 71.0] | [255, 231] |
p03062 | u405660020 | 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.read\n\n\nn=int(input())\nlsta=list(map(int, input().split()))\n\nabslsta=[abs(v) for v in lsta]\nmin_index=abslsta.index(min(abslsta))\n\nfor i in range(n-1):\n if lsta[i]<0:\n lsta[i]=lsta[i]*(-1)\n lsta[i+1]=lsta[i+1]*(-1)\n\nif lsta[n-1]<0:\n if min_index==n-1:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s371971935', 's661222717', 's340247442'] | [5264.0, 5264.0, 14468.0] | [26.0, 26.0, 81.0] | [418, 437, 419] |
p03062 | u405832869 | 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()\nnum=[]\ntex=[]\ncount=0\nfor i in range(N):\n\tnum.append(int(a[i]))\n\tif num[i] < 0 :\n\t\tcount +=1\n\telif num[i] == 0:\n\t\tcount2 +=1\nif count%2 ==0 or count2 > 0:\n\tres = sum(num)\nelse:\n\ttex=[i for i, x in enumerate(num) if x <0]\n\tres =sum(num)-min(tex[0],tex[-1])\... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s042994696', 's105528359', 's500724765', 's705557901'] | [14412.0, 3060.0, 19020.0, 19316.0] | [77.0, 17.0, 98.0, 99.0] | [303, 302, 305, 320] |
p03062 | u408620326 | 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(x) for x in input().split()]\nB=[x for x in A if x<0]\n\nif len(B)%2==0:\n minus=0\nelse:\n minus=max(B)\n \nprint(sum(A)+minus)', 'N=int(input())\nA=[int(x) for x in input().split()]\nB=[x for x in A if x<0]\n\nif len(B)%2==0:\n minus=0\nelse:\n minus=max(B)\n \nprint(sum(A)+B)', 'N=int(... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s715898858', 's951958688', 's636584886'] | [14412.0, 14332.0, 14412.0] | [52.0, 53.0, 59.0] | [145, 141, 177] |
p03062 | u419877586 | 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\nN=int(input())\nA=list(map(int, input().split()))\nA=list(map(math.fabs, A))\nA.sort()\nprint(sum(A[1:]-A[0]))', 'N=int(input())\nA=list(map(int, input().split()))\nA=list(map(lambda x:-x if x < 0 else x, A))\nA.sort()\nprint(sum(A[1:]-A[0]))', 'N=int(input())\nA=list(map(int, input().split()))\nA=list(m... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s409567635', 's653543095', 's658644125', 's817246990', 's746549815'] | [15020.0, 14412.0, 14224.0, 14412.0, 14412.0] | [105.0, 95.0, 88.0, 87.0, 110.0] | [118, 124, 100, 100, 199] |
p03062 | u427571081 | 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 n&1:\n print(sum(list(map(abs,a)))-2*min(list(map(abs,a))))\nelse:\n print(sum(list(map(abs,a))))\n', 'n=int(input())\na=list(map(int,input().split()))\nn=sum(list(map(lambda x: x<0,a)))\nc0=sum(list(map(lambda x: x==0,a)))\nif c0:\n print(sum(list(map(abs... | ['Wrong Answer', 'Accepted'] | ['s710703324', 's586322177'] | [14284.0, 14252.0] | [58.0, 77.0] | [152, 274] |
p03062 | u439063038 | 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 = [[0] * 2 for _ in range(N+1)]\ndp[0][0] = 0\ndp[0][1] = -10**18\n\nfor i in range(1, N):\n dp[i][0] = max(dp[i-1][0]+a[i-1], dp[i-1][1]-a[i-1])\n dp[i][1] = max(dp[i-1][0]-a[i-1], dp[i-1][1]+a[i-1])\nprint(max(dp[N-1][0], dp[N-1][0]))', 'N = int(inpu... | ['Wrong Answer', 'Accepted'] | ['s077328361', 's398238792'] | [31152.0, 31024.0] | [188.0, 193.0] | [292, 277] |
p03062 | u451017206 | 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()]\nn = [a for a in A if a < 0]\nS = sum([abs(a) for a in A])\nif len(n) == 0:\n print(S)\nelse:\n print(S - 2 * abs(min(n)))', 'N = int(input())\nA = [int(i) for i in input().split()]\nn = [a for a in A if a < 0]\nS = sum([abs(a) for a in A])\nif len(n) % 2 ... | ['Wrong Answer', 'Accepted'] | ['s411788989', 's391378957'] | [14412.0, 14252.0] | [60.0, 66.0] | [177, 194] |
p03062 | u452955775 | 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=[0]*n\na=map(int,input().split())\n \nz=0\nresult=0\nmin=1000000002\n\nfor i in a:\n if i<0:\n z+=1\n\n i=abs(i)\n result+=i\n if i<min:\n min=i\n\nif z//2==1:\n result-=min*2\n\nprint(result)', 'n=int(input())\na=[0]*n\na=map(int,input().split())\n \nz=0\nresult=0... | ['Wrong Answer', 'Accepted'] | ['s410595242', 's031558957'] | [17844.0, 17892.0] | [74.0, 80.0] | [222, 222] |
p03062 | u456595418 | 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\n\nn = int(input())\na = list(map(int, input().split()))\nsum = 0\nminus_count = 0\nzero_flag = 0\nmin_ind = 0\n\nfor i in range(n):\n\tif a[i] < 0:\n\t\tminus_count += 1\n\tif a[i] == 0:\n\t\tzero_flag = 1\n\nif zero_flag ==1:\n\tfor i in range(n):\n\t\tsum += abs(a[i])\nelif minus_count % 2 == 0:\n\tfor i in ran... | ['Runtime Error', 'Accepted'] | ['s029916405', 's517085849'] | [3064.0, 14252.0] | [18.0, 96.0] | [475, 334] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.