QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#502535#3259. Substring CharactersyundaehyuckWA 15ms10492kbPython3806b2024-08-03 09:25:042024-08-03 09:25:04

Judging History

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

  • [2024-08-03 09:25:04]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:10492kb
  • [2024-08-03 09:25:04]
  • 提交

answer

while 1:
    
    try:

        s = input()

        p = set(s)
        
        X = set()

        n = len(s)

        min_v = len(s)+10

        for i in range(n):
            
            for j in range(i,n):
                
                if i == 0 and j >= n-1:
                    
                    continue
                    
                t = s[i:j+1]

                if set(t) == p:
                    
                    if min_v > len(t):
                        
                        min_v = len(t)

                    X.add(t)
        
        count = 0

        for x in X:
            
            if len(x) == min_v:
                
                count += 1
        
        print(count)
    
    except:
        
        break

详细

Test #1:

score: 0
Wrong Answer
time: 15ms
memory: 10492kb

input:

aabbabb
abAB34aB3ba7
104001144
aaabcaaa
a
bb
bd
1234567

output:

2
1
1
2
0
1
0
0

result:

wrong answer 3rd lines differ - expected: '3', found: '1'