This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
n=int(input())
r=[]
for i in range(n):
r.append(str(input()))
# result - output - broj substringova koji su lozinka
result=0
def get_all_substrings(input_string):
length = len(input_string)
ret_list=[]
for i in range(length):
for j in range(i,length):
if ret_list.count(input_string[i:j+1])==0:
ret_list.append(input_string[i:j+1])
return ret_list
for s in r:
sub_list=get_all_substrings(s)
for sub in sub_list:
result+=r.count(sub)
#element liste je sam sebi podstring pa se oduzima -1
result-=1
print (result)
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |