QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#631475#5666. Repetitive ElementsvwxyzWA 8ms10728kbPython3352b2024-10-12 06:12:122024-10-12 06:12:13

Judging History

你现在查看的是最新测评结果

  • [2024-10-12 06:12:13]
  • 评测
  • 测评结果:WA
  • 用时:8ms
  • 内存:10728kb
  • [2024-10-12 06:12:12]
  • 提交

answer

from collections import defaultdict

T=int(input())
ans=None
for t in range(T):
    S=input()
    N=len(S)
    for d in range(1,N+1):
        idx=defaultdict(list)
        for i in range(N-d+1):
            idx[S[i:i+d]].append(i)
        for s,lst in idx.items():
            if max(lst)-min(lst)>=d:
                ans=s
    print(ans)

详细

Test #1:

score: 0
Wrong Answer
time: 8ms
memory: 10728kb

input:

5
TATCGATCGAGTTGT
TCCGCGAGCGAGTCTCTCCATT
GTTTCATCATACGAGGCCCCATACGCGCTGG
AGATGGGATCCTTATG
GCCCTTAGGCATGGGATGTCGTTTCTTG

output:

TCGA
CGAG
CATACG
ATG
ATG

result:

wrong answer 1st lines differ - expected: 'ATCG', found: 'TCGA'