/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 40ms 18.145 MiB
#2 Accepted 39ms 17.914 MiB
#3 Accepted 41ms 17.996 MiB
#4 Accepted 40ms 18.094 MiB
#5 Wrong Answer 60ms 19.242 MiB
#6 Wrong Answer 57ms 18.992 MiB

Code

# ruff: noqa: E731, E741
from collections import deque
import sys

read = sys.stdin.readline
input = lambda: read().rstrip()
ir = lambda: int(read())
rir = lambda: range(int(read()))
mir = lambda: map(int, read().split())
lmir = lambda: list(map(int, read().split()))


def solve():
    n = ir()
    a = sorted(mir())
    # cur = 0
    # res = 0
    # for _ in range(n // 2):
    #     cur += a.pop()
    #     cur -= a.pop()
    #     res = max(res, cur)
    print(a.pop() - a.pop())


def main():
    for _ in rir():
        solve()


def test():
    pass


if __name__ == "__main__":
    if sys.stdin.isatty():
        test()
    else:
        main()

Information

Submit By
Type
Submission
Problem
P1208 C. Game on Integer
Contest
Educational Round 1
Language
PyPy 3 (Python 3.9.18 PyPy 7.3.15)
Submit At
2025-07-14 15:47:48
Judged At
2025-07-14 15:47:48
Judged By
Score
5
Total Time
60ms
Peak Memory
19.242 MiB