QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#144229#3206. Acperiencesomeaccaccount0 867ms26088kbPython3344b2023-08-21 15:59:042023-08-21 16:00:12

Judging History

This is the latest submission verdict.

  • [2023-08-21 16:00:12]
  • Judged
  • Verdict: 0
  • Time: 867ms
  • Memory: 26088kb
  • [2023-08-21 15:59:04]
  • Submitted

answer

import sys
from fractions import Fraction
from statistics import pvariance

input = sys.stdin.readline

for _ in range(int(input())):
    n = int(input())
    arr = list(map(int, input().split()))
    for i in range(len(arr)):
        arr[i] *= n
    ans = Fraction(pvariance(arr), n)
    print(f'{ans.numerator}/{ans.denominator}')

详细

Test #1:

score: 0
Wrong Answer
time: 867ms
memory: 26088kb

input:

393
4
1 2 3 4
4
2 2 2 2
5
5 6 2 3 4
10
0 0 1 -1 -1 1 -1 1 -1 -1
10
-1 -1 -1 1 1 0 1 -1 -1 1
10
1 1 0 -1 0 1 0 1 -1 -1
10
0 0 0 1 -1 -1 1 1 1 1
10
-1 1 -1 -1 1 0 1 -1 -1 0
10
1 1 0 -1 1 -1 -1 -1 0 1
10
1 0 1 1 -1 -1 0 0 0 -1
10
-1 1 -1 -1 0 0 -1 1 1 1
10
0 -1 -1 0 -1 0 1 1 1 0
10
0 1 1 0 1 0 -1 1 1 1...

output:

5/1
0/1
10/1
38/5
89/10
69/10
61/10
38/5
8/1
6/1
8/1
6/1
9/2
28/5
49/10
61/10
69/10
69/10
38/5
9/2
69/10
49/10
28/5
28/5
28/5
49/10
28/5
6/1
38/5
28/5
41/10
69/10
61/10
69/10
69/10
18/5
81/10
32/5
89/10
12/5
61/10
8/1
28/5
69/10
89/10
49/10
49/10
22/5
61/10
69/10
69/10
61/10
61/10
6/1
49/10
12/5
8/1...

result:

wrong answer 4th lines differ - expected: '8/5', found: '38/5'