QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#721019 | #8340. 3 Sum | Nyanya_# | TL | 9ms | 10632kb | Python3 | 272b | 2024-11-07 15:00:00 | 2024-11-07 15:00:00 |
Judging History
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...