QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#117177 | #5666. Repetitive Elements | bakuganulit | WA | 22ms | 8136kb | Python3 | 394b | 2023-06-30 16:06:14 | 2023-06-30 16:06:15 |
Judging History
answer
def solve():
r = ""
k = input()
for i in range(2, len(k)//2):
for l in range(1, (len(k)-1)//2):
pattern = k[l:l+i]
if pattern in k[:l] or pattern in k[l+i:]:
if len(pattern) > len(r):
r = pattern
print(r)
if __name__ == "__main__":
t = int(input())
for i in range(t):
solve()
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 11ms
memory: 8076kb
input:
5 TATCGATCGAGTTGT TCCGCGAGCGAGTCTCTCCATT GTTTCATCATACGAGGCCCCATACGCGCTGG AGATGGGATCCTTATG GCCCTTAGGCATGGGATGTCGTTTCTTG
output:
ATCG GCGA CATACG GAT CTT
result:
ok 5 lines
Test #2:
score: -100
Wrong Answer
time: 22ms
memory: 8136kb
input:
50 TTGACAACTTCAGGTTGGCACTCCTTCATTTGGATTTCGGAATAATAGTTTTCTGCTCTGCC ATCCTATTCGGGGATAGGAGAGATGGGTTGCCGCTATAAAAGCATTTGAACTCCATTTCACTCCGTTGGCTAGGGGTCGCACTG CCGTAATATAAAGACTCGGAATTCCAATAGCTGCTATTTGCGAGTATGTGACTGAAAACACACCTATAAATATTAGCTGCGTACAAGCTA ATGGCTGCATGCAGGGTCGACTAGACACACTTTGTCT TTGAGGATGTCGACGTGTCT...
output:
CTTCA CTAT TAGCTGC TGCA ACGTG AGGAA CTCTT AGTAT GAGC GAGT TAT TGAC TGC CGTC TACTGG CCGGT AAA CAGTA GCGT GGTT CCCT GAG TAGAC GGTGC GCAGT TGAG ATCAA CCACACA CAAG ATGTA ATGGTA TATA TATGAA CGT CATACG TACCA TTAG GGAATGT CAGG GCT AG ACAC ATGT TCTTC AAAAC GCT GATAA TTA ACATAT AAT
result:
wrong answer 2nd lines differ - expected: 'CATTT', found: 'CTAT'