Submission #162023

#TimeUsernameProblemLanguageResultExecution timeMemory
162023itiamCOCI17_cezar (COCI17_cezar)Cpython 3
0 / 50
27 ms3512 KiB
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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...