QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#683489 | #8340. 3 Sum | ucup-team3519# | TL | 8ms | 10648kb | Python3 | 447b | 2024-10-27 21:25:56 | 2024-10-27 21:25:56 |
Judging History
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...