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 | u021548497 | 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\nfor i in range(N):\n B.append(0)\n B.remove(B[i])\n c = max(B, key=int)\n print(c)\n B = A', 'N = int(input())\nA = []\nfor _ in range(N):\n A.append(int(input()))\n\nmax_A = max(A, key=int)\nmax_A_number = A.index(ma... | ['Wrong Answer', 'Accepted'] | ['s577155573', 's897414859'] | [11052.0, 12520.0] | [2108.0, 534.0] | [177, 265] |
p02971 | u022215787 | 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_l = [ int(input()) for _ in range(n)]\n\nl = []\nr = []\nl_max = 0\nr_max = 0\nfor i in range(n):\n l_max = max(l_max, a_l[i])\n r_max = max(r_max, a_l[-i-1])\n l.append(l_max)\n r.append(r_max)\nfor i in range(n):\n if i == 0:\n t_l = 0\n else:\n t_l = l[i-1]\n if i == n-1:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s142452371', 's234234176', 's370377262'] | [8940.0, 9072.0, 20156.0] | [20.0, 26.0, 514.0] | [370, 371, 387] |
p02971 | u023185908 | 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 math\nimport copy\na = int(input());\nb = [int(input()) for i in range(a)];\nc = 0;\nfirst = max(b);\ng = b.copy();\nh = list(g.index(first));\ndel g[h];\nsecond = max(g);\n\nfor i in range(a):\n if max(b) > b[i]:\n print(first);\n elif first == b[i]:\n print(second);\n', 'impor... | ['Runtime Error', 'Accepted'] | ['s730784030', 's718908047'] | [13080.0, 14560.0] | [338.0, 496.0] | [292, 284] |
p02971 | u024245528 | 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(1,N+1):\n A = int(input())\n A_list.append([i,A])\n\npop_que =[]\nans_list= []\n\nprint(f"A_list:{A_list}")\n\nfor i in range(N):\n pop_que =A_list.pop(0)\n pop_que.append(max(A_list,key=lambda x:x[1]))\n A_list.append(pop_que)\n\n#print(f"A_list[0]:{A_list... | ['Runtime Error', 'Accepted'] | ['s171505798', 's826857123'] | [2940.0, 14112.0] | [17.0, 564.0] | [444, 273] |
p02971 | u024383312 | 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\nn = int(input())\nA = [int(input()) for _ in range(n)]\n\nlerge1, lerge2 = sorted(A)[-2:]\nfor i in range(n):\n if a[i]==m1:\n pritn(m2)\n else:\n print(m1)\n\n', 'n = int(input())\nA = [int(input()) for _ in range(n)]\n\nm2, m1 = sorted(A)[-2:]\nfor i in range(n):\n if A[i]==m1... | ['Runtime Error', 'Accepted'] | ['s933797893', 's496616573'] | [13548.0, 13380.0] | [406.0, 574.0] | [184, 161] |
p02971 | u024609780 | 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(input())\nA = []\nfor i in range(N):\n A.append(int(input()))\nM = sorted(A)\nif M[-1] == M[-2]:\n for i in range(N):\n print(M[-1])\n sys.exit()\nhigh_num = M[-1]\nprint(high_num)\nprint(A)\nfor i in range(N):\n if A[i] == high_num:\n print(M[-2])\n else:\n p... | ['Wrong Answer', 'Accepted'] | ['s368989755', 's248589308'] | [21148.0, 19000.0] | [393.0, 380.0] | [312, 287] |
p02971 | u024807881 | 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\nreadline = stdin.readline\n\n\ndef ns():\n \n return readline().rstrip()\n\n\ndef ni():\n \n return int(ns())\n\n\ndef nf():\n \n return map(int, open(0).read().split())\n\n\ndef main():\n n = ni()\n a = list(nf())\n for i in range(n):\n tmp = a[:]\n t... | ['Runtime Error', 'Accepted'] | ['s955217897', 's050464516'] | [25812.0, 25148.0] | [2105.0, 251.0] | [535, 443] |
p02971 | u025287757 | 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 heapq\nN = int(input())\nA = []\nfor _ in range(N):\n A.append(int(input()))\nA = np.array(A)\nanswer = []\nfor i in range(N):\n A_temp = np.delete(A, i)\n answer.append(heapq.pop(A_temp))\nfor i in range(N):\n print(answer[i])\n', 'import numpy as np\n#import heapq\nN = int(input())\nA... | ['Runtime Error', 'Accepted'] | ['s378285958', 's163836494'] | [21852.0, 21812.0] | [501.0, 1400.0] | [247, 372] |
p02971 | u036479746 | 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\nfrom sys import stdin\nn=int(input())\nA=[int(stdin.readline().rstrip()) for _ in range(n)]\nm=max(A)\nfor j in range(0,n):\n B=copy.copy(A)\n s=A[j]\n A.pop(j)\n print(m)\n A = copy.copy(B)', 'import copy\nfrom sys import stdin\nn=int(input())\nA=[int(stdin.readline().rstrip()) for _ in r... | ['Wrong Answer', 'Accepted'] | ['s174587086', 's732589309'] | [16748.0, 14560.0] | [2104.0, 363.0] | [208, 274] |
p02971 | u038676814 | 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 = [input() for i in range(N)]\nmax_AList = max(AList)\nmax2nd_AList = 0\n\nfor i in range(N) :\n if AList[i] == max_AList :\n if max2nd_AList == 0 :\n max2nd_AList = max(AList[0:i] + AList[i+1:N])\n else :\n print(max2nd_AList)\n else :\n print(... | ['Wrong Answer', 'Accepted'] | ['s236466409', 's806523014'] | [20340.0, 13340.0] | [421.0, 554.0] | [316, 244] |
p02971 | u042385277 | 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 = [map(int, input()split()) for _ in range(N)]\nfor i in range(N) :\n k = A[i]\n del A[i]\n print(max(A))\n A.insert(i, k)\n', 'N = int(input())\nA = [int(input()) for _ in range(N)]\nA_sort = sorted(A)\nfor i in range(N) :\n if a[i] == a[-1] :\n print(a[-2])\n else :\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s142280351', 's436191511', 's446435670'] | [2940.0, 13380.0, 14152.0] | [18.0, 414.0, 568.0] | [149, 168, 184] |
p02971 | u044442911 | 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\n\ndef main():\n N = int(stdin.readline())\n A = [int(input()) for _ in range(N)]\n\n for a in A:\n # if max(A) == a:\n \n # print(new_A[1])\n # else:\n # print(max(A))\n print(max(A))\n\n\nif __name__ == "__main__":\n main()\n', 'f... | ['Wrong Answer', 'Accepted'] | ['s266055887', 's558585145'] | [13076.0, 14108.0] | [2104.0, 497.0] | [318, 348] |
p02971 | u044635590 | 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 = []\naa = []\n\nfor i in range(n):\n ai = int(input())\n a.append(ai)\n aa.append(ai)\n\naa.sort()\nfirsta = aa[0]\nseconda = aa[1]\n\nfor i in range(n):\n if a[i] == firsta:\n print(seconda)\n else:\n print(firsta)\n\n', 'n = int(input())\n\na = []\naa = []\n\nfor ... | ['Wrong Answer', 'Accepted'] | ['s547866534', 's194764825'] | [14120.0, 14124.0] | [580.0, 595.0] | [251, 345] |
p02971 | u044964932 | 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 numpy as np\ninput = sys.stdin.readline\n\n\ndef main():\n N = int(input())\n A = np.array([int(input()) for _ in range(N)])\n\n for j in range(N):\n if j != A.index(max(A)):\n print(np.max(A))\n else:\n ans = [x for i, x in enumerate(A) if i != j]\n ... | ['Runtime Error', 'Accepted'] | ['s160612331', 's997984417'] | [21864.0, 14112.0] | [244.0, 517.0] | [371, 289] |
p02971 | u051928503 | 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\ta.append(int(input()))\nk=max(a)\ncount=0\nfor j in range(N):\n\tif count==1:\n\t\tprint(k)\n\telse:\n\t\tif a[j]==k:\n\t\t\tb=a[:j]+a[j+1:]\n\t\t\tcount=1\n\t\t\tprint(max(b))', 'N=int(input())\na=[]\nfor i in range(N):\n\ta.append(int(input()))\nk=max(a)\ncount=0\nfor j i... | ['Wrong Answer', 'Accepted'] | ['s709622700', 's111081682'] | [14124.0, 15604.0] | [507.0, 555.0] | [191, 211] |
p02971 | u054825571 | 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=[]\nl.append(int(input()))\nl.append(int(input()))\nm1=max(l)\nmx=min(l)\nfor _ in range(N-2):\n l.append(int(input()))\n if l[-1] >= m1:\n m2 = m1\n m1 = l[-1]\n elif l[-1] > m2:\n m2 = l[-1]\nfor i in range(N):\n if l[i] == m1:\n print(m2)\n else:\n print(m1)', 'N=int(input())\... | ['Runtime Error', 'Accepted'] | ['s417848398', 's922035856'] | [16936.0, 16936.0] | [378.0, 371.0] | [282, 282] |
p02971 | u056468316 | 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)]\nl = sorted(a)\nprint(l)\nfor i in a:\n if l[-1] == i:\n print(l[-2])\n else:\n print(l[-1])', 'n = int(input())\na = [int(input()) for _ in range(n)]\nl = sorted(a)\nfor i in a:\n if l[-1] == i:\n print(l[-2])\n else:\n pr... | ['Wrong Answer', 'Accepted'] | ['s586369756', 's797388497'] | [17692.0, 14132.0] | [563.0, 539.0] | [159, 150] |
p02971 | u060694763 | 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\nfor i in range(N):\n b = a[:]\n b.pop(i)\n print(max(b)', 'N = int(input())\na = []\nfor i in range(N):\n a.append(int(input()))\n\nsort = sorted(a)\nm1 = sort[-1]\nm2 = sort[-2]\nif m1 == m2:\n for i in range(N):\n print(m1)\nelse:\n ... | ['Runtime Error', 'Accepted'] | ['s921126165', 's628318927'] | [2940.0, 14240.0] | [17.0, 570.0] | [124, 263] |
p02971 | u062459048 | 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()))\n\nANS = []\nfor i in range(N):\n Alist = A[:i]+A[i+1:]\n ANS.append(max(Alist))\n\nfor i in ANS:\n print(i)', 'N = int(input())\nA = [int(input()) for i in range(N)]\n\nmaxA = max(A)\nmax_in = A.index(max(A))\nANS = [maxA]*N\nANS[max_in] = max(A[:max_in]+A[m... | ['Runtime Error', 'Accepted'] | ['s464680011', 's801098635'] | [3060.0, 15680.0] | [17.0, 500.0] | [158, 180] |
p02971 | u066455063 | 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(i)) for i in range(N)]\n\nfor i in range(N):\n memo = A\n A = A[:i] + A[i+1:]\n print(max(A))\n A = memo\n', 'N = int(input())\nA = [int(input(i)) for i in range(N)]\n\nfor i in range(N):\n ans = A[:i] + A[i+1:]\n print(max(ans))\n', 'N = int(input())\nA = []\n\nfor ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s131047764', 's239147615', 's154567655'] | [15256.0, 18244.0, 14176.0] | [2104.0, 2104.0, 586.0] | [143, 121, 201] |
p02971 | u067694718 | 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)]\nmx = max(a)\nmxi = a.index(mx)\nmx2 = a[:mxi] + a[mxi+1:]\n\nfor i in range(n):\n if i == mxi: print(mx2) \n else: print(mx)\n', 'n = int(input())\na = [int(input()) for i in range(n)]\nmx = max(a)\nmxi = a.index(mx)\nmx2 = a[:mxi] + a[mxi+1:]\n\nfor i in ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s494442225', 's851673858', 's835558551'] | [19452.0, 17144.0, 14124.0] | [489.0, 346.0, 477.0] | [179, 179, 184] |
p02971 | u067986264 | 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. | ['m = max(l)\nans = [m]*n\nif len(set(l)) == 1:\n for i in ans:\n print(i)\nelse:\n x = sorted(set(l))[-2]\n a = l.index(m)\n ans[a] = x\n for i in ans:\n print(i)\n', 'n = int(input())\nl = []\nfor i in range(n):\n l.append(int(input()))\nm = max(l)\nans = [m]*n\nif len(set(l)) == 1 or ... | ['Runtime Error', 'Accepted'] | ['s837911182', 's904085820'] | [3068.0, 20712.0] | [18.0, 535.0] | [181, 269] |
p02971 | u068142202 | 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 = [int(input()) for _ in range(n)]\na.sort()\nfor i in range(n):\n a_copy = copy.deepcopy(a)\n a_copy.pop()\n print(max(a_copy))\n', 'n = int(input())\na = [int(input()) for _ in range(n)]\na_sort = sorted(a, reverse=True)\nfor i in range(n):\n if a[i] == a_sort[0]:\n ... | ['Wrong Answer', 'Accepted'] | ['s325690570', 's878516903'] | [20840.0, 18984.0] | [2206.0, 362.0] | [165, 192] |
p02971 | u072606168 | 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()))\naa = sorted(a)\nc = aa[-1]\nd = aa[-2]\nfor i in a:\n if i == c:\n print(c)\n else:\n print(d)', 'n = int(input())\na = []\nfor i in range(n):\n a.append(int(input()))\naa = sorted(a)\nc = aa[-1]\nd = aa[-2]\nfor i in a:\n if i == c:\n ... | ['Wrong Answer', 'Accepted'] | ['s340043674', 's800575241'] | [14112.0, 14112.0] | [596.0, 543.0] | [163, 163] |
p02971 | u074230519 | 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\nN = int(input())\n\nvalues = [0]*N\nmax_value_count = 0\nmax_value = 0\nnext_max_value = max_value\n\nfor i in range(N):\n in_value = int(input())\n values[i] = in_value\n\n if in_value == max_value:\n max_value_count = max_value_count + 1\n elif in_value > max_value:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s049422325', 's952990885', 's746682565'] | [10868.0, 17756.0, 12508.0] | [404.0, 466.0, 565.0] | [653, 802, 607] |
p02971 | u076917070 | 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. | ['#h = list(map(int, input().split()))\n#r = int(input())\n#n, d = map(int, input().split())\n\nn = int(input())\na = []\n\nfor i in range(n):\n a.append(int(input()))\n\nsa = sorted(a)\nsa.reverse()\n\nh = {}\nfor i in sa:\n h[i] = i\n for j in sa:\n if j != i:\n h[i] = j\n break\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s439797913', 's622895034', 's174743280'] | [21720.0, 14112.0, 14068.0] | [2104.0, 636.0, 557.0] | [341, 334, 357] |
p02971 | u078181689 | 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\nnumset = set(arr)\nmaxval = max(numset)\n\nif len(numset) == 1:\n for i in range(n):\n print(maxval)\nelse:\n numset.remove(maxval)\n semimax = max(numset)\n for i in range(n):\n if arr[i] == maxval and not arr[i] in arr:\n ... | ['Wrong Answer', 'Accepted'] | ['s925899309', 's180067878'] | [17168.0, 17164.0] | [500.0, 530.0] | [361, 438] |
p02971 | u078630793 | 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 abc_134c(N):\n max_1 = (0, 0)\n max_2 = (0, 0)\n for i in range(N):\n buf = int(input())\n if max_2[1] < buf:\n if max_1[1] < buf:\n max_2 = max_1\n max_1 = (i, buf)\n else:\n max_2 = (i, buf)\n\n output = [max_1[1] for _... | ['Wrong Answer', 'Accepted'] | ['s609960560', 's742519192'] | [9364.0, 7776.0] | [355.0, 471.0] | [436, 459] |
p02971 | u082861480 | 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_max = 0\nfor i in range(n):\n a = int(input())\n if a > a_max:\n print(a)\n a_max = a\n else:\n print(a_max)', 'n = int(input())\na_max = 0\ndata = [int(input()) for i in range(n)]\na_max = max(data)\nflag = True if a_max == a_max(data.remove(a_max)) else False\nfor i in range(n):\n i... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s502193286', 's633975548', 's771353992', 's387159810'] | [4468.0, 11052.0, 11052.0, 12532.0] | [1337.0, 340.0, 316.0, 502.0] | [132, 302, 301, 283] |
p02971 | u085035133 | 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())\n\na = [int(input()) for _ in range(n)]\n\nfor i in a:\n print(max(a[:i]+a[i+1:]))\n', '# -*- coding: utf-8 -*-\nn = int(input())\n\na = [int(input()) for _ in range(n)]\n\nmost = max(a)\nmost_idx = a.index(most)\nsecond = max(a[:most_idx] + a[most_idx+1:])\n\nfor i in ran... | ['Wrong Answer', 'Accepted'] | ['s954632111', 's693085878'] | [20008.0, 20156.0] | [2206.0, 331.0] | [122, 227] |
p02971 | u086056891 | 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()))\nb = [0] * n\n\nfor i in reversed(range(n)):\n for j in range(i + 1, n, i + 1):\n x = 1\n k = j\n while k < n:\n x ^= b[k - 1]\n k += j\n if x == a[i]:\n b[i] = 1\n\nprint(sum(b))\nfor i in range(n):\... | ['Runtime Error', 'Accepted'] | ['s396425908', 's018457070'] | [4596.0, 14112.0] | [20.0, 517.0] | [341, 189] |
p02971 | u086503932 | 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\n\nN = int(input())\nA = [int(input()) for _ in range(N)]\n\nB = sorted(A)\nfor i in range(N):\n if A[i] == B[0]:\n print(B[1])\n else:\n print(B[0])', 'import bisect\n\nN = int(input())\nA = [int(input()) for _ in range(N)]\n\nB = sorted(A,reverse=True)\nfor i in range(N):\n if A[i] == B[0]:\n... | ['Wrong Answer', 'Accepted'] | ['s074229223', 's234579359'] | [14112.0, 14112.0] | [533.0, 591.0] | [161, 174] |
p02971 | u094191970 | 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=[-1]+list(map(int,input().split()))\n\nt=((n+1)+2-1)//2\n\nans=[-1]+[0 for i in range(n)]\nans[t:]=a[t:]\n\nfor i in range(t-1,0,-1):\n t_sum=sum(ans[i+i::i])\n if a[i]%2==t_sum%2:\n ans[i]=0\n else:\n ans[i]=1\n\nm=ans.count(1)\nans_l=[]\nfor i in range(n+1):\n if ans[i]==1:\n ans_l.append(i)\np... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s207104768', 's431689595', 's740233053', 's321401432'] | [6320.0, 13320.0, 3064.0, 14112.0] | [27.0, 393.0, 18.0, 543.0] | [330, 233, 232, 145] |
p02971 | u095021077 | 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\ns_max=max(s)\n\nfor i in range(N):\n if s[i]<s_max:\n print(s_max)\n else:\n\tprint(max([s[x] for x in range(i)]+[s[x] for x in range(i+1, N)]))\n', 'N = int(input())\ns = [int(input()) for i in range(N)]\ntemp=s.copy()\ns_max=temp.pop(max(temp))\ns_max2=... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s155013878', 's170850281', 's285322703', 's514991664', 's595183602', 's640096750', 's831618985', 's027779645'] | [2940.0, 3064.0, 2940.0, 3064.0, 23736.0, 2940.0, 2940.0, 24256.0] | [17.0, 18.0, 18.0, 18.0, 2104.0, 17.0, 17.0, 1635.0] | [198, 198, 204, 197, 183, 173, 202, 212] |
p02971 | u095478438 | 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())\n\nnumbers_full = []\nfor _ in range(N):\n numbers_full.append(int(input()))\n\nfor i in range(N):\n numbers_minus1 = numbers_full.copy()\n del numbers_minus1[i]\n print(numbers_full, numbers_minus1, str(max(numbers_minus1)))', 'N = int(input())\nnumber_list = [int(input()) for _ i... | ['Wrong Answer', 'Accepted'] | ['s525799426', 's563153765'] | [148248.0, 14068.0] | [2105.0, 570.0] | [250, 449] |
p02971 | u096514906 | 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\nl = list(map(int, input().split()))\nn = l[0]\nA = np.array(l[1:])\nfor i in range(n):\n m = np.max(A)\n if A[i] == m:\n mask = A != A[i]\n print(np.max(A[mask]))\n else:\n print(m)', 'import numpy as np\nn = int(input())\nA = np.array([int(input()) for i in range(n)])\nidxs = np.argso... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s313983075', 's439353162', 's630405807', 's019431891'] | [13556.0, 21748.0, 21872.0, 21864.0] | [152.0, 1194.0, 1208.0, 1553.0] | [203, 275, 275, 212] |
p02971 | u097317219 | 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_copy = a\nfor j in range(0,n):\n if max(a) = a[j]:\n a_copy.remove(a_copy[j])\n print(max(a_copy))\n else:\n print(max(a))', 'import sys\ninput = sys.stdin.readline\nn = int(input())\na = []\nfor i in range(n):\n a.append(int(input()))\na_max = max... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s064725158', 's762142439', 's556936515'] | [2940.0, 12512.0, 13404.0] | [17.0, 302.0, 327.0] | [183, 239, 223] |
p02971 | u098012509 | 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\nmax_num = max(A)\n\nfor i in range(N):\n if A[i] != max_num:\n print(max_num)\n else:\n print(max(max(A[0:i]),max(A[i + 1:]))\n \n\n', 'N = int(input().rstrip())\nA = []\nfor _ in range(N):\n A.append(int(input().rst... | ['Runtime Error', 'Accepted'] | ['s622029686', 's138157335'] | [2940.0, 14112.0] | [17.0, 587.0] | [217, 225] |
p02971 | u098588273 | 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)]\nm=max(a)\nfor i in range(n):\n if m>a[i]:\n print(m)\n else:\n print(a[i])', 'n=int(input())\na=[input() for _ in range(n)]\nm1=max(a)\nm2=sorted(a)[n-2]\nfor i in range(n):\n if m1>=a[i]:\n print(m1)\n else:\n print(m2)', 'n=int(input())\na=[int(input())... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s249132026', 's938368523', 's388136254'] | [17268.0, 18116.0, 13384.0] | [408.0, 488.0, 531.0] | [122, 142, 152] |
p02971 | u104675693 | 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())\n\nA = [0]*N\n\nfor r in range(N):\n A[r] = int(input())\nElias_A = copy.copy(A)\nA.sort()\nSorted_A = copy.copy(A)\n \nfor r in range(N):\n if N >= 3:\n if A[r] == Sorted_A[N-1]: print(A[r])\n elif A[r] == Sorted_A[N-2]: print(A[r])\n elif A[r] == sorted_A[N-3]: print(A[r])\... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s490920108', 's651658164', 's657228470'] | [16060.0, 16172.0, 13348.0] | [555.0, 2104.0, 599.0] | [468, 181, 212] |
p02971 | u105456682 | 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\nA = list(map(int, input().split()))\n\na = max(A)\nAA = copy.deepcopy(A)\nAA.remove(a)\nb = max(AA)\n\nfor hoge in A:\n if hoge == a:\n print(b)\n else:\n print(a)', 'import copy\nA = list(map(int, input().split))\n\na = max(A)\nAA = copy.deepcopy(A)\nAA.remove(a)\nb = max(AA)\n\nfor hoge in A:\n... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s014262876', 's559735046', 's139272323'] | [3572.0, 3700.0, 14568.0] | [28.0, 28.0, 645.0] | [172, 170, 203] |
p02971 | u106181248 | 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\n\nn = int(input())\na = [int(input()) for i in range(n)]\nb = heapq.nlargest(2, set(a))\nc = [i for i, x in enumerate(a) if x == b[0]] \n\nfor i in range(n):\n if a[i] == c: \n print(b[1]) \n else: \n print(b[0]) \n', 'import heapq\n\nn = int(input())\na = [int(input()) for i in rang... | ['Wrong Answer', 'Accepted'] | ['s725890819', 's962934445'] | [20616.0, 17208.0] | [512.0, 499.0] | [351, 532] |
p02971 | u110580875 | 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)\nprint(b)\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 _ in range(n)]\nb=sorted(a)\n\nfor a in b:\n if a==b[-1]:\n print(b[-2])\n else:\n print(b[-1])', 'n=int(input())\na=[int(inp... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s125872043', 's934650006', 's938080498'] | [17692.0, 13404.0, 14084.0] | [553.0, 557.0, 546.0] | [138, 130, 130] |
p02971 | u112317104 | 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 copy import deepcopy\n\ndef solve():\n N = int(input())\n A = [int(input()) for _ in range(N)]\n B = deepcopy(A)\n B.sort()\n\n for a in A:\n if a != B[-1]:\n print(B[-1])\n else:\n print(B[-2])\n\nprint(solve())', 'from copy import deepcopy\n\ndef solve():\n ... | ['Wrong Answer', 'Accepted'] | ['s957621449', 's493608734'] | [14596.0, 14568.0] | [690.0, 662.0] | [254, 247] |
p02971 | u113107956 | 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)]\nfor i in range(n):\n num=max(a)\n if a.index(num)==i:\n aa=sorted(a)\n print(a[-2])\n else:\n print(num)', 'n=int(input())\na=[int(input()) for _ in range(n)]\nmax_a=max(a)\nindex=a.index(max_a)\na.pop(index)\nfor i in range(n):\n if... | ['Wrong Answer', 'Accepted'] | ['s761593553', 's137901604'] | [18968.0, 16716.0] | [2206.0, 326.0] | [178, 186] |
p02971 | u113827770 | 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 = sorted(a.copy())\nfor i in range(n):\n print(a_sort[-2] if a[i] == a_sort[-1] else a_sort[-2])', 'n = int(input())\na = [int(input()) for i in range(n)]\na_sort = sorted(a.copy())\nfor i in range(n):\n print(a_sort[-2] if a[i] == a_sort[-1] else a... | ['Wrong Answer', 'Accepted'] | ['s161655552', 's293764409'] | [14940.0, 14940.0] | [570.0, 553.0] | [158, 158] |
p02971 | u113831445 | 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\na = np.array([int(input()) for _ in range(n)])\n[print(np.amax(np.amax(a[:i]), np.amax(a[i+1:]))) for i in range(n)]', 'import heapq\n\nn = int(input())\na = [int(input()) for _ in range(n)]\na1, a2 = heapq.nlargest(2, a)\n[print(a1) if _ != a1 else print(a2) for _ in a]'] | ['Runtime Error', 'Accepted'] | ['s563301382', 's679466075'] | [21860.0, 14216.0] | [465.0, 486.0] | [153, 146] |
p02971 | u116233709 | 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()))\nval=max(a)\ninx=a.index(val)\n\nfor i in range(0,n):\n if i==inx:\n del a[inx]\n print(max(a))\n else:\n print(val)\n \n', 'n=int(input())\na=list(map(int,input().split()))\nx=max(a)\ny=a.index(x)\n\nfor i in range(0,n):\n print(x)', 'n=int(input())\na=[]... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s008473728', 's086687780', 's114278382', 's243487933', 's404473039', 's525906788', 's585121776', 's670822666', 's728843968', 's858352121', 's954609875'] | [3060.0, 4540.0, 3060.0, 3824.0, 3060.0, 2940.0, 3060.0, 2940.0, 3060.0, 3060.0, 12532.0] | [17.0, 170.0, 17.0, 2104.0, 17.0, 18.0, 17.0, 17.0, 17.0, 17.0, 520.0] | [170, 102, 179, 122, 158, 156, 158, 174, 158, 178, 180] |
p02971 | u117193815 | 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 x in range(n)]\nll=l\nfor i in range(n):\n l.pop(i)\n print(max(l))\n l.insert(i,ll[i])', 'n = int(input())\nl=[int(input()) for x in range(n)]\nsetl=list(set(l))\nsetl.sort()\nm=max(l)\nprint(m)\nprint(setl)\nprint(l)\nfor i in range(n):\n if len(setl)==1:\n p... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s334778212', 's750935855', 's814401080', 's820571034', 's409144488'] | [11052.0, 19796.0, 17744.0, 11856.0, 19768.0] | [2104.0, 550.0, 597.0, 2104.0, 575.0] | [128, 292, 269, 246, 241] |
p02971 | u119947188 | 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)]\nMAX1=max(A)\ncopyA=A.copy()\ncopyA.remove(MAX)\nMAX2=max(copyA)\nfor i in A:\n if (i==MAX1):\n print(MAX2)\n else:\n print(MAX1)', 'N=int(input())\nA=[int(input()) for i in range(N)]\nMAX1=max(A)\ncopyA=A.copy()\ncopyA.remove(MAX1)\nMAX2=max(copyA)\nfor i in... | ['Runtime Error', 'Accepted'] | ['s128178275', 's836779949'] | [12696.0, 14080.0] | [323.0, 485.0] | [178, 179] |
p02971 | u121192152 | 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\nL = []\nR = []\n\nfor a in A:\n if len(L) == 0:\n L.append(a)\n L.append(max(L[-1]), a)\n\nA.reverse()\nfor a in A:\n if len(R) == 0:\n R.append(a)\n R.append(max(R[-1]), a)\n\nR.reverse()\n\nprint(R[0])\nfor i in ra... | ['Runtime Error', 'Accepted'] | ['s463659041', 's334742196'] | [11052.0, 15636.0] | [360.0, 672.0] | [359, 263] |
p02971 | u121879791 | 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=sorted(a)\nmx=b[-1]\nmx2=b[-2]\nfor i in a:\n if i==mx:\n print(mx2)\n else:\n print(mx)', 'n=int(input())\na=[int(input()) for _ in range(n)]\nb=sorted(a)\nmx=b[-1]\nmx2=b[-2]\nfor i in a:\n if i==mx:\n print(mx2)\n else:\n print(mx)'] | ['Runtime Error', 'Accepted'] | ['s046291030', 's424627854'] | [9128.0, 19180.0] | [21.0, 359.0] | [123, 153] |
p02971 | u123745130 | 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)]\nprint(l)', 'n=int(input())\nl=[int(input()) for _ in range(n)]\n#print(l)\nk=l\nk.sort()\ndic_lst={}\nfor i in l:\n if i not in dic_lst:\n dic_lst[i]=1\n else:\n dic_lst[i]+=1\nfor i in l:\n max_num=max(dic_lst.keys())\n if i<max_num:\n print(max_num)\n... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s320315001', 's676019049', 's806639504', 's098624559'] | [15636.0, 20160.0, 2940.0, 14112.0] | [350.0, 2104.0, 17.0, 546.0] | [58, 339, 134, 132] |
p02971 | u124025116 | 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=[int(input()) for i in range(n)]\n\nfor i in range(n):\n listA=list.remove[i]\n print(max(listA))', 'n=int(input())\nl1=[int(input()) for i in range(n)]\nl2=sorted(l1)\nmax1=l2[-1]\nmax2=l2[-2]\nfor i in l1:\n if i == max1:\n print(max2)\n else:\n print(max1)'] | ['Runtime Error', 'Accepted'] | ['s533603662', 's495587783'] | [11052.0, 14176.0] | [325.0, 517.0] | [115, 157] |
p02971 | u128539234 | 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,r = map(int,input().split())\n\nr = min(r, l+4038)\n\nmin = 99999999\nfor i in range(l,r):\n for j in range(i+1,r+1):\n value = (i*j)%2019\n if min > value:\n min = value\nprint(min)', 'import numpy as np\nn = int(input())\na = [int(input()) for _ in range(n)]\n\n\ni1 = np.argmax(a)\ntemp = a.pop(i1)\n\... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s015660493', 's543998620', 's898831815'] | [3060.0, 22880.0, 24392.0] | [17.0, 835.0, 891.0] | [186, 302, 303] |
p02971 | u130900604 | 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 _ in range(n):\n #b=a[0:_]+a[_+1:n]\n #print(max(b))\n print(max(a[0:_]),max(a[_+1:n]))\n', 'n=int(input())\na=[int(input()) for i in range(n)]\nfor _ in range(n):\n #b=a[0:_]+a[_+1:n]\n #print(max(b))\n print(max(max(a[0:_]),max(a[_+1:n])))\n', 'import nu... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s714544133', 's777052983', 's916731198', 's877891819'] | [11052.0, 11052.0, 26912.0, 25156.0] | [326.0, 325.0, 2109.0, 282.0] | [142, 147, 166, 140] |
p02971 | u134019875 | 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)]\nsorted_a = sorted(a)\nfor i in range(n):\n if a[i] != sorted_a[-1]:\n print(sorted_a[-2])\n else:\n print(sorted_a[-1])\n', 'n = int(input())\na = [int(input()) for _ in range(n)]\nsorted_a = sorted(a)\nfor i in range(n):\n if a[i] != sort... | ['Wrong Answer', 'Accepted'] | ['s626216591', 's673937625'] | [14112.0, 14112.0] | [552.0, 585.0] | [189, 189] |
p02971 | u134341470 | 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 x=int(input())\n l.append(x)\nx=sorted(l)\nfor i in range(n):\n if l[i]==x:\n print(x[-2])\n else:\n print(x[-1])', 'n=int(input())\nl=[]\nfor i in range(n):\n x=int(input())\n l.append(x)\nx=max(l)\nfor i in range(n):\n if l[i]==x:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s844341038', 's944066950', 's269270070'] | [14112.0, 12512.0, 14112.0] | [586.0, 533.0, 574.0] | [172, 215, 176] |
p02971 | u135116520 | 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()\nfor i in range(N):\n A=int(input())\n list.append(A)\nfor j in range(N):\n del list[j]\n print(max(list))\n\n ', 'N=int(input())\nlist=[]\nfor i in range(N):\n A=int(input())\n list.append(A)\nl=sorted(list,reverse=True)\nk=set(list)\nA_1=k[0]\nA_2=k[1]\nfor j in range(N):\n if list[j]!=A_1:\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s075028029', 's229952036', 's487818690', 's531354380', 's802340667', 's934478261', 's998973147'] | [2940.0, 19216.0, 2940.0, 11052.0, 11160.0, 11052.0, 14112.0] | [17.0, 447.0, 17.0, 337.0, 2104.0, 2108.0, 588.0] | [122, 214, 121, 141, 127, 129, 197] |
p02971 | u137542041 | 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\n\nl_max = -1\n\nr_max = max(lst[1:])\nprint(r_max)\n\nflag = False\n\nfor i in range(1, n - 1):\n if lst[i] == r_max:\n r_max = max(lst[i + 1:])\n\n if lst[i] > l_max:\n l_max = lst[i]\n\n print(max(l_max, r_max))\n\nif lst[n - 1] > l_... | ['Wrong Answer', 'Accepted'] | ['s401627868', 's159884623'] | [12976.0, 21844.0] | [2104.0, 1470.0] | [340, 363] |
p02971 | u139315183 | 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\ntmp = A.copy();\ntmp.sort()\nmax1_A = tmp[-1];\nmax2_A = tmp[-2];\nmax_count = A.count(max1_A);\n\n\nif max_count > 1:\n for i in range(N):\n print(max1_A)\n\nelse:\n for i in range(N):\n if A[i] < max1_A:\n print(max1_A)\n else:\n print(m... | ['Wrong Answer', 'Accepted'] | ['s967690765', 's683048968'] | [14112.0, 14112.0] | [556.0, 554.0] | [420, 422] |
p02971 | u140594752 | 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\ns = copy.copy(a)\ns.sort()\n\nprint(s)\n\nfor l in a:\n if(l != s[-1]):\n print(s[-1])\n else:\n print(s[-2])\n\n', 'import copy\n\nN = int(input())\na = []\nfor i in range(N):\n a.append(int(input()))\n\ns = copy.copy(a... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s060462224', 's149530860', 's328635876', 's729470440', 's639337460'] | [18204.0, 18204.0, 18204.0, 18204.0, 14564.0] | [593.0, 586.0, 585.0, 574.0, 700.0] | [192, 192, 192, 190, 209] |
p02971 | u142415823 | 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, m2 = sorted(A, reversed=True)[0:2]\nfor a in A:\n print(m2 if a == m1 else m1)', 'N = int(input())\nA = [int(input()) for _ in range(N)]\n\nm1, m2 = sorted(A, reverse=True)[0:2]\nfor a in A:\n print(m2 if a == m1 else m1)'] | ['Runtime Error', 'Accepted'] | ['s668124630', 's758275355'] | [18548.0, 18948.0] | [248.0, 343.0] | [138, 137] |
p02971 | u143903328 | 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. | ['first = 1\nsecond = 1\ns = 0\nn=int(input())\nx = []\nfor i in range(1,n):\n input(s)\n if first <= s:\n second = first\n first = s\n if second <= s:\n second = s\n x.append(s)\n\nfor i in range(0,n-1):\n if x[i] == first:\n print(second)\n else:\n print(first)', '... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s249287063', 's535354378', 's053498793'] | [5908.0, 12532.0, 12512.0] | [1250.0, 561.0, 555.0] | [296, 312, 309] |
p02971 | u151503168 | 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)]\nm1,m2 = sorted(A)[-2:]\n\nfor i in A:\n print(m2 if i==m1 else m1)', 'N = int(input())\nA = [int(input()) for _ in range(N)]\nm1,m2 = sorted(A)[-2:]\n\nfor i in A:\n print(m1 if i==m2 else m2)'] | ['Wrong Answer', 'Accepted'] | ['s880866945', 's471555365'] | [13380.0, 13404.0] | [524.0, 521.0] | [120, 120] |
p02971 | u152283104 | 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 copy\ndef input():\n\treturn sys.stdin.readline().rstrip()\ndef main():\n\tN = int(input())\n\tA = [int(input()) for _ in range(N)]\n\tB = list(set(A))\n\tprint(A.count(B[-1]))\n\tif (len(B) == 1) or (A.count(B[-1]) > 1):\n\t\tfor i in range(N):\n\t\t\tprint(B[0])\n\telse :\n\t\tfor i in range(N):\... | ['Wrong Answer', 'Accepted'] | ['s315711456', 's605340148'] | [17680.0, 17676.0] | [285.0, 301.0] | [390, 367] |
p02971 | u156815136 | 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 statistics import median\n#import collections\n#aa = collections.Counter(a) # list to list\n#from itertools import combinations # (string,3) 3回\n#\n#\n\n#\n#\n\nmod = 10**9 + 7\n\ndef readInts():\n return list(map(int,input().split()))\ndef main():\n n = int(input())\n \n \n #A = []\n \n # ... | ['Runtime Error', 'Accepted'] | ['s338350837', 's985475668'] | [18860.0, 15712.0] | [260.0, 634.0] | [826, 825] |
p02971 | u158344095 | 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\nm1 = max(a)\n\n\nm2 = sorted(a)[n-2]\nprint(m2)\n\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 i in range(n)]\n\n\nm1 = max(a)\n\n\nm2 = sorted(a)[n-2]\n\nfor i in range(n):\n if a... | ['Wrong Answer', 'Accepted'] | ['s379729216', 's464743183'] | [13404.0, 13968.0] | [547.0, 558.0] | [239, 229] |
p02971 | u163320134 | 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 _ in range(n)]\nm1=max(arr)\narr2=sorted(arr,reverse=True)\nm2=0\ncnt=0\nfor val in arr2:\n if val==m1:\n cnt+=1\n else:\n m2=val\n break\nelse:\n m2=m1\nprint(cnt)\nfor val in arr:\n if cnt>=2:\n print(m1)\n else:\n if val==m1:\n print(m2)\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s000668419', 's866449713'] | [14112.0, 15656.0] | [543.0, 675.0] | [309, 265] |
p02971 | u163421511 | 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_1 = 0\nmax_2 = 0\nmax_index = 0\n\nfor i in range(n):\n \titem = int(input())\n if item >= max_1:\n max_1, max_2 = item, max_1\n max_index = i\n elif item > max_2:\n max_2 = item\n\nfor i in range(n):\n ans = max_2 if i == max_index else max_1\n print(ans)\n\n'... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s087111481', 's469146050', 's676665442', 's045953864'] | [8956.0, 8908.0, 8840.0, 9252.0] | [26.0, 29.0, 25.0, 349.0] | [298, 299, 297, 300] |
p02971 | u169138653 | 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[i] for i in range(n)]\nsorted(b)\nm=b[n-1]\nm2=b[n-2]\nfor i in range(n):\n if a[i]!=m:\n print(m)\n else:\n print(m2)', 'import heapq\nn=int(input())\na=[-int(input()) for i in range(n)]\nheapq.heapify(a)\nfor i in range(n):\n x=a[:i]+a[i+1:]\n print... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s063523041', 's563250921', 's892176552', 's729037507'] | [14916.0, 17672.0, 17296.0, 14176.0] | [546.0, 2104.0, 2104.0, 563.0] | [173, 144, 127, 172] |
p02971 | u170319289 | 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 i in range(n):\n a = int(input())\n A.append(a)\n\nmaxa = max(A)\n\ncopy = [l for l in A if l != maxa]\n\nmaxa2 = max(copy)\n\nfor i in A:\n if i == max:\n print(maxa2)\n else:\n print(maxa)', 'n = int(input())\n\nA = []\n\nfor i in range(n):\n a = int(in... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s347359897', 's687092434', 's701041361', 's964113749'] | [14060.0, 14060.0, 14060.0, 14080.0] | [526.0, 2104.0, 498.0, 541.0] | [232, 293, 228, 230] |
p02971 | u170765582 | 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[0]*int(input())]\nb=max(a)\nif a.count(b)>1:print('\\n'.join([b for i in range(len(a))]))\nelse:\n c=[b for i in a]\n c[a.index(b)]=max(a[:a.index(b)]+a[a.index(b)+1:])", "a=[int(input())for i in[0]*int(input())]\nb=max(a)\nif a.count(b)>1:print('\\n'.join([str(b)]*len(a)))\nelse:\n c=[b fo... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s171054335', 's471918932', 's516840755'] | [15604.0, 15580.0, 26460.0] | [343.0, 327.0, 378.0] | [188, 177, 216] |
p02971 | u172337086 | 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()\n n = int(n)\n\n li = [int(input()) for i in range(n)]\n m = max(li)\n for j in range(n):\n if m < li[j]:\n print(m)\n else:\n print(max(li))', 'n = input()\nn = int(n)\n\nli = [int(input()) for i in range(n)]\nm = max(li)\nfor j in range(n):\n if m < li[j]:\n print... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s025020607', 's419577333', 's933813886', 's956449024'] | [2940.0, 11052.0, 13080.0, 13404.0] | [19.0, 2104.0, 2104.0, 570.0] | [180, 148, 166, 166] |
p02971 | u172785970 | 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)]\nfor i in range(n):\n\tb=copy.copy(a)\n\tdel b[i]\n\tprint(max(b),b,i)', 'n=int(input())\na=[int(input()) for i in range(n)]\nb=sorted(a,reverse=True)\nx,y=b[0],b[1]\nz=a.index(x)\nfor i in range(n):\n\tif i==z:\n\t\tprint(y)\n\telse:\n\t\tprint(x)'] | ['Wrong Answer', 'Accepted'] | ['s309283492', 's292136606'] | [145972.0, 14108.0] | [2105.0, 552.0] | [125, 159] |
p02971 | u173178698 | 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\n\nfor i in range(N):\n A[i] = int(input())\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', 'N = int(input())\nA = [0]*N\n\nfor i in range(N):\n A[i] = int(input())\n\nB = sorted(A,reverse=True)\n\nfor i... | ['Wrong Answer', 'Accepted'] | ['s562448832', 's833171373'] | [14076.0, 14076.0] | [562.0, 568.0] | [188, 187] |
p02971 | u176674210 | 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:utf8 -*-\n\nn = int(input())\nl = [int(input()) for _ in range(n)]\nm = sorted(l)[-1]\nfor i in range(n):\n if l[i] != m:\n print(m)\n else:\n print(max(l[:i] + l[:i+1]))', '# -*- coding:utf8 -*-\n\nn = int(input())\nl = [int(input()) for _ in range(n)]\nm = max(l)\nn = sorted(l)[-2]\... | ['Wrong Answer', 'Accepted'] | ['s505311524', 's579272783'] | [18556.0, 13404.0] | [2108.0, 529.0] | [194, 176] |
p02971 | u178403405 | 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 = []\nfor n in range(N):\n a = int(input())\n A.append(a)\n\nm = max(A)\nflag = 1\nfor n in range(N):\n if A[n] == m and flag == 1:\n print(A[n])\n flag = 0\n \n print(m)', 'import copy\n\nN = int(input())\n\nA = []\nfor n in range(N):\n a = int(input())\n A.ap... | ['Wrong Answer', 'Accepted'] | ['s545277467', 's060617830'] | [12532.0, 14684.0] | [547.0, 651.0] | [207, 281] |
p02971 | u181195295 | 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 = list(map(int,inpur().split()))\n\nlis = sorted(li)\nfor i in range(N):\n if lis[-1] == li[i]:\n print(lis[-2])\n else: print(lis[-1])\n \n', 'N = int(input())\nli = list(map(int,inpur().split()))\n\nlis = li.sorted()\nfor i in range(N):\n if lis[-1] == li[i]:\n print(lis[-2])\n els... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s112790782', 's365550425', 's800226799', 's815784151', 's058649743'] | [3060.0, 3060.0, 11052.0, 2940.0, 14112.0] | [17.0, 19.0, 2104.0, 17.0, 566.0] | [160, 160, 159, 160, 162] |
p02971 | u183657342 | 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())\nA = np.array(list(int(input()) for i in range(n)))\nA_max = np.array([max(A)]*n)\nA_dif = A - A_max\nfor i in range(n):\n if A_dif[i]<0:\n print(A_max)\n else:\n A_copy = A.copy()\n A_del = np.delete(A_copy, i)\n print(max(A_del))', 'import num... | ['Wrong Answer', 'Accepted'] | ['s594937742', 's456589987'] | [23356.0, 21732.0] | [2109.0, 1340.0] | [292, 232] |
p02971 | u188244611 | 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. | ['# ABC 134, C -\nfrom operator import itemgetter\n\nn = int(input())\n\nA = []\nfor i in range(n):\n A.append(int(input()))\n\nB = sorted(A)\nmaxima, maxima_ind = B[len(B)-1], len(B)-1\nsec_maxima, sec_maxima_ind = B[len(B)-2], len(B)-2\n\n\n\n\nfor i in range(n):\n if i == maxima_ind:\n print(sec_maxima)... | ['Wrong Answer', 'Accepted'] | ['s067078880', 's773566543'] | [14160.0, 14108.0] | [586.0, 609.0] | [335, 301] |
p02971 | u188817425 | 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 = [int(input()) for i in range(n)]\nmax_a_num = a.count(max(a))\nb = sorted(a)\nm1, m2 = b[0], b[1]\nfor i in range(n):\n if max_a_num == 1:\n if a[i] == m1:\n print(m2)\n else:\n print(m1)\n else:\n print(m2)\n', 'n = int(input())\na = [int(input()) for ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s228028262', 's262608578', 's880642665'] | [23116.0, 148180.0, 24184.0] | [717.0, 2104.0, 699.0] | [259, 103, 273] |
p02971 | u188827677 | 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\nx = sorted(a, reverse = True)\n \nmax = x[0]\ncount = x.count(max)\nfor i in range(n):\n if a[i] == max:\n print(max) \n else:\n print(x[1])\n ', 'n = int(input())\na = [int(input()) for _ in range(n)]\n\nl = sorted(a, reverse=... | ['Wrong Answer', 'Accepted'] | ['s039447663', 's684693573'] | [14076.0, 18976.0] | [565.0, 364.0] | [220, 151] |
p02971 | u189479417 | 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()))\nA.sort()\nA.reverse()\nfor i in range(N):\n if A[i]==A[0]:\n print(A[1])\n else:\n print(A[0])', 'N = int(input())\nA = []\nfor i in range(N):\n A.append(int(input()))\nB = A[:]\nB.sort()\nB.reverse()\nfor i in range(N):\... | ['Wrong Answer', 'Accepted'] | ['s952907958', 's891428468'] | [12512.0, 14112.0] | [618.0, 604.0] | [178, 187] |
p02971 | u189487046 | 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 = []\nfor _ in range(n):\n A.append(int(input()))\n\nleftA = [0]\ntmp = A[0]\nfor a in A:\n tmp = max(tmp, a)\n leftA.append(tmp)\nprint(leftA)\n\nrightA = deque([0])\ntmp = A[-1]\nfor a in reversed(A):\n tmp = max(tmp, a)\n rightA.appendleft(tmp)\nr... | ['Wrong Answer', 'Accepted'] | ['s224279085', 's537917341'] | [23404.0, 16080.0] | [1475.0, 1430.0] | [398, 402] |
p02971 | u192088280 | 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 = []\n for n in range(N):\n A.append(int(input()))\n\n A_cp = sorted(A)\n print(id(A_cp), id(A))\n max1_A = A_cp.pop(-1)\n max2_A = max(A_cp)\n for a in A:\n if a == max1_A:\n print(max2_A)\n else:\n print(max1_A)\n ... | ['Wrong Answer', 'Accepted'] | ['s907548001', 's080493704'] | [14108.0, 14112.0] | [501.0, 543.0] | [362, 335] |
p02971 | u200527996 | 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 = []\ntmp = 0\nfor _ in range(N):\n A.append(int(input()))\n for j in range(N):\n tmp = A.pop(j)\n print(max(A))\n A.insert(j,tmp)\n', 'N = int(input())\nA = [int(input()) for _ in range(N)]\nif N == 2:\n for j in A[::-1]:\n print(j)\nelse:\n tmp = sorted(A)... | ['Runtime Error', 'Accepted'] | ['s754178640', 's476595956'] | [2940.0, 14136.0] | [17.0, 558.0] | [170, 267] |
p02971 | u201856486 | 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\nimport sys\n\n# import math\nimport numpy as np\n# from fractions import gcd\n# import itertools\n\n"""Template"""\n\n\nclass IP:\n \n def __init__(self):\n self.input = sys.stdin.readline\n\n def I(self):\n \n return int(self.input())\n\n def S(self):\n \n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s255266788', 's555976503', 's380157648'] | [21908.0, 15732.0, 14208.0] | [248.0, 511.0, 283.0] | [4823, 151, 133] |
p02971 | u202570162 | 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 = []\nprint('n a',n,a)\nfor i in range(n):\n\ta.append(int(input()))\nprint('As',a)\nmax1 = max(a)\nlocation1 = a.index(max1)\nprint('1st MAX',max1,'INDEX',location1)\na.remove(a[location1])\nmax2 = max(a)\nprint('2nd MAX',max2)\nif max1 == max2:\n print('1=2')\n for i in range(n):\n ... | ['Runtime Error', 'Accepted'] | ['s450035208', 's508866712'] | [3064.0, 12520.0] | [18.0, 520.0] | [446, 605] |
p02971 | u203022424 | 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()))\namax = max(a)\namax_id = a.index(amax)\namax2 = max(a.pop(amax_id))\nfor i in range(n):\n if i == amax_id:\n print(amax2)\n else:\n print(amax)', 'n = int(input())\na = []\nfor i in range(n):\n a.append(int(input()))\namax = max(a)\namax... | ['Runtime Error', 'Accepted'] | ['s710100526', 's683256714'] | [11052.0, 12532.0] | [356.0, 496.0] | [212, 219] |
p02971 | u211160392 | 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))\nA.sort()\nfor i in A:\n if i == A[-1]:\n print(A[-2])\n else:\n print(A[-1])', 'N = int(input())\nA = list(int(input()) for i in range(N))\nB = sorted(A)\nfor i in A:\n if i == B[-1]:\n print(B[-2])\n else:\n print(B[-... | ['Wrong Answer', 'Accepted'] | ['s701066771', 's927084259'] | [12524.0, 14120.0] | [613.0, 552.0] | [149, 154] |
p02971 | u212919262 | 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_ = sorted(l)\nfor Ai in l:\n if l_[0] == Ai:\n print(l_[1])\n else:\n print(l_[0])', 'N = int(input())\nl = [int(input()) for i in range(N)]\nfor i, Ai in enumerate(l):\n l_ = sorted(l)\n if l_[0] == Ai:\n print(l_[1])\n else:\n print(l_[0])',... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s186778152', 's617940935', 's992350493'] | [14112.0, 15604.0, 14112.0] | [522.0, 2104.0, 571.0] | [141, 157, 144] |
p02971 | u215315599 | 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()))\ntmp = sorted(a)\nmx = max(a)\ncnt = a.count(mx)\n\nfor t in a:\n if t == mx and -cnt-1 > len(a):\n print(tmp[-cnt-1])\n else:\n print(mx) ', 'n = int(input())\na = []\nfor _ in range(n):\n a.append(int(input()))\nb = a[... | ['Wrong Answer', 'Accepted'] | ['s820108565', 's295579716'] | [14112.0, 14076.0] | [575.0, 518.0] | [222, 200] |
p02971 | u224119985 | 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=[]\nm1=0\nm2=0\nfor i in range(n):\n a.append(int(input()))\n if a>m1:\n m2=m1\n m1=a\n index=i\n elif m1==a:\n m2=a\n elif a>m2:\n m2=a\nfor i in range(n):\n if i==index:\n print(m2)\n else:\n print(m1)', 'n=int(input())\na=[]\nm1=0... | ['Runtime Error', 'Accepted'] | ['s443795802', 's094831843'] | [3064.0, 12520.0] | [17.0, 579.0] | [270, 299] |
p02971 | u229518917 | 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)]\nD=sorted(A)\nprint(D)\nnum=max(D)\nnum2=D[-2]\nfor i in range(N):\n if A[i]==num:\n print(num2)\n else:\n print(num)', 'N=int(input())\nA=[int(input()) for i in range(N)]\nD=sorted(A)\nnum=max(D)\nnum2=D[-2]\nfor i in range(N):\n if A[i]==num:... | ['Wrong Answer', 'Accepted'] | ['s678297983', 's419545294'] | [17692.0, 14108.0] | [571.0, 556.0] | [178, 169] |
p02971 | u234582237 | 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=input()\nn=int(n)\nA=[]\nfor i in range(n):\n A.append(input())\na=[int(j) for j in A]\na_copy=copy.deepcopy(a)\nanswer=[]\nfor i in range(n):\n a.pop(i)\n answer.append(max(a))\n a=copy.deepcopy(a_copy)\nprint(answer)', 'import copy\nn=int(input())\na=[int(input()) for i in range(n)]\na_copy=copy.... | ['Wrong Answer', 'Accepted'] | ['s989007102', 's577988711'] | [28576.0, 16156.0] | [2105.0, 728.0] | [224, 309] |
p02971 | u237316771 | 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\n\nn = int(input())\na = [int(input()) for _ in range(n)]\nm1, m2 = heapq.nlargest(2, a)\nfor ai in a:\n print(ai if ai != m1 else m2)\n', 'import heapq\n \nn = int(input())\na = [int(input()) for _ in range(n)]\nm1, m2 = heapq.nlargest(2, a)\nfor ai in a:\n print(m1 if ai != m1 else m2)'] | ['Wrong Answer', 'Accepted'] | ['s183541096', 's876487476'] | [12552.0, 12552.0] | [518.0, 491.0] | [143, 143] |
p02971 | u243755204 | 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()))\nmax = max(A)\nmax2 = sorted(A)[-2]\nprint(A)\nif max == max2:\n for i in A:\n print(max)\nelse:\n for i in A:\n if i == max:\n print(max2)\n else:\n print(max)', 'N = int(input())\nA = []\nfor i ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s149172708', 's292974155', 's548183676', 's731385012', 's885573981', 's867928742'] | [16400.0, 16400.0, 13380.0, 13760.0, 13828.0, 13404.0] | [584.0, 578.0, 554.0, 2105.0, 2104.0, 605.0] | [267, 191, 182, 225, 209, 258] |
p02971 | u244434589 | 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 = max(l)\nc = a.index(b)\nfor i in range(n):\n if i == c:\n print(max(sorted(a)[:n-1]))\n else:\n print(b)', 'n=int(input())\na = [int(input()) for _ in range(n)]\nb = max(a)\nc = a.index(b)\nfor i in range(n):\n ... | ['Runtime Error', 'Accepted'] | ['s024121392', 's624700098'] | [16928.0, 19980.0] | [247.0, 359.0] | [198, 198] |
p02971 | u253952966 | 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 = []\nfor _ in n:\n an.append(int(input()))\nmaxl = [an[0]]\nmaxr = [an[-1]]\nfor a in an[1:]:\n maxl.append(max(maxl[-1], a))\nfor a in an[:-2:-1]:\n maxr.insert(0, max(maxr[0], a))\n\nprint(maxr[1])\nfor i in range(1, n-1):\n print(max(maxl[i-1], maxr[i+1]))\nprint(maxl[n-2])', 'n = int(inp... | ['Runtime Error', 'Accepted'] | ['s893010419', 's189000054'] | [3064.0, 17168.0] | [17.0, 679.0] | [289, 315] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.