QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#126566#5158. Interview QuestionesahcWA 13ms8128kbPython3651b2023-07-18 17:27:592023-07-18 17:28:03

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-18 17:28:03]
  • 评测
  • 测评结果:WA
  • 用时:13ms
  • 内存:8128kb
  • [2023-07-18 17:27:59]
  • 提交

answer

from math import gcd

st, ed = map(int,input().split())

s = input().split()

a,b = -1, -1

FB = []
F = []
B = []

for i in range(st,ed+1):
    if s[i-st] == 'FizzBuzz':
        FB.append(i)
    elif s[i-st] == 'Fizz':
        F.append(i)
    elif s[i-st] == 'Buzz':
        B.append(i)

if len(FB) == 0:
    if len(F):
        a = F[0]
    if len(B):
        b = B[0]
        
    if a == -1:
        a = 1000000-1
    if b == -1:
        b = 1000000-1
else:
    if len(F):
        a = F[0]
    if len(B):
        b = B[0]
    if a == -1:
        a = FB[0]
    if b == -1:
        b = FB[0]
        
print(a,b)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 13ms
memory: 8128kb

input:

7 11
7 8 Fizz Buzz 11

output:

9 10

result:

ok 

Test #2:

score: -100
Wrong Answer
time: 9ms
memory: 8072kb

input:

49999 50002
49999 FizzBuzz 50001 Fizz

output:

50002 50000

result:

FAIL Mismatch at position 50000: expected FizzBuzz, got Buzz