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
p02971
u254221913
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\na = [0] * n\nfor i in range(n):\n a[i] = int(input())\nfor i in range(n):\n li_s = max(a[:i])\n li_g = max(a[i+1:])\n print(max(li_s,li_g))', 'n = int(input())\na = [0] * n\nfor i in range(n):\n a[i] = int(input())\nsorted_a = sorted(a, reverse=True)\nmax_a = sorted_a[0]\nfor i in ran...
['Runtime Error', 'Accepted']
['s840056389', 's373563197']
[12788.0, 14160.0]
[348.0, 581.0]
[162, 225]
p02971
u255428274
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = []\n \nfor _ in range(N):\n A.append(int(input()))\n \n \nfor i in range(N):\n if A[i] >= a:\n b = a\n a = A[i]\n elif A[i] > b:\n b = A[i]\n \nfor i in range(N):\n if A[i] < a:\n print(a)\n else:\n print(b)', 'for _ in range(N):\n A.app...
['Runtime Error', 'Runtime Error', 'Accepted']
['s554210675', 's727840126', 's963595188']
[11052.0, 3064.0, 12512.0]
[354.0, 19.0, 548.0]
[267, 236, 277]
p02971
u259780304
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
["# -*- coding: utf-8 -*-\n\nimport math\n\nif __name__ == '__main__':\n N = int(input())\n A = []\n current_max = -1\n for i in range(N):\n A.append(int(input()))\n\n for i in range(N):\n b = [current_max] + A[i+1:]\n maxb = max(b)\n print(maxb)\n if maxb > current_max...
['Wrong Answer', 'Accepted']
['s117819666', 's486374795']
[17596.0, 14160.0]
[2104.0, 561.0]
[337, 354]
p02971
u259861571
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nlst = [int(input()) for _ in range(N)]\n\nmx = max(lst)\nlst = sorted(lst)\nmx2 = lst[-2]\n\nfor j in range(N):\n if mx != lst[j]:\n print(mx)\n else:\n print(mx2)\n', '# AtCoder\nN = int(input())\nA = [int(input()) for _ in range(N)]\n\nmx = max(A)\nsorted_A = sorted(A)\nmx2 = s...
['Wrong Answer', 'Accepted']
['s619072568', 's686976485']
[13380.0, 14152.0]
[545.0, 543.0]
[191, 203]
p02971
u260162297
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
["A = stdin.read().split('\\n')\nA.pop(len(A)-1)\nB = []\nfor i in range(0, int(A[0])):\n B = copy.copy(A)\n B.pop(0)\n B.pop(i)\n print(max(B))", 'import copy\nimport numpy as np\n\nN = int(input())\nA = np.array([input() for i in range(N)])\n\nB = np.array([])\nfor i in range(N):\n B = copy.copy(A)\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s050527717', 's136602494', 's024152410']
[2940.0, 2940.0, 13384.0]
[18.0, 17.0, 512.0]
[146, 185, 122]
p02971
u261700262
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = [int(input()) for _ in range(N)]\nset_A = sorted(set(A))\n\nfor i in A:\n if max(A) == i:\n print(i)\n else:\n print(set_A[-2])\n', 'N = int(input())\nA = [int(input()) for _ in range(N)]\nsort_A = sorted(A)\nmax_A = sort_A[-1]\n\nfor i in A:\n if max_A != i:\n prin...
['Wrong Answer', 'Accepted']
['s613307988', 's982693633']
[17168.0, 14132.0]
[2104.0, 554.0]
[162, 181]
p02971
u261891508
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['import copy\nn=int(input())\na=[int(input()) for i in range(n)]\nmaxa=max(a)\nmaxa2=sorted(set(nums))[-2]\nmaxs=a.count(maxa)\nfor i in range(n):\n if maxs==1:\n print(maxa if a[i]!=maxa else maxa2)\n else:\n print(maxa)', 'import copy\nn=int(input())\na=[int(input()) for i in range(n)]\nmaxa=max(a)\nif len(s...
['Runtime Error', 'Accepted']
['s245030463', 's934067264']
[11544.0, 19588.0]
[332.0, 527.0]
[218, 236]
p02971
u263226212
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['# -*- coding: utf-8 -*-\n\n# input\nN = int(input())\nA = list()\nfor _ in range(N):\n A.append(int(input()))\n\n# solve & output\nans = A\nans.sort()\nm = ans[-1]\nfor i in range(N):\n if A[i] != m:\n print(m)\n else:\n print(ans[N - 2])', '# -*- coding: utf-8 -*-\nimport copy\n\n# input\nN = ...
['Wrong Answer', 'Accepted']
['s135514406', 's752595863']
[12528.0, 14560.0]
[591.0, 570.0]
[245, 269]
p02971
u266569040
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = [int(input()) for i in range(N)]\nmax_num = max(A)\nresult = [max(A[i], max_num) for i in range(N)]\nfor i in range(N):\n print(result[i])', 'N = int(input())\nA = [int(input()) for i in range(N)]\n\nmax_num = max(A)\na = sorted(A)\nsecond = a[-2]\n\nfor i in range(N):\n if A[i] == max_num...
['Wrong Answer', 'Accepted']
['s026816346', 's865108091']
[14068.0, 14112.0]
[512.0, 588.0]
[158, 201]
p02971
u266874640
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = [int(input()) for i in range(N)]\nA_m = max(A)\nif A.count(max) >= 2:\n for i in range(N):\n print(A_m)\nelse:\n for i in range(N):\n if A[i] == A_m:\n del A[i]\n A_m_new = max(A)\n print(A_m_new)\n else:\n print(A_m)\n', "N ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s597393497', 's907165453', 's256703199']
[12520.0, 16380.0, 14992.0]
[2104.0, 401.0, 399.0]
[298, 253, 345]
p02971
u267300160
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['A = sorted([int(input()) for i in range(int(input()))])\nmax_A = max(A)\nfor i in A:\n if i == max_A:\n print(A[-2])\n else:\n print(max_A)', 'A = [int(input()) for i in range(int(input()))]\nfirst,second = sorted(A,reverse=True)[0],sorted(A,reverse=True)[1]\nfor i in A:\n if i == first:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s474252368', 's572317953', 's530001838']
[13384.0, 14656.0, 13380.0]
[564.0, 669.0, 517.0]
[153, 199, 170]
p02971
u268792407
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\na = [int(input()) for i in range(n)]\nfor i in range(n):\n b=a\n del b[i]\n print(max(b))', 'n=int(input())\na=[ int(input()) for i in range(n)]\n\nb=a\nb.sort()\nfor i in range(n):\n if a[i] != b[-1]:\n print(b[-1])\n else:\n print(b[-2])', 'n=int(input())\na=[ int(input()) for i in range(...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s778585517', 's924037697', 's835314595']
[11052.0, 12532.0, 14112.0]
[2104.0, 562.0, 556.0]
[103, 145, 145]
p02971
u273038590
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\nlis=list(int(input()) for _ in range(n))\nlis2=lis\nlis2=sorted(lis2)\nMAX=lis2[-1]\nsecond=lis2[-2]\nif lis.count(MAX) ==1:\n lis3=[MAX for _ in range(n)]\n lis3[lis.index(MAX)]=second\n print("YES")\n for i in range(n):\n print(lis3[i])\n \nelse:\n for _ in range(n):\n ...
['Wrong Answer', 'Accepted']
['s216356914', 's400977228']
[16148.0, 16148.0]
[581.0, 566.0]
[319, 302]
p02971
u273613346
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\ns = [int(input()) for i in range(N)]\nld = sorted(s, reverse=True)\nprint(ld)\nD = int(s.index(ld[0]))\n\nif N == 1:\n print(s[0])\nelse:\n for i in range(D):\n print(ld[0])\n print(ld[1])\n for i in range(N-D-1):\n print(ld[0])', 'N = int(input())\ns = [int(input()) for i ...
['Wrong Answer', 'Accepted']
['s031773516', 's331720748']
[17692.0, 14112.0]
[561.0, 530.0]
[259, 249]
p02971
u274080981
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['import math\nimport copy\n\n\nN=int(input())\nA=list(map(int,[input() for i in range(N)]))\n\n\nfor i in range(N):\n temp=copy.copy(A)\n temp.pop(i)\n print(sorted(temp)[0])', 'n = int(input())\nlist = [int(input()) for i in range(n)]\nlist2 = sorted(list)\nm1 = list2[-1]\nm2 = list2[-2]\n \nfor i in list:\n if...
['Wrong Answer', 'Accepted']
['s440378584', 's093711914']
[24236.0, 14196.0]
[2104.0, 574.0]
[165, 186]
p02971
u276204978
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = []\nfor _ in range(N):\n A.append(int(input()))\n\nA.sort(reverse=True)\n \nmax_ = A[0]\nmax__ = A[1]\n\nfor i in range(N):\n if A[i] == max_:\n print(max__)\n else:\n print(max_)', 'N = int(input())\nA = []\nfor _ in range(N):\n A.append(int(input()))\n\nB = sorted(A, reverse=True)\n...
['Wrong Answer', 'Accepted']
['s679121957', 's166250087']
[12528.0, 14112.0]
[612.0, 580.0]
[197, 204]
p02971
u278864208
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['import copy\nN = int(input())\nAs = []\nfor i in range(N):\n As.append(int(input()))\nfor j in range(N):\n instAs = copy.copy(As)\n instAs.pop(j)\n print(max(instAs))import copy\nN = int(input())\nAs = []\nfor i in range(N):\n As.append(int(input()))\nmaxA = max(As)\ninstA = copy.copy(As)\ninstA.remove...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s319582269', 's332907258', 's351588630', 's519362699', 's063561407']
[2940.0, 2940.0, 3064.0, 2940.0, 14560.0]
[18.0, 17.0, 17.0, 17.0, 539.0]
[418, 414, 414, 139, 244]
p02971
u280809964
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\n\na = [int(input()) for i in range(0, n)]\nl = []\n\nfor j in range(0, n):\n temp = a[j]\n a[j] = 0\n l.append(max(a))\n a[j] = temp\n\nprint(l)\n', 'n = int(input())\n\na = [int(input()) for i in range(0, n)]\n\nm = max(a)\nl = [m] * n\nindex = a.index(m)\na.remove(m)\nnm = max(a)\nl[in...
['Wrong Answer', 'Accepted']
['s010636036', 's621820358']
[11052.0, 14068.0]
[2108.0, 500.0]
[164, 177]
p02971
u282652245
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['\nN = int(input())\nA = list(map(int, input().split()))\n\n\n# MAXS = max(A)\n# two = S[-2]\n# print("MAX {} two {}".format(MAXS,two))\n# count = S.count(max(S))\n#\n\n# if A[i] == MAXS:\n# if count > 1:\n# print(MAXS)\n# else:\n# print(two)\n# else:\n# print(MA...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s243230037', 's408896607', 's629244210', 's755089591', 's792174150', 's987639043', 's304853706']
[3060.0, 2940.0, 3060.0, 3060.0, 3060.0, 3060.0, 15708.0]
[17.0, 18.0, 17.0, 17.0, 17.0, 17.0, 571.0]
[617, 122, 904, 176, 175, 177, 913]
p02971
u284363684
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['# input\nN = int(input())\nA = []\nappend = A.append\n\nfor i in range(N):\n append(int(input()))\n \nsum = sum(A)\nfor a in A:\n print(sum - a)\n', '# input\nN = int(input())\nA = []\nappend = A.append\n\nfor i in range(N):\n append(int(input()))\n\nsort_A = sorted(A, reverse=True)[:2]\n\n\nfor a in A:\n...
['Wrong Answer', 'Accepted']
['s615116847', 's991523692']
[13380.0, 13320.0]
[491.0, 571.0]
[144, 236]
p02971
u294385082
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\na = [int(input()) for i in range(n)]\n\nfor j in range(n):\n temp = a[j]\n a.remove(a[j])\n print(max(a))\n a.append(temp)', 'n = int(input())\nb = [int(input()) for i in range(n)]\na = sorted(b,reverse = True)\n\nfor i in range(n):\n if b[i] == a[0]:\n print(a[1])\n else:\n print(a[0])'...
['Wrong Answer', 'Accepted']
['s974127874', 's971276143']
[11052.0, 14112.0]
[2104.0, 550.0]
[137, 161]
p02971
u302292660
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\na =[]\nfor i in range(n):\n a.append(int(inpit())\nma = max(a)\nb = sorted(a)\nfor i in range(n):\n if a[i] != ma:\n print(ma)\n else:\n print(b[-2])\n \n \n', 'n = int(input())\na = [int(input()), for _ in range(n)]\n\nfor i in range(n):\n tmp = a\n tmp[i-1] = 0\n print(max(tmp))\n...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s229727655', 's815564323', 's818146338', 's315508083']
[3064.0, 2940.0, 14968.0, 14112.0]
[17.0, 17.0, 2104.0, 569.0]
[176, 127, 153, 185]
p02971
u303059352
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\na=list(map(int,input().split()))\nleft=[0]\nfor i in a:\n left.append(max(left[-1],i))\nright=[0]\nfor i in reversed(a):\n right.append(max(right[-1],i))\nright.reverse()\nfor i in range(n):\n print(max(left[i],right[i+1]))', 'n=int(input())\na=list(map(int,input().split()))\nleft=[0]\nfor i in a:\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s211897011', 's763956303', 's995793357']
[3064.0, 3060.0, 14108.0]
[17.0, 17.0, 518.0]
[232, 232, 173]
p02971
u303745819
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['A = list()\nB = [0] * 200000\n\nfor i in range(N):\n i = int(input())\n A.append(i)\n \nC = sorted(A,reverse=True)\n\nfor k in range(N):\n if max(A) != A[k]:\n print(C[0])\n else:\n B[k] = A[k]\n A[k] = 0\n print(max(A))\n A[k] = B[k]', 'N = int(input())\nA = list()\n\nfor i in range(N):\n i = in...
['Runtime Error', 'Accepted']
['s143330335', 's720064788']
[4596.0, 14112.0]
[20.0, 639.0]
[238, 187]
p02971
u306033313
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nlist = []\nfor i in range(n):\n list += [int(input())]\n\nmax = max(list)\nfor i in range(n):\n a = list[i]\n if a == max:\n del list[i]\n print(max(list))\n list.insert(i,a)\n else:\n print(max)', 'n = int(input())\nlist = []\nfor i in range(n):\n list += ...
['Runtime Error', 'Accepted']
['s318256513', 's473158691']
[12532.0, 12532.0]
[560.0, 577.0]
[240, 330]
p02971
u309120194
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = [int(input()) for _ in range(N)]\n\nA = sorted(A)\nprint(sum(A[1:])', 'N, D = map(int, input().split())\n \n\n\n\n\n \n\n\n \n\nprint((N+2*D) // (2*D+1))', 'N = int(input())\nA = [int(input()) for _ in range(N)]\n \n# M_list = index(max(A_1,...,A_N))\n# M = max(A)\n# sub_M = sub_max(A)\n\n\n\n\n...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s246518390', 's299478725', 's582225671', 's640417002', 's797096410', 's922569117', 's199186591']
[8892.0, 9120.0, 16988.0, 8852.0, 18984.0, 16960.0, 16864.0]
[25.0, 29.0, 252.0, 23.0, 287.0, 254.0, 371.0]
[85, 365, 443, 187, 87, 238, 229]
p02971
u311636831
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = []\nmaxNum=-1\nsecNum=-1\nmaxI=-1\nfor i in range(N):\n A.append(int(input()))\n if(maxNum<A[i]):\n secNum=maxNum\n maxNum=A[i]\n maxI=i\n elif(secNum<A[i]):\n secNum=A[i]\nfor i in (A):\n if(i!=maxI):\n print(maxNum)\n else:\n print(secNu...
['Wrong Answer', 'Accepted']
['s498635387', 's606137959']
[12532.0, 12532.0]
[525.0, 568.0]
[304, 315]
p02971
u317779196
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
["'''ABC134 C'''\nimport numpy as np\nn = int(input())\na = np.array([int(input()) for _ in range(n)])\na1n = a.argmax()\na_s = sorted(a)\na1 = a_s[-1]\na2 = a_s[-2]\nfor i in range(n):\n if i == a1n:\n print(a1)\n else:\n print(a2)", 'import numpy as np\nn = int(input())\na = np.array([int(input())...
['Wrong Answer', 'Accepted']
['s118182259', 's274426609']
[36988.0, 36656.0]
[608.0, 627.0]
[238, 223]
p02971
u318740143
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = list()\nfor i in range(N):\n A.append(int(input()))\nma = max(A)\nam = sorted(A,reverse = True)\nfor i in range(N):\n if ma != A[i]:\n print(ma)\n else:\n print(am[1])\nprint(am)\n ', 'N = int(input())\nA = list()\nfor i in range(N):\n A.append(int(input()))\nma = max(A)\nam = sorted(...
['Wrong Answer', 'Accepted']
['s540003892', 's638333040']
[19156.0, 14112.0]
[642.0, 610.0]
[201, 191]
p02971
u321043950
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
["from sys import stdin\n\ndef main():\n n = int(stdin.readline().rstrip())\n xs = [int(stdin.readline().rstrip()) for _ in range(n)]\n\n for i in range(n):\n print(max(xs[0:i]+xs[i+1:])\n\nif __name__ == '__main__':\n main()\n", "from sys import stdin\n\ndef main():\n n = int(stdin.readline().rst...
['Runtime Error', 'Accepted']
['s295835643', 's639329560']
[2940.0, 15708.0]
[17.0, 279.0]
[233, 355]
p02971
u321623101
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['port copy\nN=int(input())\nA=[]\nfor i in range(N):\n A.append(int(input()))\n\nx=max(A)\ncount=(A.count(x))\nindex=[]\nif count!=1:\n for i in range(N):\n print(x)\nelse:\n B=copy.copy(A)\n B.remove(x)\n y=max(B)\n for i in range(N):\n if A[i]==x:\n print(y)\n else:\n ...
['Runtime Error', 'Accepted']
['s669105992', 's169495913']
[2940.0, 14556.0]
[17.0, 526.0]
[317, 319]
p02971
u323045245
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nnum = [list(map(int, input())) for _ in range(n)]\nSort_num = sorted(num)\nfor i in range(n):\n if num[i] == Sort_num[i-1]:\n print(Sort_num[i-2]\n else:\n print(Sort_num[i-1])', 'from copy import deepcopy\nn=int(input())\na=[int(input()) for _ in range(n)]\nb = deepcopy(a)\nb.sort()\n\nfor ...
['Runtime Error', 'Accepted']
['s899037280', 's164571476']
[2940.0, 19100.0]
[17.0, 431.0]
[195, 195]
p02971
u325282913
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\narr = [0] * N\nfor i in range(N):\n arr[i] = int(input())\n\nsorted_list = sorted(arr)\nmax = sorted_list[N-1]\nsub_max = sorted_list[N-2]\nmax_count = arr.count(max)\nprint(max,sub_max,max_count)\n\nif max_count == 1:\n max_index = arr.index(max)\n for i in range(N):\n if i == max_i...
['Wrong Answer', 'Accepted']
['s524234296', 's645815209']
[16204.0, 14092.0]
[600.0, 613.0]
[423, 394]
p02971
u327162583
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = input()\nN = int(N)\nS = [int(input()) for _ in range(N)]\nS2 = sorted(S, reverse=True)\nonon = S2[0]\n\nfor i in range(N):\n if S[i] != onon:\n print(onon)\n else:\n print(S[1])', 'N = input()\nN = int(N)\nS = [int(input()) for _ in range(N)]\nS2 = sorted(S, reverse=True)\nonon = S2[0]\n\nfor...
['Wrong Answer', 'Accepted']
['s633699777', 's988248670']
[14108.0, 14112.0]
[551.0, 577.0]
[192, 193]
p02971
u327532412
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N, K = map(int, input().split())\n*H, = map(int, input().split())\nH.sort(reverse=True)\nif len(H) - K <= 0:\n print(0)\nelse:\n print(sum(H[K:]))', 'import sys\ninput = sys.stdin.readline\nN = int(input())\nA = [int(input()) for _ in range(N)]\nB = sorted(A)\nfor x in A:\n if x == B[-1]:\n print(B[-2...
['Runtime Error', 'Accepted']
['s510968214', 's042254648']
[3060.0, 14152.0]
[17.0, 310.0]
[146, 188]
p02971
u328694671
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N=int(input())\nA=[]\nmax1=0\nind1=0\nmax2=0\nind2=0\nfor i in range(N):\n\tA.append(int(input()))\n\tif max1 <= A[i]:\t\n\t\tmax2=max1\n\t\tind2=ind1\n\t\tmax1=A[i]\n\t\tind1=i\nfor i in range(N):\n\tif max1 == A[i]:\n\t\tprint(max2)\n\telse:\n\t\tprint(max1)\n\t', 'N=int(input())\nA=[]\nmax1=0\nmax2=0\nfor i in ran...
['Wrong Answer', 'Accepted']
['s758758841', 's868738931']
[12532.0, 12532.0]
[558.0, 561.0]
[228, 294]
p02971
u329143273
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = [int(input()) for _ in range(N)]\ns = A.index(max(A))\nx = max(A)\nA.sort()\ny = A[-2]\nans = []\nfor i in range(N):\n ans.append(x)\n \nans[s] = y\n\nprint(ans)', 'n=int(input())\na=[int(input()) for i in range(n)]\n\ns=max(a)\nt=a.index(s)\n\nfor i in range(n):\n if i==t:\n del a[t]\n ...
['Wrong Answer', 'Accepted']
['s400142443', 's432418894']
[17948.0, 12520.0]
[457.0, 474.0]
[173, 155]
p02971
u329399746
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = [int(input()) for _ in range(N)]\nA_s = sorted(A)[::-1]\nprint(A_s)\n\nfor i in A:\n if (A_s[0] == i) & (A_s[1] == i):\n print(A_s[0])\n elif (A_s[0] == i) & (A_s[0] != A_s[1]):\n print(A_s[1])\n else:\n print(A_s[0])\n', 'N = int(input())\nA = [int(input()) for _ i...
['Wrong Answer', 'Accepted']
['s621380360', 's495791071']
[17936.0, 14160.0]
[642.0, 590.0]
[259, 248]
p02971
u333404917
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nl = [int(input()) for _ in range(n)]\nl.sort(reverse=True)\nlmax = l[0]\nlsec = l[1]\n\nfor i in range(n):\n if l[i] == lmax:\n print(lsec)\n else:\n print(lmax)', 'n = int(input())\nl = [int(input()) for _ in range(n)]\n_l = l.copy()\n_l.sort(reverse=True)\nlmax = _l[0]\nlsec = ...
['Wrong Answer', 'Accepted']
['s105173320', 's688679284']
[12524.0, 14112.0]
[551.0, 561.0]
[189, 206]
p02971
u334928930
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nArr = [int(input()) for i in range(N)]\n\n\ndef funct(i, left_max, right_max):\n n = Arr[i]\n\n if n==right_max:\n if i ==N-1:\n right_max=0\n else:\n right_max = max(Arr[i+1:])\n\n print(max(left_max, right_max))\n\n if i == N-1:\n return\n\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s236949018', 's270565444', 's435223391', 's708016437']
[14608.0, 13416.0, 14716.0, 12588.0]
[2104.0, 2104.0, 2104.0, 556.0]
[523, 529, 520, 433]
p02971
u344030307
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['from heapq import nlargest\nn = int(input())\na = [int(input()) for i in range(n)]\nl1, l2 = nlargest(2, a)\n\nfor i in a:\n if a == l1:\n print(l2)\n else:\n print(l1)', 'from heapq import nlargest\nimport sys\nn = int(input())\na = [int(input()) for i in range(n)]\nl1, l2 = nlargest(2, a)\n\nif l1 == l2:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s257575873', 's746600253', 's043913154']
[17060.0, 17052.0, 16944.0]
[322.0, 330.0, 320.0]
[167, 240, 241]
p02971
u346194435
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N =int(input())\nA = [0]*N\na = 0\nb = 0\nfor i in range(N):\n x = int(input())\n if x > a:\n b = a\n a = x\n A[i] = x\n\nfor c in A:\n if c == a:\n print(b)\n else:\n print(a)', 'N =int(input())\nA = [0]*N\na = 0\nb = 0\nfor i in range(N):\n x = int(input())\n if x > ...
['Wrong Answer', 'Accepted']
['s760105733', 's067078218']
[12508.0, 12508.0]
[530.0, 505.0]
[204, 234]
p02971
u347600233
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
["n = int(input())\na = list(map(int, input().split()))\nsa = sorted(a)\nam, asl = sa[-1], sa[-2]\nprint(*[asl if ai == am else am for ai in a], sep='\\n')", 'n = int(input())\na = [int(input()) for i in range(n)]\nsa = a.sort()\nam, asl = a[-1], a[-2]\nfor i in range(n):\n print(asl if a[i] == am else am)', 'n = in...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s690335772', 's731502638', 's755827063', 's302445698']
[9180.0, 17648.0, 17460.0, 22168.0]
[21.0, 360.0, 279.0, 332.0]
[148, 146, 148, 149]
p02971
u348868667
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = [int(input()) for i in range(N)]\nmaxnum = max(A)\nfor i in range(N):\n if i == maxindex:\n tmp = A\n del tmp[tmp.index(max(tmp))]\n print(max(tmp))\n else:\n print(maxnum)', 'N = int(input())\nA = [int(input()) for i in range(N)]\nmaxa = max(A)\nfor i in range(...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s498354237', 's519420442', 's871371969', 's119814039']
[11052.0, 12532.0, 12512.0, 19204.0]
[331.0, 488.0, 2104.0, 489.0]
[219, 204, 226, 210]
p02971
u350093546
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\na=[int(input()) for i in range(n)]\nb=set(a)\nfor i in a:\n if i==b[-1]:\n print(b[-2])\n else:\n print(b[-1])', 'n=int(input())\na=[int(input()) for i in range(n)]\nb=list(set(a))\nif len(b)==1:\n for i in range(n):\n print(b[0])\nelif a.count(b[-1])>=2:\n for i in a:\n print(b[-1])\n...
['Runtime Error', 'Accepted']
['s208207613', 's130428270']
[17164.0, 17168.0]
[330.0, 484.0]
[127, 256]
p02971
u350578302
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N=int(input())\nA=[int(input()) for i in range(N)]\namax = max(A)\nB = A.copy()\nB.sort()\nprint(B)\n\nfor i in range(N):\n\tk = A.pop(0)\n if k == B[N]:\n print(B[N])\n\telse:\n\t print(amax)\n', 'N=int(input())\nA=[int(input()) for i in range(N)]\nB = A.copy()\nB.sort()\nprint(B)\n\nfor i in range(N):\n\tk...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s019641508', 's617314933', 's739497923', 's942356671', 's103500499']
[2940.0, 17692.0, 17692.0, 12512.0, 14108.0]
[18.0, 406.0, 472.0, 458.0, 570.0]
[187, 167, 179, 135, 190]
p02971
u352824706
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\nl=[]\nfor i in range(n):\n l.append(int(input()))\nm=max(l)\nfor i in range(n):\n if l[i] == m:\n a = l[i]\n l[i] = 0\n l[i] = a\n else:print(m)', 'n=int(input())\nl=[]\nfor i in range(n):\n l.append(int(input()))\nm=max(l)\na=l.index(m)\nfor i in range(n):\n if i==a:\n l[i]=0\n pr...
['Wrong Answer', 'Accepted']
['s434997343', 's831998727']
[12532.0, 12632.0]
[496.0, 507.0]
[162, 161]
p02971
u359747364
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['# Setup\nimport sys\nsys.setrecursionlimit(4100000)\nn = int(input())\na = [int(input()) for i in range(n)]\nheap = []\nfor i in range(n):\n heapq.heappush(heap,-a[i])\nfor i in range(n):\n temp = heapq.heappop(heap)\n if -a[i] == temp:\n temp2 = heapq.heappop(heap)\n print(-temp2)\n hea...
['Runtime Error', 'Accepted']
['s540986585', 's254588888']
[11052.0, 20640.0]
[339.0, 800.0]
[427, 440]
p02971
u361826811
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['import sys\nimport itertools\nimport numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN, *A = map(int, read().split())\nAnp = np.array(A)\n\nL = np.maximum.accumulate(Anp)\nR = np.maximum.accumulate(Anp[::-1])[::-1]\n\nLL = [0] + L.tolist()[:...
['Wrong Answer', 'Accepted']
['s015782364', 's459916226']
[48188.0, 43432.0]
[423.0, 375.0]
[409, 389]
p02971
u362563655
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = [int(input()) for i in range(N)]\nmax = max(A)\nif A.count(max) >=2:\n for i in range(N):\n print(max)\nelse:\n M = A.index(max)\n for i in range(M):\n print(max)\n print(max(A.remove(max)))\n for i in range(M+1,N):\n print(max)', 'N = int(input())\nA = [int(i...
['Runtime Error', 'Accepted']
['s537952925', 's611193026']
[12532.0, 12532.0]
[465.0, 478.0]
[274, 263]
p02971
u363599046
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\na = [int(input()) for i in range(n)]\n\n\n\n\nfor i in range(n):\n\ta[i] = 0\n\tprint(max(a))', 'n = int(input())\na = [int(input()) for i in range(n)]\nb = sorted(a, reverse = True)\n\na1 = b[0]\na2 = b[1]\n\n\n\nfor i in range(n):\n\tif a[i] == a1:\n\t\tprint(a2)\n\telse:\n\t\tprint(a1)']
['Wrong Answer', 'Accepted']
['s198884000', 's942718824']
[11052.0, 15812.0]
[2104.0, 553.0]
[101, 173]
p02971
u365858785
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['a=int(input())\nb=list(map(int, input().split()))\ncou,ju=0,0\nans=[]\nwhile cou<a:\n i=1\n su=0\n while i*(cou+1)<a:\n su+=b[i*(cou+1)]\n i+=1\n if su%2!=b[cou]:\n ans+=[cou+1]\n cou+=1\nif ans==[]:\n print("0")\nelse:\n s=""\n for i in ans:\n s+=str(i)+" "\n print(s)', 'a=int(input())\nb=[int(i...
['Runtime Error', 'Accepted']
['s937002051', 's617777207']
[3188.0, 14264.0]
[19.0, 554.0]
[271, 218]
p02971
u366185462
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nal = []\nfor i in range(n):\n a = int(input())\n al.append(a)\nmal = max(al)\nfor i in range(n):\n if al[i] != mal:\n print(al[i])\n else:\n print(mal)', 'n = int(input())\nal = []\nfor i in range(n):\n a = int(input())\n al.append(a)\nmal = sorted(al, reverse=True)\nfor i in range(n):\n...
['Wrong Answer', 'Accepted']
['s837505842', 's236477945']
[12512.0, 14108.0]
[541.0, 579.0]
[169, 193]
p02971
u367130284
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n,*a=map(int,open(0))\nm=max(a)\n\nif a.count(m)>1:\n for i in range(n):\n print(m)\nelse:\n s=sorted(set(a))[::-1][1]\n for i in a:\n if i==m:\n print(m)\n else:\n print(s)', 'n,*a=map(int,open(0))\nm=max(a)\n\nif a.count(m)>1:\n for i in range(n):\n prin...
['Wrong Answer', 'Accepted']
['s221111527', 's576873073']
[17164.0, 17164.0]
[228.0, 253.0]
[213, 213]
p02971
u368579103
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\na = [int(input()) for i in range(n)]\n\nfor i in range(n):\n if i == 0:\n ans = max(a[1:n])\n elif i == n-1:\n ans = max(a[0:n-1])\n else:\n ans = max(a[0:i],a[i+1:n])\n print(ans)', 'n = int(input())\na = [int(input()) for i in range(n)]\n\nsot = sorted(a,reverse = True)\nans1 = sot[0]...
['Runtime Error', 'Accepted']
['s002144390', 's640501909']
[149780.0, 14112.0]
[2104.0, 557.0]
[201, 183]
p02971
u372102441
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['import copy\n\nN = int(input())\nA = []\nfor i in range(N):\n A.append(int(input()))\n\nchinpo = max(A)\nB = copy.copy(A)\nB.remove(max(A))\nchinchin = max(B)\n\nfor i in range(N):\n if i == A.index("max(A)"):\n print(chinpo)\n else:\n print(chinchin)\n\n', 'import copy\n\nN = int(input())\nA =...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s074201129', 's904066446', 's917803422', 's607916396']
[13080.0, 14560.0, 14560.0, 14560.0]
[367.0, 556.0, 532.0, 519.0]
[260, 276, 277, 275]
p02971
u373047809
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['_, *a = map(int, open(0).read().split())\ns = sorted(a)\nfor i in a:\n print(s[(i < b[-1])-2])', '_, *a = map(int, open(0).read().split())\ns = sorted(a)\nfor i in a:\n print(s[(i < s[-1])-2])']
['Runtime Error', 'Accepted']
['s360097481', 's992836037']
[25036.0, 25036.0]
[145.0, 300.0]
[94, 94]
p02971
u373481069
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nl = []\ny = []\nfor i in range(n):\n a = int(input())\n l.append(a)\nfor i in range(n):\n x = l[i]\n print(max(l.remove(x))', 'n = int(input())\nl = []\nfor i in range(n):\n a = int(input())\n l.append(a)\nx = max(l)\ni = l.index(x)\n\nl.sort()\nfor b in range(n):\n if i != b:\n print(x)\n...
['Runtime Error', 'Accepted']
['s725005462', 's867505092']
[2940.0, 12512.0]
[17.0, 575.0]
[137, 182]
p02971
u375500286
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\nl=[]\nfor i in range(n):\n l.append(int(input()))\na=l.sorted(reverse=True)\nfor v in l:\n if v==a[0]:\n print(a[1])\n else:\n print(a[0])', 'n=int(input())\nl=[]\nfor i in range(n):\n l.append(int(input()))\na=l.sorted(reverse=True)\nfor v in l:\n if v==a[0]:\n pri...
['Runtime Error', 'Runtime Error', 'Accepted']
['s303117515', 's762862833', 's309454764']
[11052.0, 11052.0, 14112.0]
[363.0, 344.0, 553.0]
[168, 169, 152]
p02971
u375695365
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['a=int(input())\nb=[int(input()) for i in range(a)] \nfor i in range(len(b)-1):\n c=b\n c[i]=0\n c.sort\n print (c[len(c)-1])\n', 'a=int(input())\nb=[int(input()) for i in range(a)]\nm=max(b) \n\nif b.count(m)>=2:\n for i in range(a):\n print (m)\nelse:\n b.sort(reverce=True)\n m2=b[1]\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s072606566', 's938932357', 's393945714']
[11284.0, 12512.0, 18796.0]
[530.0, 490.0, 359.0]
[131, 277, 316]
p02971
u376328830
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nsuretsu0 = []\n\nbiggest_num = 0\nsecondly_biggest_num=0\nfor i in range(n):\n a = int(input())\n suretsu0.append(a)\n\nsuretsu = [x for x in suretsu0]\nsuretsu.sort()\n\n\nbiggest_num = suretsu[-1]\nsecondly_biggest_num=suretsu[-2]\n\nprint(secondly_biggest_num,biggest_num)\n\n\nfor ele in su...
['Wrong Answer', 'Accepted']
['s068937280', 's996012052']
[14192.0, 14120.0]
[562.0, 593.0]
[408, 369]
p02971
u376754170
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['# -*- coding: utf-8 -*-\n\na = int(input())\n\nfor i in range(a):\n nums[i] = int(input())\n\nfor j in range(a):\n thisnums = nums\n thisnums[j] = 0\n print(max(thisnums))', '# -*- coding: utf-8 -*-\n\nimport copy\n\na = int(input())\nnums = [0]*a\n\nfor i in range(a):\n nums[i] = int(input())\n \nmaxnum = ...
['Runtime Error', 'Accepted']
['s578276663', 's412081390']
[3060.0, 20960.0]
[17.0, 662.0]
[182, 513]
p02971
u381518904
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nnumList = [input() for i in range(n)]\nmaxVal = max(numList)\nworkList = numList[:]\nsecondVal = max(workList.remove(maxVal))\nfor num in numList:\n if num != maxVal:\n print(maxVal)\n else\n print(secondVal)', "import sys\ninput = sys.stdin.readline\n \ndef main():\n n = int(input())\n n...
['Runtime Error', 'Accepted']
['s429201923', 's892755579']
[2940.0, 14080.0]
[17.0, 242.0]
[226, 360]
p02971
u389523677
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
["N = int(input())\nA = list(int(input()) for k in range(N))\n\nmx, mxn = sorted(A, reverse=True)[:2]\n\nresult = [mxn if x==mn else mx for x in A]\nprint('\\n'.join(map(str, result)))", "N = int(input())\nA = list(int(input()) for k in range(N))\n\nmx, mxn = sorted(A, reverse=True)[:2]\n\nresult = [mxn if x==mx else m...
['Runtime Error', 'Accepted']
['s755922436', 's232025492']
[13328.0, 26508.0]
[396.0, 475.0]
[175, 175]
p02971
u389910364
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['import bisect\nimport heapq\nimport itertools\nimport math\nimport os\nimport re\nimport string\nimport sys\nfrom collections import Counter, deque, defaultdict\nfrom copy import deepcopy\nfrom decimal import Decimal\nfrom fractions import gcd\nfrom functools import lru_cache, reduce\nfrom operator import itemgetter\...
['Time Limit Exceeded', 'Accepted']
['s166554446', 's489181748']
[28732.0, 16748.0]
[2109.0, 510.0]
[812, 511]
p02971
u391340825
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['\nimport math\n\n\n\n\ndef main():\n n = int(input())\n lista = []\n for i in range(0, n):\n lista.append(int(input()))\n print(lista)\n maxim1 = -999999\n maxim2 = -9999999\n for element in lista:\n if element > maxim1:\n maxim2 = maxim1\n maxim1 = element\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s093218487', 's896233706', 's059822433']
[15764.0, 15764.0, 12640.0]
[479.0, 499.0, 444.0]
[546, 546, 530]
p02971
u392938961
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nA = [int(input()) for _ in range(n)]\nB = sorted(A)\nB_M = max(B)\nB_M_1 = max(B[:n-1])\nfor i in range(n):\n if B[i] == B_M:\n print(B_M_1)\n else:\n print(B_M)', 'n = int(input())\nA = [int(input()) for _ in range(n)]\nB = sorted(A)\nB_M = max(B)\nB_M_1 = max(B[:n-1])\nfor i in ...
['Wrong Answer', 'Accepted']
['s418230672', 's666849226']
[14140.0, 14136.0]
[565.0, 581.0]
[189, 189]
p02971
u396391104
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\na = [int(input()) for i in range(N)]\n\nfor j in a:\n if j >= max(a):\n print(sorted(a)[-2])\n else:\n print(max(a))', 'n = int(input())\na = [int(input()) for i in range(n)]\nb = a[:]\nb.sort()\n\nif b[n-1] == b[n-2]:\n for _ in range(n): \n print(b[n-1])\nelse:\n f...
['Runtime Error', 'Accepted']
['s468100266', 's943226410']
[3060.0, 14112.0]
[17.0, 555.0]
[147, 251]
p02971
u396890425
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N=int(input())\nNumbers=sorted([int(input()) for i in range(N)])\nAmax=Numbers[-1]\nAsecond=Numbers[-2]\nfor j in Numbers:\n if j != Amax:\n print(Amax)\n else:\n print(Asecond)', 'N=int(input())\nNumbers=[int(input()) for i in range(N)]\nNumbers2=sorted(Numbers)\nAmax=Numb...
['Wrong Answer', 'Accepted']
['s194407913', 's084552119']
[13404.0, 14112.0]
[586.0, 580.0]
[213, 232]
p02971
u405660020
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\na=[int(input()) for _ in range(n)]\n\nm1=max(a)\nm2=max(a[a.index(max(a)):]+a[:a.index(max(a))+1])\nfor i in range(n):\n if a[i]==m1:\n print(m2)\n else:\n print(m1)\n', 'n=int(input())\na=[int(input()) for _ in range(n)]\n\na_s=sorted(a)\nm1=a_s[-1]\nm2=a_s[-2]\n\nfor i in range(n...
['Wrong Answer', 'Accepted']
['s422913442', 's303166116']
[14124.0, 14112.0]
[514.0, 552.0]
[193, 170]
p02971
u407891541
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['import numpy as np\n\nN=int(input())\n\nX=[]\nfor x in range(N):\n X.append(int(input()))\n\nY=[]\nY=np.sort(X)[::-1]\n\nfor i in range(N):\n ans=s[0]\n if ans==X[i]:\n ans=s[1]\n print(ans)\n', 'import numpy as np\n\nN=int(input())\n\nX=[]\nfor x in range(N):\n X.append(int(input()))\n\nY=[]\nY...
['Runtime Error', 'Accepted']
['s970321583', 's785302205']
[23388.0, 24256.0]
[504.0, 1657.0]
[195, 194]
p02971
u408262366
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nhoge = input().split()\nA = []\nfor i in range(N):\n A.append(hoge[i])\n\nmax_itr = [i for i, v in enumerate(A) if v == max(A)]\nmax_number = max(A)\nfor i in range(N):\n if i not in max_itr:\n print(max_number)\n else:\n print(sorted(A)[-2])', 'import numpy as np\nN = int(input())\nA = []\...
['Runtime Error', 'Accepted']
['s557454492', 's643711788']
[3064.0, 24876.0]
[17.0, 978.0]
[257, 345]
p02971
u410118019
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['from collections import defaultdict\nd = defaultdict(int)\nn, *a = map(int,open(0))\nfor i in a:\n d[i] += 1\nl = list(d.key())\nl.sort()\nm = l[-1]\nif d[m] == 1:\n i = a.index(m)\n [print(m) for j in range(i)]\n print(l[-2])\n [print(m) for j in range(n-i-1)]\nelse:\n [print(m) for i in range(n)]', 'from coll...
['Runtime Error', 'Accepted']
['s850311016', 's990951720']
[20584.0, 20816.0]
[125.0, 263.0]
[291, 292]
p02971
u413165887
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\n\nfor i in range(n):\n a.append(int(input()))\n\nfor i in range(n):\n if i == 1:\n result = a[2:]\n print(max(result))\n elif i == n-1:\n result = a[:n-1]\n print(max(result))\n else:\n result = a[:i] + a[i+1:]\n print(max(result))', '\nn = int(i...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s176378149', 's532067475', 's687454512', 's182112435']
[3064.0, 148148.0, 17664.0, 13340.0]
[17.0, 2104.0, 2105.0, 554.0]
[289, 222, 297, 213]
p02971
u422673384
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nan = []\nmax_1 = 1\nmax_2 = 1\ncount = 1\nfor i in range(n):\n a = int(input())\n if a > max_1:\n tmp = max_1\n max_1 = a\n count = 1\n max1_index = [i]\n max_2 = tmp\n elif a == max_1:\n count += 1\n max1_index.append(i)\n elif max_1 > a...
['Runtime Error', 'Runtime Error', 'Accepted']
['s072248696', 's843608229', 's079584347']
[20436.0, 20460.0, 20436.0]
[572.0, 590.0, 581.0]
[531, 524, 543]
p02971
u424240341
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\na=[int(input()) for i in range(n)]\nt=list(enumerate(a))\nt.sort(key=lambda x:x[1])\nprint(t)\nmx=t[-1][1]\nans=[mx for i in a]\nans[t[-1][0]]=t[-2][1]\nfor k in ans:\n print(k)', 'n=int(input())\na=[int(input()) for i in range(n)]\nt=list(enumerate(a))\nt.sort(key=lambda x:x[1])\n\nmx=t[-1][1]\nan...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s276351647', 's928545261', 's145406303']
[43176.0, 37796.0, 34732.0]
[695.0, 485.0, 601.0]
[187, 163, 178]
p02971
u426996264
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\n\n\nlist = []\nfor i in range(n):\n list.append(int(input()))\n\n\nnew_list = sorted(list,reverse=True)\nprint(new_list)\n\n\nfor c in range(n):\n if new_list[0] == list[c]:\n print(new_list[1])\n else:\n print(new_list[0])', 'n = int(input())\n\n\nlist = []\nfor i in range(n)...
['Wrong Answer', 'Accepted']
['s824981005', 's795497126']
[17692.0, 14112.0]
[600.0, 581.0]
[317, 302]
p02971
u427473886
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nnums = [input() for i in range(N)]\n\nmax_list = []\n\nfor i in range(0, N):\n f_nums = nums[:i-1]\n l_nums = nums[i+1:]\n f_nums.extend(l_nums)\n _max = max(f_nums)\n max_list.append(_max)\n\nfor x in max_list:\n print(x)\n \n\n\n', 'N = int(input())\nnums = [int(input()) for i...
['Runtime Error', 'Accepted']
['s699600711', 's853887964']
[22340.0, 14112.0]
[2105.0, 544.0]
[253, 221]
p02971
u431484963
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\na = [int(input()) for i in range(n)]\nmaxi = max(a)\nfor i in range(n):\n if a[i] != maxi:\n print(maxi)\n else:\n b = a.pop(a[i])\n print(max(a))\n', 'n = int(input())\na = [int(input()) for i in range(n)]\nmaxi = max(a)\ns = sorted(a,reverse=True)\n\nfor i in range(n):\n...
['Runtime Error', 'Accepted']
['s556962228', 's612706745']
[12520.0, 14108.0]
[2104.0, 553.0]
[184, 186]
p02971
u431981421
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nli = []\nmax1 = 0\nmax2 = 0\nfor i in range(N):\n s = int(input())\n li.append(s)\n \n if s > max1:\n max1 = s\n \n if max1 >= s > max2:\n max2 = s\n\nfor index, i in enumerate(li):\n if max1 == li[index]:\n print(max2)\n else:\n print(max1)', 'N = int(input())\nli = []\nfor i ...
['Wrong Answer', 'Accepted']
['s013745638', 's122953177']
[12532.0, 14112.0]
[574.0, 602.0]
[263, 220]
p02971
u434872492
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = [0] * N\nfor i in range(N):\n A[i] = int(input())\nX = [0] * N\ncount = 0\nmax = 0\nfor i in range(N):\n for j in range(N):\n if j != i:\n if max < A[j]:\n max = A[j]\n X[i] = max\nfor i in range(N):\n print(X[i])', 'import math\nimport heapq\nimport ...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s052067576', 's070286371', 's983165072', 's800540678']
[12532.0, 16116.0, 16116.0, 14524.0]
[2105.0, 367.0, 358.0, 576.0]
[266, 221, 239, 578]
p02971
u436887866
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['import numpy as np\nimport math\n\nN = int(input())\n\nA = np.empty(N)\nfor i in range(N):\n A[i] = int(input())\n\n\nmax_a = np.max(A)\nmax_i = np.argmax(A)\n\nfor i in range(N):\n if(i == max_i):\n max_n0 = np.max(A[0:i-1])\n max_n1 = np.max(A[i+1,N-1])\n if(max_n0 > max_n1):\n print(max_...
['Runtime Error', 'Runtime Error', 'Accepted']
['s052973539', 's676687005', 's627348375']
[21380.0, 2940.0, 21516.0]
[1198.0, 17.0, 944.0]
[367, 366, 267]
p02971
u439392790
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\na=[int(input()) for _ in range(n)]\nnew_a=sorted(a)\nmax=new_a[0]\nmax2=new_a[1]\nfor i in a:\n if(i==max):\n print(max2)\n else:\n print(max)\n', 'n=int(input())\na=list()\nfor i in range (n):\n a.append(int(input()))\nnew_a=sorted(a)\nmax=new_a[0]\nmax2=new_a[1]\nfor i in a:\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s221740431', 's422308020', 's547051542']
[14112.0, 14112.0, 14112.0]
[504.0, 545.0, 584.0]
[170, 191, 228]
p02971
u444082822
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input())\nA = [int(input()) for i in range(N)]\nB = sorted(A,reverse=True)\nif B[0] = B[1]:\n for i in range(N):\n print(B[0])\nelse:\n for i in range(N):\n if A[i] = B[0]:\n print(B[1])\n else:\n print(B[0])', 'N = int(input())\nA = [int(input()) for i in rang...
['Runtime Error', 'Accepted']
['s040014628', 's673734862']
[2940.0, 14088.0]
[18.0, 563.0]
[254, 256]
p02971
u451324929
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['a = int(input()) \nb = [int(input()) for i in range(n)] \nfor i in range(a):\n c=pop(b.i-1)\n print(max(c))', 'a = int(input()) \nb = [int(input()) for i in range(n)] \nfor i in range(a):\n d=b[i-1]\n c=pop(b.i-1)\n print(max(c))\n b.insert(i-1.d)', 'a = int(input()) \nb = [int(input()) for i in range(n)] \nfor...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s019179478', 's196198850', 's292286606', 's370197271', 's432053957', 's678549703', 's169709986']
[3060.0, 2940.0, 3060.0, 12532.0, 2940.0, 13076.0, 14636.0]
[17.0, 18.0, 18.0, 523.0, 17.0, 2104.0, 657.0]
[105, 134, 126, 134, 176, 139, 158]
p02971
u456579619
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N=int(input())\nA=[]\nfor i in range(N):\n A.append(int(input()))\ns=sorted(A)\nfor i in range(N):\n if A[i]!=s[0]:\n print(s[0])\n else:\n print(s[1])', 'N=int(input())\nA=[]\nfor i in range(N):\n A.append(int(input()))\ns=sorted(A,reverse=True)\nfor i in range(N):\n if A[i]!=s[0]:\n print(s[0])\n els...
['Wrong Answer', 'Accepted']
['s775775457', 's566085278']
[19168.0, 19092.0]
[375.0, 391.0]
[151, 164]
p02971
u459590249
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\na = [input() for _ in range(n)]\nb=a.copy()\nb.sort()\nbset=list(set(b))\nc=[0]*(n)\n\nfor i in range(n):\n\tif a[i]==bset[-1]:\n\t\tc[i]=b[-1]\n\telse:\n\t\tc[i]=b[-2]\nfor i in range(n):\n\tprint(c[i])', 'n=int(input())\na = [int(input()) for _ in range(n)]\nb=sorted(a)\nc=[0]*n\n\nfor i in range(n)...
['Wrong Answer', 'Accepted']
['s698760457', 's487740927']
[24012.0, 15660.0]
[561.0, 606.0]
[199, 173]
p02971
u460386402
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n=int(input())\na=[]\nfor i in range(n):\n b=int(input())\n a.append(b)\ns=a.copy()\nfor i in range(n):\n if s[i]==max(s):\n print(s[i])\n else:\n del s[i]\n print(max(s))', 'n=int(input())\na=[]\nfor i in range(n):\n b=int(input())\n a.append(b)\ns=a.copy()\na=sorted(a,reverse=True)\n\nif a[0]==a[1]:\...
['Runtime Error', 'Accepted']
['s270001976', 's407497357']
[12588.0, 14876.0]
[2104.0, 585.0]
[173, 243]
p02971
u464627439
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N = int(input()) \ns = []\ns = [input() for i in range(N)] \n\nmax_num = max(s)\nmax_ind = s.index(mux_num)\ns.remove(max_num)\nmax2_num = max(s)\n \nfor i in range(N):\n if i == max_ind:\n print(max2_num)\n else:\n print(max_num)', 'N = int(input()) \ns = []\ns = [int(input()) for i in range(N)] ...
['Runtime Error', 'Accepted']
['s762641295', 's522040889']
[15768.0, 12520.0]
[252.0, 474.0]
[301, 306]
p02971
u465101448
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['N=int(input())\nL=[]\nfor i in range(N):\n L.append(int(input()))\n\nL_max=max(L)\n\nL_max_count=0\nfor l in L:\n if l==L_max:\n L_max_count+=1\n if L_max_count > 1:\n break\n\nfor i in range(N):\n now=L[i]\n \n if L_max_count > 1:\n ans=L_max\n \n elif now!=L_max:\n ...
['Wrong Answer', 'Accepted']
['s682171911', 's996181286']
[15456.0, 14068.0]
[671.0, 584.0]
[446, 426]
p02971
u469063372
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nl = [int(input()) for i in range(n)]\nl.sort(reverse=True)\nm1 = l[0]\nm2 = l[1]\nfor i in l:\n if i == m1:\n print(m2)\n else:\n print(m1)', 'n = int(input())\nl = [int(input()) for i in range(n)]\nla = sorted(l, reverse=True)\nprint(l)\nm1 = la[0]\nm2 = la[1]\nfor i in l:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s130845645', 's970279984', 's760113868']
[12512.0, 17692.0, 14112.0]
[530.0, 552.0, 524.0]
[168, 187, 178]
p02971
u470477785
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\n\narr = []\nfor i in range(n):\n\ttemp = int(input())\n\tarr.append(temp)\n\nmax_element = max(arr)\nsecond_max = -12123122\n\nfor i in arr:\n\tif i > second_max and i <= max_element:\n\t\tsecond_max = i\n\nfor i in arr:\n\tif i != max_element:\n\t\tprint(max_element)\n\telse:\n\t\tprint(second_max...
['Wrong Answer', 'Accepted']
['s350858508', 's354636357']
[12532.0, 14112.0]
[501.0, 547.0]
[290, 234]
p02971
u472696272
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\na = [int(input()) for _ in range(n)]\na1 = sorted(a)\nif a1[n-1]==a1[n-2]:\n flag = True ## true = have repeat\n maxone = a1[n-1]\nelse:\n flag = False \n maxone = a1[n-1]\n maxtwo = a1[n-2]\nfor i in range(n):\n if a[i]==1max and flag==True: print(maxone)\n elif a[i]==1max and flag==False: p...
['Runtime Error', 'Runtime Error', 'Accepted']
['s666235059', 's708230726', 's588739492']
[2940.0, 2940.0, 14112.0]
[17.0, 17.0, 583.0]
[372, 360, 378]
p02971
u477901663
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input()) \ns = [int(input() for i in range(n))] \n\nfor i in range (n):\n a = s.pop(0)\n ans = max(s)\n print(ans)\n s.append(a)', 'n = int(input()) \ns = [input() for i in range(n)] \n\nfor i in range (n):\n a = s.pop(i-1)\n ans = max(s)\n print(ans)\n s.append(a)', 'n = int(input()) ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s077301664', 's696544700', 's252360343']
[3060.0, 15788.0, 25332.0]
[18.0, 2104.0, 438.0]
[205, 202, 415]
p02971
u483873684
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['l=[]\nt=int(input())\nb=0\nc=0\nfor i in range(t):\n a=int(input())\n if(a>b):\n b=a\n else if(b>a and a>c):\n c=a\n l.append(a)\nfor i in range(0,t):\n if(l[i]!=b):\n print(b)\n else:\n print(c)\n', 'l=[]\nt=int(input())\nb=0\nc=0\nfor i in range(t):\n a=int(input...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s004965408', 's164166103', 's623023926', 's405459533']
[2940.0, 2940.0, 12520.0, 12520.0]
[18.0, 17.0, 511.0, 509.0]
[231, 226, 203, 203]
p02971
u488401358
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
["def main():\n N=int(input())\n A=[0 for i in range(0,N)]\n for i in range(0,N):\n A[i]=int(input())\n L=[0 for i in range(0,N)]\n R=[0 for i in range(0,N)]\n L[0]=A[0]\n R[0]=A[N-1]\n for i in range(0,N-1):\n L[i+1]=max(A[i+1],L[i])\n R[i+1]=max(A[N-i-2],R[i])\n print(L...
['Wrong Answer', 'Accepted']
['s857612740', 's491286140']
[21872.0, 14072.0]
[686.0, 483.0]
[515, 533]
p02971
u488934106
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
["def exception_handling(n, ali):\n\n ali.sort(reverse=True)\n\n alimax = ali[0]\n alimax2 = ali[1]\n\n ans = []\n\n for i in ali:\n if i != alimax:\n ans.append(alimax)\n else:\n ans.append(alimax2)\n\n return ans\n\ndef main():\n n = int(input())\n ali = [in...
['Wrong Answer', 'Accepted']
['s157528872', 's872562089']
[14624.0, 15264.0]
[501.0, 510.0]
[438, 491]
p02971
u489762173
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['import sys\n\ndef main():\n N = int(input())\n A = [int(input()) for i in range(N)]\n\n print(A)\n\n for j in range(N):\n if j == 0:\n print(max(A[1:]))\n\n elif j == N-1:\n print(max(A[:N-1]))\n\n else:\n print(max(max(A[:j]), max(A[j+1:])))\n\n\nmain...
['Wrong Answer', 'Accepted']
['s325207705', 's752766881']
[15636.0, 14104.0]
[2104.0, 301.0]
[301, 256]
p02971
u490084374
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['n = int(input())\nli = [int(input()) for _ in range(n)]\n\nmi = li.index(max(li))\nm = max(li)\n\nfor a, b in enumerate(li):\n if a != mi:\n print(m)\n else:\n print(max(l[a+1:]+l[:a]))', 'n = int(input())\nli = [int(input()) for _ in range(n)]\n\nmi = li.index(max(li))\nm = max(li)\n\nfor a, b in enumerate(l...
['Runtime Error', 'Accepted']
['s381907829', 's038924034']
[12512.0, 15604.0]
[454.0, 489.0]
[183, 185]
p02971
u490489966
2,000
1,048,576
You are given a sequence of length N: A_1, A_2, ..., A_N. For each integer i between 1 and N (inclusive), answer the following question: * Find the maximum value among the N-1 elements other than A_i in the sequence.
['#B\n# import math\n# n, d = map(int, input().split())\n\n\n#C\nfrom collections import Counter\nn = int(input())\na = [0]*n\nfor i in range(n):\n a[i] = int(input())\nfirst = sorted(set(a))[-1]\nif sorted(set(a))[0] == sorted(set(a))[-1]:\n pass\nelse:\n second = sorted(set(a))[-2]\nfor i in a:\n if i == ...
['Wrong Answer', 'Accepted']
['s100567547', 's195968416']
[19476.0, 14480.0]
[565.0, 557.0]
[389, 232]