QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#721019#8340. 3 SumNyanya_#TL 9ms10632kbPython3272b2024-11-07 15:00:002024-11-07 15:00:00

Judging History

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

  • [2024-11-07 15:00:00]
  • 评测
  • 测评结果:TL
  • 用时:9ms
  • 内存:10632kb
  • [2024-11-07 15:00:00]
  • 提交

answer

import sys
sys.set_int_max_str_digits(0)
n, k = map(int, input().split())
a = [int(input()) for _ in range(n)]

m = 10**k - 1
ans = 0
for i in range(n):
	for j in range(i, n):
		for k in range(j, n):
			if (a[i] + a[j] + a[k]) % m == 0:
				ans += 1
print(ans)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 9ms
memory: 10632kb

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: