QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#126539#5158. Interview QuestionesahcWA 13ms8088kbPython3500b2023-07-18 16:39:272023-07-18 16:39:28

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 16:39:28]
  • 评测
  • 测评结果:WA
  • 用时:13ms
  • 内存:8088kb
  • [2023-07-18 16:39:27]
  • 提交

answer

from math import gcd

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

s = input().split()

a,b = -1, -1

for i in range(st,ed+1):
    if s[i-st] == 'Fizz':
        if a != -1:
            a = gcd(a, i)
        else:
            a = i
    elif s[i-st] == 'Buzz':
        if b != -1:
            b = gcd(b, i)
        else:
            b = i
    elif s[i-st] == 'FizzBuzz':
        a,b = 1,1
        break
        
if a == -1 and b == -1:
    a,b = 1000000-1, 1000000-1
        
print(a,b)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 4ms
memory: 8084kb

input:

7 11
7 8 Fizz Buzz 11

output:

9 10

result:

ok 

Test #2:

score: -100
Wrong Answer
time: 13ms
memory: 8088kb

input:

49999 50002
49999 FizzBuzz 50001 Fizz

output:

1 1

result:

FAIL Mismatch at position 49999: expected 49999, got FizzBuzz