6656 | 2023-12-15 17:06:05 | almaaa | Jó intervallumok | python3 | Wrong answer 0/100 | 1.082s | 27976 KiB |
def szepe(sorozat):
jo = True
for i in range(len(sorozat)):
if sorozat[i]%(i+1) != 0:
jo =False
if jo == True:
return True
elif jo == False:
return False
def osszjo(sorozat):
ossz = 0
for i in range(len(sorozat)):
for j in range(i,len(sorozat)):
act = sorozat[i:j+1]
if szepe(act) == True:
ossz+=1
return(ossz)
t = int(input())
n = int(input())
a = input().split()
a = list(map(int,a))
q = int(input())
qs = []
for i in range(q):
qi=input().split()
qi=list(map(int,qi))
qi=[x-1 for x in qi]
qs.append(qi)
for i in range(len(qs)):
actlist = a[qs[i][0]:qs[i][1]+1]
print(osszjo(actlist))
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 18ms | 11492 KiB | ||||
subtask2 | 0/10 | ||||||
2 | Wrong answer | 21ms | 11964 KiB | ||||
3 | Wrong answer | 52ms | 12308 KiB | ||||
4 | Wrong answer | 305ms | 12580 KiB | ||||
5 | Time limit exceeded | 1.067s | 12680 KiB | ||||
6 | Time limit exceeded | 1.067s | 4980 KiB | ||||
subtask3 | 0/20 | ||||||
7 | Time limit exceeded | 1.067s | 6044 KiB | ||||
8 | Time limit exceeded | 1.075s | 8080 KiB | ||||
9 | Time limit exceeded | 1.069s | 9956 KiB | ||||
10 | Time limit exceeded | 1.072s | 12412 KiB | ||||
11 | Time limit exceeded | 1.082s | 20668 KiB | ||||
subtask4 | 0/30 | ||||||
12 | Time limit exceeded | 1.065s | 7840 KiB | ||||
13 | Time limit exceeded | 1.072s | 10052 KiB | ||||
14 | Time limit exceeded | 1.069s | 13044 KiB | ||||
15 | Time limit exceeded | 1.072s | 16784 KiB | ||||
16 | Time limit exceeded | 1.062s | 27572 KiB | ||||
subtask5 | 0/40 | ||||||
17 | Time limit exceeded | 1.072s | 8764 KiB | ||||
18 | Time limit exceeded | 1.044s | 10812 KiB | ||||
19 | Time limit exceeded | 1.052s | 13544 KiB | ||||
20 | Time limit exceeded | 1.065s | 17160 KiB | ||||
21 | Time limit exceeded | 1.054s | 27976 KiB |