QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#693110#8340. 3 SumBambi#RE 0ms0kbPython3331b2024-10-31 15:32:342024-10-31 15:32:36

Judging History

你现在查看的是最新测评结果

  • [2024-10-31 15:32:36]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-10-31 15:32:34]
  • 提交

answer

def solve():
    n, k = map(int, input().split())
    m = pow(10, k) - 1
    a = list(map(int, input().split()))
    a = [x % m for x in a]
    d = {}
    ans = 0
    for i in range(n):
        for j in range(i, n):
            d[a[j]] += 1
            ans += d[((m - a[i] - a[j]) % m + m) % m]
    print(ans)

solve()

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Dangerous Syscalls

input:

4 1
0
1
10
17

output:


result: