QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#683489#8340. 3 Sumucup-team3519#TL 8ms10648kbPython3447b2024-10-27 21:25:562024-10-27 21:25:56

Judging History

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

  • [2024-10-27 21:25:56]
  • 评测
  • 测评结果:TL
  • 用时:8ms
  • 内存:10648kb
  • [2024-10-27 21:25:56]
  • 提交

answer

mod = 444445555566666677

n, k = map(int, input().split())

a = []

# print(a)

M = 10**k - 1

for i in range(0, n) : 
    tmp = int(input())
    tmp %= M
    tmp %= mod
    a.append(tmp)

ans = 0

for i in range(n) : 
    for j in range(i, n) : 
        for k in range(j, n) : 
            tmp = (a[i] + a[j] + a[k]) % mod
            ans += tmp == 0 or tmp == M or tmp == (M * 2) % mod or tmp == (M * 3) % mod

print(ans)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 8ms
memory: 10648kb

input:

4 1
0
1
10
17

output:

3

result:

ok 1 number(s): "3"

Test #2:

score: -100
Time Limit Exceeded

input:

500 859
7118711592236878297922359501613604144948355616986970837340677671376753603836852811886591300370143151943368529129749813118476151865844255212534355441611481420938483178075143062691345257288242460282715389758789648541099090735875617822348551942134616963557723055980260082230902505269975518146286...

output:


result: