| 模型 | 模型答案 | 正确答案 |
|---|---|---|
| 金声玉亮2.0 | ```python # YOUR CODE HERE import sys input = sys.stdin.read data = input().split() N = int(data[0]) A = list(map(int, data[1:])) max_val = max(A) second_max = float('-inf') for num in A: if num != max_val: second_max = max(second_max, num) print(second_max) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| deepseek-r1 | ```python n = int(input()) a = list(map(int, input().split())) max_val = max(a) filtered = [x for x in a if x < max_val] print(max(filtered)) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| gpto1 | ```python # YOUR CODE HERE N = int(input()) A = list(map(int, input().split())) max_A = max(A) A = [x for x in A if x != max_A] print(max(A)) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| gpt-4o-2024-08-06 | ```python # YOUR CODE HERE import sys def main(): input = sys.stdin.read data = input().split() N = int(data[0]) A = list(map(int, data[1:])) # Find the largest number largest = max(A) # Filter out the largest number and find the largest among the rest filtered = [x for x in A if x != largest] second_largest = max(filtered) print(second_largest) main() ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| DeepSeek-Coder-V2-Lite-Instruct | ```python # YOUR CODE HERE def find_second_largest(N, A): max_val = max(A) second_max_val = float('-inf') for num in A: if num != max_val and num > second_max_val: second_max_val = num return second_max_val # Read input import sys input = sys.stdin.read data = input().split() N = int(data[0]) A = list(map(int, data[1:])) # Find and print the second largest number print(find_second_largest(N, A)) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| Meta-Llama-3.1-405B-Instruct-Turbo | ```python import sys def solve(): n = int(input()) a = list(map(int, input().split())) max_val = max(a) a = [x for x in a if x != max_val] print(max(a)) if __name__ == "__main__": t = 1 for _ in range(t): solve() ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| Meta-Llama-3.1-70B-Instruct-Turbo | ```python # Read the number of integers n = int(input()) # Read the integers a = list(map(int, input().split())) # Find the maximum integer max_a = max(a) # Find the maximum integer that is not the largest max_not_largest = max([x for x in a if x != max_a]) # Print the result print(max_not_largest) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| Qwen2-72B-Instruct | ```python N = int(input()) A = list(map(int, input().split())) A.sort() max_val = A[-1] second_max = 0 for i in range(N-1): if A[i] < max_val and A[i] > second_max: second_max = A[i] print(second_max) ``` ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| baichuan4 | ```python # YOUR CODE HERE import sys # Read the number of integers N = int(sys.stdin.readline().strip()) # Read the integers numbers = list(map(int, sys.stdin.readline().strip().split())) # Find the maximum number max_number = max(numbers) # Find the largest number that is not the maximum largest_non_max = max(num for num in numbers if num != max_number) # Print the result print(largest_non_max) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| doubao | ```python N = int(input()) A = list(map(int, input().split())) max_val = max(A) A.remove(max_val) print(max(A)) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| gpto1 | ```python # YOUR CODE HERE N = int(input()) A = list(map(int, input().split())) max_A = max(A) A = [x for x in A if x != max_A] print(max(A)) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| kimi | ```python # YOUR CODE HERE n = int(input()) a = list(map(int, input().split())) a.sort() max_val = a[-1] a = list(filter(lambda x: x != max_val, a)) print(max(a)) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| minimax | ```python # YOUR CODE HERE N = int(input()) A = list(map(int, input().split())) max_value = max(A) second_largest = max([x for x in A if x != max_value]) print(second_largest) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| wenxinyiyan | ```python # Read the number of integers N = int(input()) # Read the integers and store them in a list integers = list(map(int, input().split())) # Find the maximum value in the list max_value = max(integers) # Remove all occurrences of the maximum value from the list integers_without_max = [x for x in integers if x != max_value] # Find the maximum value among the remaining integers answer = max(integers_without_max) # Print the answer print(answer) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| zhipu | ```python # YOUR CODE HERE def main(): import sys input = sys.stdin.read data = input().split() N = int(data[0]) A = list(map(int, data[1:])) # Find the maximum value in the list max_value = max(A) # Filter out the maximum value and find the largest among the remaining values filtered_values = [x for x in A if x != max_value] result = max(filtered_values) # Print the result print(result) if __name__ == "__main__": main() ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |
| deepseek-v3 | ```python # YOUR CODE HERE N = int(input()) A = list(map(int, input().split())) max_A = max(A) second_max = -1 for num in A: if num < max_A and num > second_max: second_max = num print(second_max) ``` |
[{"input": "5\n2 1 3 3 2\n", "output": "2\n", "testtype": "stdin"}, {"input": "4\n4 3 2 1\n", "output": "3\n", "testtype": "stdin"}, {"input": "8\n22 22 18 16 22 18 18 22\n", "output": "18\n", "testtype": "stdin"}] |