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
u492447501
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\nS = input()\nN = int(S)\n\nA = np.zeros([N])\nA_temp = np.zeros([N])\n\nfor i in range(N):\n A[i] = int(input())\n\nmax = 0\n\nfor i in range(N):\n A_temp = A\n A_temp[i] = 0\n for j in range(N):\n max_temp = A_temp[j]\n if max_temp > max:\n max = max_temp\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s128524507', 's245433670', 's451440734', 's562558588', 's681915787', 's892897065', 's905654249', 's910412647', 's051609405']
[13948.0, 19256.0, 19032.0, 19132.0, 19124.0, 18496.0, 17108.0, 19256.0, 18872.0]
[2108.0, 2109.0, 1031.0, 2109.0, 2109.0, 2109.0, 557.0, 2109.0, 789.0]
[312, 371, 378, 370, 250, 262, 326, 250, 376]
p02971
u496619173
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(input())\n\nB = sorted(A, reverse=True)\nmax_first = B[0]\nmax_second = B[1]\n\nfor i in range(N):\n\tanswer = max_first\n if A[i] == max_first:\n answer = max_second\n print(answer)\n', 'N = int(input())\nA = []\nfor i in range(N):\n\tA.append(i...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s416593649', 's817552475', 's920305576', 's958597226']
[2940.0, 2940.0, 15788.0, 14688.0]
[17.0, 17.0, 273.0, 518.0]
[241, 300, 318, 255]
p02971
u497047499
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())\n\nfor i in range(n):\n for j in range(n):\n b = [0] * n\n if j != i:\n continue\n b[j] = a[j]\n print(max(b))', 'n = int(input())\na = [0] * n\nfor i in range(n):\n a[i] = int(input())\n\nasort = sorted(a,reverse=True)\nfor i i...
['Wrong Answer', 'Accepted']
['s716934214', 's820636926']
[16060.0, 14076.0]
[2104.0, 579.0]
[188, 191]
p02971
u503111914
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)\nmax1 = B[0]\nmax2 = B[1]\n \nfor i in range(N):\n if A[i] == max1:\n print(max1)\n else:\n print(max2)', 'N = int(input())\nA = [int(input()) for i in range(N)]\nB = sorted(A,reverse=True)\nmax1 = B[0]\nmax2 = B[1]...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s292242531', 's568286473', 's787564889', 's625687049']
[14108.0, 13320.0, 14112.0, 14128.0]
[579.0, 385.0, 566.0, 562.0]
[196, 204, 204, 194]
p02971
u505830998
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\n#+++++\n\t\t\ndef main():\n\tn = int(input())\n\tll=[int(input()) for _ in range(n)]\n\t\n\tmm = ll.sort()\n\tma=mm[-1]\n\tmb=mm[-2]\n\t\n\tfor i in ll:\n\t\tpp = ma if i != ma else mb:\n\t\tprint(pp)\n\t\t\n\t\n\t\n\t\n#+++++\n\nif __name__ == "__main__":\n\tif sys.platform ==\'ios\':\n\t\tsys.stdin=op...
['Runtime Error', 'Accepted']
['s650933047', 's171586504']
[2940.0, 14112.0]
[18.0, 294.0]
[378, 390]
p02971
u506858457
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=sorted(list(map(int,input().split())))\nM=A[0]\nfor i in range(N):\n if i==M:\n print(A[1])\n else:\n print(M)\n \n ', 'import copy\nN=int(input())\nA=[int(input()) for i in range(N)]\nB = copy.deepcopy(A)\nB.sort(reverse=True)\nfor i in range(N):\n if A[i]==B[0]:\n print(B[1])\n els...
['Runtime Error', 'Accepted']
['s392037926', 's504671273']
[4540.0, 14584.0]
[162.0, 696.0]
[136, 179]
p02971
u509405951
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, reverse=True)\n\nfor i in range(N):\n if A[i] <= B[0]:\n print(B[0])\n else:\n print(B[1])', 'N = int(input())\nA = [int(input()) for _ in range(N)]\nB = sorted(A, reverse=True)\n\nfor i in range(N):\n if A[i] < B[0]:\n ...
['Runtime Error', 'Accepted']
['s932717988', 's862855263']
[3060.0, 14112.0]
[17.0, 574.0]
[170, 171]
p02971
u509739538
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.
['data = []\ni = int(input())\n\ndata = [int(input()) for _n in range(i)]\nmaxInt = max(data)\nfor n in range(i):\n\tprint([maxInt,data[n]])', 'data = []\nres = []\n\ndata = [int(input()) for _n in range(int(input()))]\n\nfor n in range(i):\n\tres.append(max(data[0:n]+data[n+1:]))\n\nfor item in res:\n\tprint(item)\n\n...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s138039889', 's291454813', 's090749133']
[14380.0, 11052.0, 14560.0]
[580.0, 328.0, 495.0]
[131, 163, 248]
p02971
u516554284
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 i in range(n))\nif a.count(max(a))==1:\n for y in range(n):\n \tif a[y]==max(a):\n \t\ta.remove(a[y])\n \t\tprint(max(a))\n \telse:\n \t\tprint(max(a))\nelse:\n for i in range(n):\n print(max(a))\n\n', 'n=int(input())\na=list(int(input()) for i in range(n))\nfor y in ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s044067227', 's203741696', 's294933469', 's300573276', 's323940377', 's399826268', 's456597829', 's573288586', 's668268555', 's687553986', 's775407967', 's935360884', 's957754097', 's897758560']
[11040.0, 11040.0, 11040.0, 11040.0, 3060.0, 2940.0, 2940.0, 13088.0, 2940.0, 11044.0, 11044.0, 3060.0, 13088.0, 14140.0]
[2104.0, 2104.0, 355.0, 357.0, 17.0, 17.0, 17.0, 2104.0, 17.0, 2104.0, 2104.0, 17.0, 2104.0, 588.0]
[228, 151, 235, 241, 173, 149, 146, 226, 148, 226, 224, 160, 226, 161]
p02971
u516608852
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.
['array = list(map(int, input().strip().split()))\nn = array[0]\nbackup = 0\nfor i in range(n):\n backup = array[i+1]\n array[i+1] = 0\n print(max(array))\n array[i+1] = backup', 'array = list(map(int, input().strip().split()))\nn = array[0]\nbackup = 0\nfor i in range(n):\n backup = array[i]\n array[...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s261997150', 's326169053', 's404303237', 's792709459', 's974862414', 's329753958']
[3060.0, 3060.0, 3064.0, 12532.0, 3060.0, 17168.0]
[18.0, 17.0, 17.0, 608.0, 18.0, 520.0]
[179, 173, 320, 547, 324, 515]
p02971
u521039434
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 = [input() for i in range(n)]\n\nb = sorted(a)\n\n\nfor ai in a:\n if ai == b[0]:\n print(b[-2])\n else:\n print(b[-1])\n ', 'n = int(input())\n\na = [int(input()) for i in range(n)]\n \nb = sorted(a, reverse=True)\n \n \nfor ai in a:\n if ai == b[0]:\n print(b[1...
['Wrong Answer', 'Accepted']
['s799587074', 's686890300']
[18848.0, 14112.0]
[478.0, 539.0]
[155, 170]
p02971
u522293645
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())\nli1 = [int(input()) for i in range(n)]\nli2 = li1.copy()\nmx = max(li1)\n\nfor i in range(n):\n if i==mx:\n li2.remove(li1[i])\n print(max(li2))\n li2.append(li1[i])\n else:\n print(mx)', 'n = int(input())\nli1 = [int(input()) for i in range(n)]\n\nli2 = li1.co...
['Wrong Answer', 'Accepted']
['s944500191', 's644571887']
[14060.0, 14192.0]
[489.0, 548.0]
[229, 195]
p02971
u523545435
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()))\n\nmax_value=max(A)\nmax_index=A.index(max_value)\nsecond_value=A.sort()[-2]\n\nfor j in range(N):\n if i==max_index:\n print(second_value)\n else:\n print(max_value)', "import copy\n\ns=str(input())\nt=str(input())\nls=len(s)\nl...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s097690726', 's446505344', 's833622412', 's064266979']
[11868.0, 3444.0, 11868.0, 12532.0]
[444.0, 23.0, 427.0, 575.0]
[242, 1189, 242, 244]
p02971
u527261492
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 collections\nn=int(input())\na=[]\nfor i in range(n):\n a.append(int(input()))\nb=collections.Counter(a)\nd=list(b.items())\nd.sort(lambda x:-x[1])\nif d[0][1]==1:\n for i in range(n):\n if a[i]==int(d[0][0]):\n print(int(d[1][0]))\n else:\n print(int(d[0][0]))\nelse:\n for i in range(n):\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s082857222', 's583393389', 's618358902', 's772466326', 's883318007', 's956282613', 's925312995']
[25712.0, 28276.0, 19216.0, 17656.0, 19216.0, 11052.0, 30456.0]
[393.0, 567.0, 413.0, 416.0, 405.0, 356.0, 620.0]
[341, 345, 222, 226, 226, 120, 350]
p02971
u532514769
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\nn= int(input())\na =[int(input()) for i in range (n)]\n\nmaxIndex = [i for i, x in enumerate(a) if x == max(a)]\nif len(maxIndex)>=2:\n for i in range(n):\n print(max(a))\nelse:\n z = int(maxIndex[0])\n s = max(a[0:z],a[z+1:n+1])\n for k in range(z-1):\n print(max(a))\n pr...
['Wrong Answer', 'Accepted']
['s168145076', 's990989150']
[11052.0, 13384.0]
[2104.0, 523.0]
[364, 165]
p02971
u536034761
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()))\nfor i in range(N):\n a = A\n del a[i]\n print(max(a))', 'N = int(input())\nA = []\nfor i in range(N):\n A.append(int(input()))\na = sorted(A)\nmax = a[-1]\nif max == a[-2]:\n for i in range(N):\n print(max)\nelse:\n n = A.index(max)\n f...
['Runtime Error', 'Accepted']
['s653464353', 's042816839']
[11052.0, 14112.0]
[2104.0, 621.0]
[121, 256]
p02971
u538361257
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\nmax_num = -1\nmax_index = []\nsecond_num = -1\ndic = {}\nfor i in range(1, N+1):\n num = int(input())\n dic[i] = num\n if num > max_num:\n second_num = max_num\n max_num = num\n max_index.clear()\n max_index.append(i)\n elif num == max_num:\n max_inde...
['Wrong Answer', 'Accepted']
['s361955411', 's870202792']
[33936.0, 33936.0]
[623.0, 614.0]
[577, 577]
p02971
u540698208
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\nn = int(stdin.readline().rstrip())\na = [int(stdin.readline().rstrip()) for _ in range(n)]\n\nm1 = [x for i, x in enumerate(a) if x == max(a)]\n\nfor i in a:\n if len(m1) > 1:\n print(max(m1))\n else:\n m2 = max([x for x in a if x != max(m1)])\n print(max(m1) if a !...
['Wrong Answer', 'Accepted']
['s991317038', 's551949602']
[11052.0, 14112.0]
[2104.0, 320.0]
[325, 230]
p02971
u540799318
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\nn= int(input())\na = [0]*n\nfor i in range(n):\n a[i] = int(input())\n \nb = np.array(a)\nnp.sort(b)[::-1]\nans = [0]*n\n\nfor i in range(n):\n if a[i] == b[0]:\n ans[i] = b[1]\n else:\n ans[i] = b[0]\n \nfor i in range(n):\n print(ans[i])', 'n= int(input())\na = ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s329388793', 's927955490', 's942872100']
[30784.0, 12476.0, 30888.0]
[1436.0, 478.0, 1452.0]
[276, 222, 281]
p02971
u542541293
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 -*-\nN = int(input())\nA = [int(input()) for _ in range(N)]\nsetA = set(A)\ntempA = list(setA)\nR = sorted(tempA, reverse=True)\nmax_v = R[0]\nmax_v2 = R[1]\n\nfor i in range(N):\n if A[i] == R[0]:\n print(R[0])\n else:\n print(R[1])\n', '# -*- coding: utf-8 -*-\nN = int(input())\nA = [int...
['Runtime Error', 'Accepted']
['s414657487', 's757719989']
[18456.0, 20584.0]
[515.0, 591.0]
[249, 390]
p02971
u542932305
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 = sys.stdin.readline\n\nN = int(input())\nA = [int(input()) for _ in range(N)]\n\nfor i in range(N):\n a = A.copy()\n del a[i]\n print(max(a))', 'N = int(input())\nA = [int(input()) for _ in range(N)]\na = sorted(A.copy())\na1 = a[len(A)-1]\na2 = a[len(A)-2]\n\nfor i in A:\n if i == a1:\n pri...
['Runtime Error', 'Accepted']
['s572585556', 's166483332']
[2940.0, 14920.0]
[18.0, 559.0]
[149, 183]
p02971
u543411290
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=[]\nma=0\nfor i in range(n):\n a.append(int(input()))\nfor j in range(n):\n if(ma==a[j]):\n for h in range(n):\n if(h!=j):\n if(ma<a[h]):\n ma=a[h] \n print(str(ma))', 'n=int(input())\na=[]\nma=0\nfor i in range(n):\n a.append(int(inpu...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s092140873', 's630653962', 's848054968', 's900459801', 's451377004']
[12052.0, 11052.0, 2940.0, 12532.0, 12532.0]
[521.0, 371.0, 17.0, 2104.0, 599.0]
[234, 236, 238, 315, 360]
p02971
u546074985
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.
["if __name__ == '__main__':\n N = int(input())\n A = sorted({i: int(input()) for i in range(N)}.items(), key=lambda x: x[1])\n print(A)\n for index in range(N):\n if not A[-1][0] == index:\n print(A[-1][1])\n else:\n print(A[-2][1])\n \n ", "if ...
['Wrong Answer', 'Accepted']
['s773346208', 's667287887']
[45276.0, 45272.0]
[770.0, 681.0]
[301, 288]
p02971
u547167033
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.sort()\nfor i in range(n):\n if a[i]==a[-1]:\n print(a[-2])\n else:\n print(a[-1])\n', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\nfor i in range(n):\n if a[i]==a[-1]:\n print(a[-2])\n else:\n print(a[-1])', 'import copy\nn=int(inp...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s193572272', 's673058128', 's191290278']
[12532.0, 3060.0, 14568.0]
[560.0, 17.0, 692.0]
[138, 135, 169]
p02971
u549852663
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\n\nN = int(input())\nA = [int(input()) for i in range(N)]\n\nB = list(set(sorted(A)))\nprint(B)\n\nfor i in range(N):\n if A[i] != B[-1]:\n print(B[-1])\n else:\n if B[0] != B[-1]:\n print(B[-2])\n else:\n print(B[0])\n', 'import math\n\nN = int(input())\nA...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s014301889', 's469880105', 's494587872']
[19280.0, 19280.0, 14112.0]
[575.0, 552.0, 557.0]
[264, 252, 244]
p02971
u551066908
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\nN = int(input())\n\nA = []\nfor i in range(N):\n tmp = int(input())\n A.append(tmp)\n\nA_set = set(A)\nif len(A_set)==1:\n val = A[0]\n for i in range(N):\n print(val)\n sys.exit()\n\nelse:\n second_max = sorted(A_set)[-2]\n\ntmp_max = max(set(A))\ntmp_max_list = [i for i, x in enumerate(A) if x ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s694729352', 's759872556', 's937855056', 's295433220']
[21792.0, 22664.0, 21780.0, 14168.0]
[495.0, 582.0, 489.0, 521.0]
[567, 606, 673, 135]
p02971
u551437236
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())\nll = [[] for _ in range(n+1)]\n\ncount = 1\nfor i in range(n):\n ll[0].append(int(input()))\n ll[count] = ll[0].copy()\n ll[count][count-1] = 0\n max = 0\n for j in ll[count]:\n if j>max:\n max = j\n else:\n pass\n print(max)\n count+=1\n', 'n...
['Wrong Answer', 'Accepted']
['s403796802', 's805679048']
[275480.0, 14112.0]
[2120.0, 534.0]
[297, 186]
p02971
u551692187
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\nmaxval = -999\nsecond = -999\nmaxidx = -999\nfor idx, val in enumerate(A):\n if val > maxval:\n second = maxval\n maxval = val\n maxidx = idx\n\nfor i in range(N):\n if i == maxidx:\n print(second)\n else:\n print(ma...
['Wrong Answer', 'Accepted']
['s210588887', 's686991642']
[12532.0, 14084.0]
[490.0, 548.0]
[307, 168]
p02971
u554784585
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)]\nprint(A)\nM=max(A)\nsort_A=sorted(A, reverse=True)\n\nfor j in range(N):\n if A[j]==M:\n if A.count(M)==1:\n print(sort_A[1])\n else:\n print(M)\n else:\n print(M)', 'N=int(input())\na=[int(input()) for i in range(N)]...
['Wrong Answer', 'Accepted']
['s507580310', 's896018788']
[19812.0, 18972.0]
[2206.0, 353.0]
[251, 324]
p02971
u556225812
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 = []\nfor i in range(N):\n lst.append(int(input()))\nlst = sorted(lst)\n\nfor i in range(N):\n ans = lst[:i] + lst[i+1:]\n print(ans[-1])', 'N = int(input())\nlst = []\nfor i in range(N):\n lst.append(int(input()))\nans = sorted(lst)\nfor j in lst:\n if j == ans[-1]:\n prin...
['Wrong Answer', 'Accepted']
['s841166131', 's303404773']
[19196.0, 14112.0]
[2104.0, 585.0]
[160, 182]
p02971
u557282438
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()))\nmax1 = max(A)\nindex = []\nA2 = sorted(A)[1]\nfor i in range(N):\n if(A[i] == max1):\n print(max2)\n else:\n print(max1)', 'N = int(input())\nA = []\nfor i in range(N):\n A.append(int(input()))\nmax1 = max(A)\nmax2 = sort...
['Runtime Error', 'Accepted']
['s740905235', 's815023087']
[13380.0, 13292.0]
[526.0, 569.0]
[203, 209]
p02971
u559823804
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\nb=a.copy()\nb=sorted(b, reverse=True)\nprint(b)\n\nfor i in range(n):\n if a[i] == b[0]:\n print(b[1])\n else:\n print(b[0])\n', 'n=int(input())\na=[]\nfor _ in range(n):\n a.append(int(input()))\n\nb=a.copy()\nb=sorted(b, ...
['Wrong Answer', 'Accepted']
['s639900801', 's663269676']
[17936.0, 16176.0]
[598.0, 575.0]
[204, 195]
p02971
u573754721
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)\nm1=a[-1]\nm2=a[-2]\n\nfor i in range(n):\n if a[i]==m1:\n print(m2)\n else:\n print(m1)\n', 'n=int(input())\n \nA=[int(input()) for i in range(n)]\nB=sorted(A)\n\nma=B[-1]\nma2=B[-2]\nfor i in A:\n if i==ma:\n print(ma2)\...
['Wrong Answer', 'Accepted']
['s959419083', 's538151911']
[14112.0, 14176.0]
[548.0, 531.0]
[163, 158]
p02971
u576432509
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())\nimax=0\namax=int(input())\namax2=amax\nfor i in range(1,n)\n ai=int(input())\n if amax<ai:\n amax=ai\n imax=i\n if amax2<ai:\n amax2=ai\n elif amax2<ai:\n amax2=ai\nif imax==0:\n print(amax2)\n for i in range(1,n):\n print(amax)\nelif imax==n-...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s081754894', 's456289904', 's791637280']
[2940.0, 4540.0, 15752.0]
[17.0, 518.0, 602.0]
[485, 491, 207]
p02971
u577942884
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(0, n):\n a.append(int(input()))\nkore = []\nfor i in range(0, n):\n b = a.pop(i)\n kore.append(max(a))\n a.insert(i, b)\nprint(kore)', 'n = int(input())\na = []\nfor _ in range(0, n):\n a.append(int(input()))\nfirst = max(a)\nsecond_1 = sorted(a)\nsecond = secon...
['Wrong Answer', 'Accepted']
['s977039517', 's213786726']
[13080.0, 14112.0]
[2104.0, 581.0]
[176, 227]
p02971
u580301039
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=a\na.sort()\nfor i in range(n):\n if b[i]<a[-1]:\n print(a[-1])\n elif b[i]==a[-1]:\n print(a[-2])', 'n=int(input())\na=[int(input()) for i in range(n)]\nb=a[:]\na.sort()\nfor i in range(n):\n if b[i]<a[-1]:\n print(a[-1])\n elif b...
['Wrong Answer', 'Accepted']
['s688606434', 's324890538']
[12512.0, 14112.0]
[576.0, 607.0]
[164, 168]
p02971
u580316619
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 deque\n\nn=int(input())\na=deque([int(input()) for i in range(n)])\n\nfor i in range(n):\n\tb=a.pop()\n\tprint(max(a))\n\ta.append(b)\n', 'n=int(input())\na=[int(input()) for i in range(n)]\nb=sorted(a,reverse=True)\nfor i in range(n):\n\tif b[0]!=a[i]:\n\t\tprint(b[0])\n\telse:\n\t\tprint(b[1...
['Wrong Answer', 'Accepted']
['s639752154', 's069821081']
[12800.0, 14112.0]
[2104.0, 606.0]
[147, 144]
p02971
u580362735
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_max = max(A)\nA_max_count = A.count(A_max)\n\nfor i in range(N):\n tmp = A[i]\n if tmp != A_max_count:\n print(A_max)\n else:\n if A_max_count == 1:\n print(max(A[:i]+A[i+1:]))\n else:\n print(A_max)', 'N = int(input())\nA = [int(input())...
['Wrong Answer', 'Accepted']
['s618254880', 's005059776']
[12512.0, 14876.0]
[2104.0, 574.0]
[266, 382]
p02971
u581403769
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 a:\n i = 0\n print(max(a))', 'n = int(input())\na = [int(input()) for i in range(n)]\n\nl = sorted(a, reverse=True)\nm = a.index(a(max))\nfor i in range(n):\n if i == m:\n print(l[1])\n else:\n print(l[0])', 'n = int(input())...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s125196585', 's921133078', 's784189385']
[11052.0, 13320.0, 14084.0]
[2104.0, 384.0, 578.0]
[94, 186, 184]
p02971
u582663624
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)]\ns=sorted(l)\nm=s[-1]\nn=s[-2]\nnums=[i for i in range(n)]\nfor num in nums:\n if(l[num]!=m:\n print(m)\n else:\n print(n)', 'n=int(input())\nl=[int(input()) for i in range(n)]\ns=sorted(l)\np=s[-1]\nq=s[-2]\nfor i in range(n):\n if l[i]==p:\n print(q)\n ...
['Runtime Error', 'Accepted']
['s493197762', 's643034878']
[2940.0, 14112.0]
[17.0, 543.0]
[171, 144]
p02971
u583276018
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.
['num = []\nfor _ in range(int(input())):\n num.append(int(input()))\n\nfor i in range(len(num)):\n a = max(num[:i])\n b = max(num[i+1:])\n print(max(a, b))', 'num = []\naaa = []\nnmax = 0\nn2max = 0\ncount = 0\nn = int(input())\nfor i in range(n):\n a = int(input())\n aaa.append(a)\n if(nmax < a):...
['Runtime Error', 'Accepted']
['s381064933', 's568181938']
[11052.0, 20384.0]
[355.0, 591.0]
[159, 431]
p02971
u584744470
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=[]\nb=a\nfor _ in range(N):\n a_=int(input())\n a.append(a_)\nx=max(a)\nif a.count(x)>=2:\n for i in range(N):\n print(x)\nelse:\n for i in range(N):\n if a[i]==x:\n b.sort()\n print(b[-2])\n else:print(x)', 'N=int(input())\na=[]\nfor _ in range(N):\n a_=int(input())\n a.app...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s083304562', 's390436395', 's837821811', 's950458245', 's409946801']
[12688.0, 12532.0, 12668.0, 12664.0, 14120.0]
[642.0, 495.0, 594.0, 597.0, 640.0]
[231, 217, 231, 228, 241]
p02971
u586662847
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 itertools\n# import math\n\nimport sys\ninput = sys.stdin.readline\n\n\ndef solve(N, A):\n for i in range(N - 1):\n tmp = A\n tmp.pop(i)\n print(max(tmp))\n\n\nN = int(input())\n# S = input()\n# A, B = map(int, input().split())\n# A = list(map(int, input().split()))\n\n\nA = []\nfor i...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s218075146', 's870041956', 's981381754', 's699698507']
[11032.0, 16608.0, 11052.0, 14112.0]
[2104.0, 2105.0, 2104.0, 309.0]
[364, 387, 360, 451]
p02971
u588558668
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)]\nma=max(a)\nb=a\nfor i in range(n):\n if b[i]==ma:\n b[i]=0\n p=i\n break\n \nmaa=max(b)\nA=[]\nfor i in range(n):\n if i!=p:\n A.append(ma)\n else:\n A.append(maa)\n \nprint(A[i] for _ in range(n))\n', 'n=int(input())\na=[int(input()) for _ i...
['Wrong Answer', 'Accepted']
['s644362426', 's070764830']
[12588.0, 14060.0]
[365.0, 543.0]
[256, 259]
p02971
u591016708
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\nN = int(stdin.readline().restrip())\nnum_line = [stdin.readline().restrip() for _ in range(N)]\nfor i in range(N):\n save_num = num_line[i]\n num_line.pop(i)\n print(max(num_line))\n num_line.insert(i, save_num)', 'N = int(input())\nnum_line = [int(input()) for _ in range(N)]\nsort_line = so...
['Runtime Error', 'Accepted']
['s403782890', 's693960339']
[2940.0, 14112.0]
[17.0, 556.0]
[229, 207]
p02971
u591700046
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())\ni=0\nb=[]\npos=0\nmaxi=0\nwhile(i<n):\n k=int(input())\n b.append(k)\n if(k>maxi):\n pos=i\n maxi=k\n i+=1\nb.sort()\nns=b[n-2]\ni=0\nwhile(i<n):\n if(i==pos):\n \tprint(ns)\n else:\n print(b[i])\n i+=1', 'n=int(input())\ni=0\nb=[]\npos=0\nmaxi=0\nwhile(i<n):\n k=int(input())\n b.ap...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s093395468', 's771911117', 's212513642']
[12512.0, 2940.0, 12532.0]
[694.0, 17.0, 649.0]
[214, 214, 216]
p02971
u593567568
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)\nm1 = B[-1]\nm2 = B[-2]\nANS = [m1 if x == m1 else m2 for x in A]\nprint('\\n'.join(map(str,ANS)))\n", "N = int(input())\nA = [int(input()) for _ in range(N)]\nB = sorted(A)\nm1 = B[-1]\nm2 = B[-2]\nANS = [m1 if x == m1 else m2 for x in A]\nprint('...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s068949953', 's780031794', 's785781470', 's902827151', 's885186600']
[28960.0, 28852.0, 55164.0, 56700.0, 28960.0]
[455.0, 432.0, 1171.0, 1118.0, 437.0]
[162, 162, 170, 175, 162]
p02971
u596297663
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\nmaxd = 0\nsmax = 0\nfor i in range(n):\n\tA[i] = int(input())\n\tif A[i] >= maxd:\n\t\tsmax = maxd\n\t\tmaxd =A[i]\nfor i in range(n):\n\tif A[i]==maxd:\n\t\tprint(smax)\n\telse:\n\t\tprint(maxd)', 'n = int(input())\nA=[0]*n\nmaxd = 0\nsmax = 0\nfor i in range(n):\n\tA[i] = int(input())\n\t...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s158537208', 's637487297', 's696471015', 's937909930']
[12508.0, 12604.0, 12508.0, 12508.0]
[556.0, 538.0, 564.0, 538.0]
[197, 197, 196, 231]
p02971
u597017430
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\nB = [0] * N\nfor i in range(N):\n A[i] = int(input())\n \nA_temp = A[0]\nA[0] = 0\nprint(max(A))\nA[0]= A_temp\n\nfor i in range(1, N):\n B[i] = max(B[i-1],A[i])\n print(B[i])\n \n', 'N = int(input())\nA = [0] * N\nfor i in range(N):\n A[i] = int(input())\n \nA_Max = sorted(A)[...
['Wrong Answer', 'Accepted']
['s402121468', 's302758468']
[14084.0, 14664.0]
[595.0, 625.0]
[203, 198]
p02971
u597455618
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, b = map(int, input().split())\n\nif a<=0 and 0<=b:\n print("Zero") \nelif a < 0 and min(b-a,-a)%2 == 0:\n print("Negative")\nelse:\n print("Positive")', 'n = int(input())\na = [int(input()) for _ in range(n)]\nb = a[:]\nb.sort(reverse=True)\nfor i in range(n):\n if a[i] == b[0]:\n print(b[1])\n else:\n ...
['Runtime Error', 'Accepted']
['s481561857', 's420519420']
[3060.0, 14108.0]
[17.0, 554.0]
[150, 161]
p02971
u598229387
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)]\nma=max(a)\naa=sorted(a,reverse=True)\nfor i in a:\n if i !=ma:\n print(a[i])\n else:\n print(aa[1])', "l,r=map(int,input().split())\nll=l%2019\nrr=r%2019\n\nans=float('inf')\nfor i in range(ll,rr):\n for j in range(i+1,rr+1):\n ans=min(...
['Runtime Error', 'Runtime Error', 'Accepted']
['s790931725', 's879183894', 's640666273']
[14112.0, 3060.0, 14192.0]
[560.0, 17.0, 550.0]
[163, 160, 161]
p02971
u600402037
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\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n \nimport numpy as np\n \nN = int(readline())\nA = np.zeros(N+2,np.int32)\nA[1:-1] = np.array(read().split(),np.int32)\n\nN = ir()\nA = np.zeros(N+2, np.int32)\nA[1:-1] = np.array(read().split(),np....
['Runtime Error', 'Runtime Error', 'Accepted']
['s031026032', 's172439547', 's680042934']
[23756.0, 22992.0, 60148.0]
[188.0, 183.0, 426.0]
[485, 423, 413]
p02971
u600935366
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 x in range(n)]\n\nfor i in a:\n if i == n:\n print(n-1)\n else:\n print(n)', 'n = int(input())\na = [int(input()) for x in range(n)]\na1 = sorted(a)\n\namax = a1[n-1]\namax2 = a1[n-2]\n\nfor i in a:\n if i == amax:\n print(amax2)\n else:\n ...
['Wrong Answer', 'Accepted']
['s918619679', 's831491615']
[12660.0, 14132.0]
[485.0, 527.0]
[127, 182]
p02971
u601235270
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)\nfirst_max =new_a[-1]\nsecond_max =new_a[-2]\nfor i in a:\n print(i)\n if i ==first_max:\n print(second_max)\n else:\n print(first_max)', 'n =int(input())\na =[int(input()) for _ in range(n)]\nnew_a=sorted(a)\nfirst_max =new_...
['Wrong Answer', 'Accepted']
['s987389172', 's350631431']
[15456.0, 14112.0]
[669.0, 595.0]
[218, 205]
p02971
u603324902
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(n)]\n\nX = [0]\nY = [0]\n\nfor i in range(n):\n x = max(X,a[:i])\n y = max(Y,a[i + 1:])\n print(max(x[0],y[0]))', 'n = int(input())\n\na = [int(input()) for i in range(n)]\n\nfor i in range(n):\n x = max(a[:i])\n y = max(a[i + 1:])\n print(max(x,y...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s103236307', 's210634773', 's555566625', 's985688404', 's347420544']
[15648.0, 11052.0, 11052.0, 11052.0, 12532.0]
[2104.0, 328.0, 331.0, 2104.0, 576.0]
[163, 137, 164, 183, 345]
p02971
u606090886
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 = []\nnum = []\nprem = 0\nm = 0\nj = 0\nfor i in range(n):\n a.append(int(input()))\nfor i in range(n):\n if a[i] > m:\n prem = m\n m = a[i]\n num = []\n num.append(i)\n if a[i] == m:\n num.append(i)\n elif a[i] > prem:\n prem = a[i]\nprint(num...
['Wrong Answer', 'Accepted']
['s276732700', 's089704358']
[23344.0, 12632.0]
[581.0, 562.0]
[427, 287]
p02971
u606523772
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 = int(input())\n A_list.append(A)\nsort_A = sorted(A_list, reverse = True)\nk = 0\nfor i in range(1, len(sort_A)):\n if sort_A[k] != sort_A[k-1]:\n A_second = sort_A[k]\n break\n if i == len(sort_A)-1:\n A_second = sort_A[0]\nfor i...
['Wrong Answer', 'Accepted']
['s784870101', 's552983443']
[14112.0, 14112.0]
[591.0, 572.0]
[408, 241]
p02971
u615034089
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 ai = int(input())\n a.append(ai)\n\nmx = max(a)\ncount = a.count(mx)\nmx2 = -1\nfor i in a:\n if(mx2 < i and i != mx):\n mx2 = i\n\nif(mx2 == -1):\n mx2 = mx\n \nfor i in a:\n if(i!=mx):\n print(mx)\n else:\n if(count>0):\n print(mx)\n else:\n ...
['Wrong Answer', 'Accepted']
['s852046689', 's675311855']
[12532.0, 12532.0]
[523.0, 509.0]
[307, 308]
p02971
u616539426
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())\ntop_val = 0\ntop_idx = set()\nsemi_top = 0\n\nfor i in range(n):\n a = int(input())\n if a > top_val:\n semi_top = top_val\n top_val = a\n top_idx.clear()\n top_idx.add(i)\n elif a == top_val:\n top_idx.add(i)\n\nif len(top_idx) > 1:\n semi_top = top_val\n\nprint("\\n".join([semi_...
['Runtime Error', 'Accepted']
['s644852614', 's601297987']
[20968.0, 21860.0]
[394.0, 416.0]
[352, 439]
p02971
u617659131
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 for n in range(n)]\nprint(a)\nfor i in range(n):\n a[i] = int(input())\na_max = max(a)\nfor j in range(n):\n if a[j] != a_max:\n print(a_max)\n else:\n a.sort()\n a.reverse()\n print(a[1])', 'n = int(input())\na = [0 for n in range(n)]\nfor i in range(n):\n a[i] = int(input())...
['Wrong Answer', 'Accepted']
['s738196487', 's529256973']
[13864.0, 14128.0]
[2104.0, 582.0]
[216, 214]
p02971
u624613992
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_sort = sorted(a)\nm1 = a[0]\nm2 = a[1]\nfor i in range(n):\n if a[i] == m1:\n print(m2)\n else:\n print(m1)', 'n = int(input())\na = [int(input()) for _ in range(n)]\na_sort = sorted(a,reverse=True)\nm1 = a_sort[0]\nm2 = a_sort[1]\nfor i in range(n):\n...
['Wrong Answer', 'Accepted']
['s242707189', 's627883751']
[19036.0, 18976.0]
[359.0, 353.0]
[164, 187]
p02971
u627143908
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()))\n#print(a)\nlm = [0] * n\nrm = [0] * n\n\nfor i in range(1, n):\n lm[i] = max(a[i-1], lm[i-1])\n\nfor i in range(n-2, -1, -1):\n rm[i] = max(a[i+1], rm[i+1])\n\nprint(lm)\nprint(rm)\n\nfor i in range(n):\n print(max(lm[i], rm[i]))', 'n ...
['Wrong Answer', 'Accepted']
['s826609378', 's326188271']
[21868.0, 15684.0]
[743.0, 680.0]
[294, 252]
p02971
u630677474
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 = []\nmax1 = 0\nmax2 = 0\nfor _ in range(N):\n ai = int(input())\n A.append(ai)\n\n\nA2 = sorted(A)\n\nmax1 = A2[len(A2)-1]\nmax2 = A2[len(A2)-2]\nprint(max1, max2)\n\nfor i in range(N):\n if max1 == A[i]:\n print(max2)\n else:\n print(max1)', 'N = int(input())\n\nA = [...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s354972079', 's967489996', 's111019895']
[14112.0, 14112.0, 26824.0]
[571.0, 585.0, 624.0]
[269, 252, 302]
p02971
u630765015
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 = [[i, int(input())] for i in range(n)]\nprint(a)\na.sort(reverse=True, key=lambda x:x[1])\nfirst, second = a[0][1], a[1][1]\na.sort(key=lambda x:x[0])\nfor i in range(n):\n print(first if a[i][1] != first else second)', 'n = int(input())\na = [[i, int(input())] for i in range(n)]\na.sort(reverse...
['Wrong Answer', 'Accepted']
['s841272691', 's608724535']
[46320.0, 39700.0]
[924.0, 849.0]
[232, 223]
p02971
u634443822
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\nn=int(input())\na=[]\nm=[]\nfor i in range(n):\n a.append(int(input()))\nm.append(a.index(max(a)))\nm.append(a.pop(m[0]))\nm.append(max(a))\n\nfor i in range(m[0]):\n print(m[1])\n \nprint(m[2])\n\nfor i in range(m[0]+1,n):\n print(m[i])', 'import numpy as np\nn=int(input())\na=[]\nm=[]\nfor i...
['Runtime Error', 'Accepted']
['s844275441', 's392374048']
[21696.0, 21700.0]
[625.0, 631.0]
[245, 245]
p02971
u647287452
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.append(int(input()))\nM=max(list)\nL=[i for i, v in enumerate(list) if v == M]\nn=len(L)\nif n>1:\n for i in range(N):\n print(M)\nelif:\n del list[L[0]]\n M2=max(list)\n for i in range(N):\n if i == L[0]:\n print(M2)\n elif:\n print(M)', 'N=i...
['Runtime Error', 'Accepted']
['s980727542', 's348632025']
[2940.0, 20456.0]
[17.0, 535.0]
[294, 295]
p02971
u648212584
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 _ in range(N)]\n\nfor i in range(N):\n\tans = max(A[:1] + A[i+1:])\n\tprint(ans)', 'N = int(input())\n\nA = [int(input()) for _ in range(N)]\n\nB = sorted(A)\nfor i in range(N):\n\tif A[i] == B[-1]:\n\t\tprint(B[-2])\n\telse:\n\t print(B[-1])']
['Wrong Answer', 'Accepted']
['s932015574', 's496019135']
[14124.0, 14112.0]
[2104.0, 543.0]
[114, 147]
p02971
u648881683
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, collections, copy, heapq, itertools, math, string, sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = float('inf')\ndef I(): return int(input())\ndef F(): return float(input())\ndef SS(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_()...
['Wrong Answer', 'Accepted']
['s910875225', 's083870476']
[18312.0, 17784.0]
[200.0, 216.0]
[779, 858]
p02971
u653175574
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 = [input() for i in range(N)] \nfor i in range(1, N):\n del s[i]\n print(max([s]))', 'N = int(input())\ns = [input() for i in range(N)] \nfor i in range(1, N):\n del s[i]\n print(max(s))\n ', 'n=int(input())\na=[int(input())for _ in range(n)]\nb=sorted(a)\nfor a in a:print(b[(a<b[-1])-2])']
['Runtime Error', 'Runtime Error', 'Accepted']
['s636424970', 's679545045', 's303459528']
[152608.0, 15768.0, 14112.0]
[1954.0, 2104.0, 576.0]
[100, 101, 93]
p02971
u657357805
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\nb = [0]*N\nfor i in range(N):\n a[i] = int(input())\n b[i] = int(input())\nm = max(b)\nb.remove(m)\nn = max(b)\n\nfor i in range(N):\n if a[i] == m:\n print(n)\n else:\n print(m)', 'N = int(input())\na = [0]*N\nfor i in range(N):\n a[i] = int(input())\nm = max...
['Runtime Error', 'Runtime Error', 'Accepted']
['s039494795', 's960370172', 's619942029']
[12532.0, 12508.0, 14084.0]
[349.0, 531.0, 512.0]
[219, 186, 211]
p02971
u658288444
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\nR = sorted(L)\na = R[-2]\nb = R[-1]\n\nfor i in L:\n if i == b:\n print(b)\n else:\n print(a)', 'n = int(input())\nL = []\nfor i in range(n):\n L.append(int(input()))\n\nR = sorted(L)\na = R[-2]\nb = R[-1]\n\nfor i in L:\n if i == b:\...
['Wrong Answer', 'Accepted']
['s609058845', 's841068836']
[14152.0, 14112.0]
[558.0, 545.0]
[162, 162]
p02971
u659563289
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_list = []\n for i in range(n):\n a = int(input())\n \n a_list.append([i,a])\n\n ans = sorted(a_list, key=lambda x:x[1])\n #print(ans)\n\n print("-"*75)\n for i in range(n):\n \n if a_list[i][1] == ans[-1][1]:\n \n ...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s524541899', 's883860691', 's926364068', 's370739392']
[40964.0, 11052.0, 11052.0, 43044.0]
[698.0, 2104.0, 2104.0, 688.0]
[448, 276, 276, 450]
p02971
u660245210
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 = a.sorted()\nst = a1[-1]\nnd = a1[-2]\nfor i in a:\n if i = st:\n print(nd)\n else: print(st)', 'n = int(input())\na = [int(input()) for _ in range(n)]\ns = sum(a)\nfor i in a:\n print(s-i)', 'n = int(input())\na = [int(input()) for _ in range(n)]\na1 ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s526764132', 's546070089', 's060185556']
[2940.0, 13380.0, 14112.0]
[17.0, 485.0, 541.0]
[150, 89, 151]
p02971
u663710122
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)]\nsA = sorted(A)\n\nfor a in A:\n if a != sA:\n print(a)\n else:\n print(sA[1])\n', 'N = int(input())\nA = [int(input()) for _ in range(N)]\nsA = sorted(A)\n\nfor a in A:\n if a != sA[-1]:\n print(a)\n else:\n print(sA[-2])\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s229177408', 's652060411', 's894490391']
[14048.0, 14112.0, 14084.0]
[538.0, 538.0, 534.0]
[146, 151, 156]
p02971
u667024514
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 = [int(input()) for i in range(n)]\nli=sort(lis,reverse=True)\nfor i in range(n):\n if lis[i] == lis[0]:\n print(lis[1])\n else:\n print(lis[0])', 'n = int(input())\nlis = [int(input()) for i in range(n)]\nli=sorted(lis,reverse=True)\nfor i in range(n):\n if lis[i] == li[0]:\n print(...
['Runtime Error', 'Accepted']
['s135562157', 's526773616']
[11052.0, 14112.0]
[331.0, 559.0]
[167, 167]
p02971
u671239754
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())\nimport copy\nlist = []\nfor i in range(n):\n k = int(input())\n list.append(k)\nlist1 = copy.deepcopy(list)\nfirst = max(list1)\nlist1.remove(first)\nsecond = max(list1)\nprint("----------------")\nfor li in list:\n if li == first:\n print(second)\n else:\n print(first)\n',...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s029826069', 's365459525', 's881403034']
[14548.0, 14548.0, 14548.0]
[646.0, 669.0, 679.0]
[300, 299, 274]
p02971
u671861352
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[:].remove(mx1)', 'N = int(input())\nA = [int(input()) for _ in range(N)]\n\nmx1 = max(A)\nA_ = A[:]\nA_.remove(mx1)\nmx2 = max(A_)\nfor a in A:\n if a == mx1:\n print(mx2)\n else:\n print(mx1)']
['Runtime Error', 'Accepted']
['s469677165', 's422702915']
[2940.0, 14176.0]
[17.0, 486.0]
[16, 184]
p02971
u673338219
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())\nmx = 0\nsmx = 0\nmxi = 0\nfor i in range(n):\n ai = int(input())\n if a[i] > mx:\n smx = mx\n mx = a[i]\n mxi = i\n elif a[i] > smx:\n smx = a[i]\nfor j in range(mxi):\n print(mx)\nprint(smx)\nfor j in range(mxi+1,n):\n print(mx)\n \n ', 'n = int(input())\nmx = 0\nsmx = 0\nmxi =...
['Runtime Error', 'Accepted']
['s594711294', 's160045031']
[3064.0, 4668.0]
[17.0, 509.0]
[256, 248]
p02971
u674588203
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\n\nN=int(input())\nls = []\nlsmax=1\nlsmaxnum=1\nlsmax2=1\nfor i in range (N):\n a=int(input())\n ls.append(a)\n if a==lsmax:\n lsmaxnum+=1\n if a>lsmax:\n lsmax=a\nif lsmaxnum==1:\n ls2=sorted(ls)\n lsmax2=ls2[-2]\n\n# print(lsmax,lsmax2,lsmaxnum)\n\nfor j in range (N):\n if ls[...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s315558072', 's519498762', 's764837884']
[18900.0, 16876.0, 19068.0]
[397.0, 382.0, 406.0]
[479, 479, 538]
p02971
u676458682
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)]\nma=max(A)\nma_i=A.index(ma)\nfor i,_ in enumerate(A):\n if i==ma_i:\n print(max(A[:i-1]+A[i-1:]))\n else:\n print(ma)', 'import copy,numpy\nn=int(input())\nA=[int(input()) for _ in range(n)]\nfor i,_ in enumerate(A):\n print(numpy.max(A[:i-1]+...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s039953579', 's271502286', 's332206086']
[15584.0, 24640.0, 15580.0]
[482.0, 2109.0, 514.0]
[181, 130, 173]
p02971
u678167152
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())\n#print(A)\nM = max(A)\nind = A.index(M)\nprint(ind)\nA.pop(ind)\nm = max(A)\nfor i in range(N):\n #print(i)\n if i != ind:\n print(M)\n else:\n print(m)\n ', "def solve():\n N = int(input())\n A = [int(input()) for _ in range(N)...
['Wrong Answer', 'Accepted']
['s134632954', 's556836066']
[14392.0, 14752.0]
[522.0, 492.0]
[223, 274]
p02971
u684120680
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, *a = map(int, open(0).read().split())\n\n a.sort()\n max_a = a[-1]\n next_max_a = a[-2]\n for cur_a in a:\n if cur_a == max_a:\n print(next_max_a)\n else:\n print(max_a)\n return()\n\nif __name__ == '__main__':\n main()\n", "def main():\n n,...
['Wrong Answer', 'Accepted']
['s406802606', 's151776081']
[25036.0, 25036.0]
[282.0, 258.0]
[280, 307]
p02971
u685662874
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())\nalist=[int(input()) for i in range(n)]\nb=alist.sort(reverse=True)\nfor a in alist:\n if a < b[0]:\n print(b[1])\n elif b[0] <= a:\n print(b[0])', 'n=int(input())\nalist=[int(input()) for in range(n)]\nmax = 0\nfor i,a in enumerate(alist):\n max_a = max(alist[0:i])\n max_b = ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s086071806', 's536429634', 's841404843', 's028067063']
[11804.0, 2940.0, 14112.0, 14112.0]
[384.0, 17.0, 545.0, 567.0]
[173, 176, 176, 176]
p02971
u686036872
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()\nA=[]\nfor i in range(N-1):\n A.append(int(input()))\nB=sorte(A, reverse=True)\nfor i in range(N-1):\n if A[i] == B[0]:\n print(B[1])\n else:\n print(B[0]) ', 'N = int(input())\nA=[]\nfor i in range(N):\n A.append(int(input()))\nB=sorted(A, reverse=True)\nfor i in range(N):\n ...
['Runtime Error', 'Accepted']
['s521957017', 's139210046']
[3060.0, 14112.0]
[18.0, 635.0]
[182, 184]
p02971
u688219499
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()) for i in range(n)]\nm = max(a)\nprint(a)\np = a.index(m)\na.remove(m)\ns = max(a)\nprint(s)\nfor i in range(n):\n if i != p:\n print(m)\n else:\n print(s)', 'a = [int(input()) for i in range(n)]\nm = max(a)\np = a.index(m)\ns = max(a)\nfor i in range(n):\n if i != p:\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s211525522', 's624034831', 's903027916', 's128495003']
[8888.0, 9016.0, 8980.0, 16880.0]
[23.0, 21.0, 21.0, 322.0]
[181, 152, 163, 181]
p02971
u689626103
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\nimport heapq\n\nh = []\nfor a in A:\n if len(h) < 2:\n heapq.heappush(h, a)\n else:\n heapq.heappushpop(h, a)\n\nprint('h', h)\n\nfor a in A:\n if a == h[1]: \n print(h[0])\n else:\n print(h[1])", 'N =...
['Wrong Answer', 'Accepted']
['s054539632', 's968477711']
[12640.0, 12640.0]
[559.0, 566.0]
[314, 274]
p02971
u690326927
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)]\n\nLs = sorted(L)\nfor i in range(N):\n if L[i] == Ls[0]:\n print(Ls[1])\n else:\n print(Ls[0])\n', 'N = int(input())\nL = [int(input()) for _ in range(N)]\n\nLs = sorted(L, reverse=True)\nfor i in range(N):\n if L[i] == Ls[0]:\n pri...
['Wrong Answer', 'Accepted']
['s903792065', 's631528362']
[14104.0, 14192.0]
[546.0, 568.0]
[163, 177]
p02971
u691274427
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 = []\n\nfor n in range(N):\n A.append([n, int(input())])\nprint(A)\nAs = sorted(A, reverse=True, key=lambda x: x[1])\nprint(As)\n \n\nfor n in range(N):\n i = 0 \n if n == 0:\n if A[0] == As[0]:\n print(As[1][1])\n else: \n print(As[0]...
['Wrong Answer', 'Accepted']
['s374256881', 's206050473']
[54732.0, 41304.0]
[1068.0, 865.0]
[579, 555]
p02971
u691896522
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()))\nk = max(a)\nfor i in range(n):\n if a[i] <= k:\n print(k)\n else:\n tmp = a[i]\n a[i] = 0\n print(max(a))\n a[i] = tmp', 'n = int(input())\na = []\nfor i in range(n):\n a.append(int(input()))\nk = max...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s228842597', 's510696538', 's724924343', 's989098279', 's787455941']
[12532.0, 12532.0, 26336.0, 15720.0, 15696.0]
[522.0, 496.0, 800.0, 712.0, 716.0]
[221, 221, 418, 358, 378]
p02971
u692054751
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(s) for s in input().split()]\nfirst, second = sorted(A)[::-1][:2]\nfor a in A:\n print(first if a != first else second)', 'N = int(input())\nA_s = []\nfor i in range(N):\n A_s.append(int(input()))\n \nA_s = np.array(A_s)\n \nm_index = A_s.argmax()\nsort_A_s = sorted(A_s)\nm_value = A_s[m_index]\nm_seco...
['Runtime Error', 'Runtime Error', 'Accepted']
['s319727403', 's826709529', 's925490728']
[3060.0, 11052.0, 14140.0]
[17.0, 360.0, 550.0]
[128, 277, 170]
p02971
u692311686
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=[input() for i in range(N)]\nNL=sorted(L)\nfor i in range(N):\n if L[i-1]==NL[N-1]:\n print(NL[N-2])\n else:\n print(NL[N-1])', 'N=int(input())\nL=[int(input()) for i in range(N)]\nNL=sorted(L)\nfor i in range(N):\n if L[i-1]==NL[N-1]:\n print(NL[N-2])\n else:\n print(NL[N-1])\n', 'N...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s964841833', 's998610089', 's334421073']
[18848.0, 14112.0, 14112.0]
[530.0, 569.0, 573.0]
[144, 150, 147]
p02971
u693723949
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 = []\nfor i in range(N):\n arr.append(int(input()))\nfor i range(N):\n cop = arr.copy()\n del cop[i]\n cop.sort()\n print(cop[-1])', 'N = int(input())\narr = []\nfor i in range(N):\n arr.append(int(input()))\nfor i range(N):\n cop = arr.copy()\n del cop[i]\n print(max(cop))', 'N = int(i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s318270274', 's547774255', 's997484612']
[2940.0, 2940.0, 20444.0]
[17.0, 17.0, 563.0]
[149, 137, 409]
p02971
u695429668
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 heapq\nfrom collections import defaultdict\ncnt = defaultdict(int)\nN = int(input())\nA = list(map(int, input().split()))\n# A = []\n\n# A.append(int(input()))\nans = 0\n_ans = []\nbuff = [0 for i in range(N)]\nfor i in range(N-1, -1, -1):\n if i > N//2:\n buff[i] = A[i]\n else:\n _m = ...
['Runtime Error', 'Accepted']
['s586909010', 's651869486']
[4980.0, 14136.0]
[29.0, 581.0]
[691, 217]
p02971
u695655590
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.
['for _ in range(N):\n A.append(int(input()))\n\nsort_A = sorted(A)\nmax = sort_A[N - 1]\nsec = sort_A[N - 2]\n\ncount = A.count(max)\n\nif count == 1:\n p = A.index(max)\n \n for i in range(p):\n print(max)\n \n print(sec)\n \n for j in range(p,N - 1):\n print(max)\n\nelse:\n for k in range(N):\n p...
['Runtime Error', 'Accepted']
['s586077289', 's199682097']
[3064.0, 14112.0]
[17.0, 590.0]
[305, 329]
p02971
u697696097
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())\ntmp=sorted(arr,reverse=True)\narrMax=tmp[0]\n\nfor i in range(n):\n if arr[i]==arrMax:\n if tmp[0]==tmp[1]:\n print(tmp[1])\n else:\n print(tmp[0])\n else:\n print(tmp[1])\n\n ', 'n=int(input())\narr=[0]*n\nfor i in range(n):\...
['Wrong Answer', 'Accepted']
['s833302701', 's882858014']
[18828.0, 18960.0]
[372.0, 371.0]
[252, 252]
p02971
u698919163
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 for j in range(N):\n A_list[j] = A[j]\n \n A_list[i] = 0\n print(max(A_list))', 'N = int(input())\nA = [int(input()) for i in range(N)]\n\nfor i in range(N):\n for j in range(N):\n A_list[j] = A[j]\n \n A...
['Runtime Error', 'Runtime Error', 'Accepted']
['s205187184', 's485498523', 's447978075']
[11052.0, 11052.0, 14124.0]
[314.0, 326.0, 614.0]
[167, 167, 234]
p02971
u700805562
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())\na1 = int(input())\na2 = int(input())\nif a[0] >= a[1]:\n maxa1 = a1\n maxa2 = a2\n res = 0\nelse:\n maxa1 = a2\n maxa2 = a1\n res = 1\n\nfor i in range(2, n):\n a_ = int(input())\n if maxa1 <= a_:\n maxa2 = maxa1\n maxa1 = a_\n res = i\n elif maxa2 <= ...
['Runtime Error', 'Accepted']
['s223928027', 's345388311']
[3064.0, 4668.0]
[18.0, 530.0]
[411, 407]
p02971
u704001626
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 -*-\na = int(input())\nc = [int(input()) for i in range(a)]\n\n\nall_max = max(c)\nfirst_max_id = c.index(all_max)\n\nc_dash = sorted(c,reversed=True)\nsecond_max_value = c_dash[1]\nfor i,v in enumerate(c):\n if i != first_max_id:\n pr_val = all_max\n else:\n if all_max == seco...
['Runtime Error', 'Accepted']
['s193157928', 's043902591']
[11052.0, 14176.0]
[333.0, 575.0]
[479, 478]
p02971
u706828591
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())\nls = []\nfor i in range(n):\n ls.append(int(input()))\nmaxnum = max(ls)\nind = ls.index(maxnum)\nls.remove(maxnum)\nsecondnum = max(ls)\nls = ls[0:ind] + [maxnum] + ls[ind:]\nprint(ls)\nif maxnum == secondnum:\n for i in range(n):\n print(maxnum)\n quit()\nfor i in range(n):\n if ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s316513476', 's430708690', 's876105905', 's224523219']
[16344.0, 11052.0, 14160.0, 14104.0]
[545.0, 361.0, 518.0, 517.0]
[377, 221, 365, 377]
p02971
u715355213
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\n\n\nN = int(input())\nA = [int(input()) for i in range(N)]\n\nfor i in range(N):\n # B = copy.deepcopy(A)\n tmp = A[i]\n a[i] = 0\n ans = max(A)\n a[i] = tmp\n print(ans)\n \n', 'N = int(input())\nA = [int(input()) for i in range(N)]\nB = [ [0] * 2 for i in range(N)]\n\nfor...
['Runtime Error', 'Accepted']
['s725753909', 's802583604']
[11544.0, 39392.0]
[333.0, 920.0]
[204, 260]