QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#126539 | #5158. Interview Question | esahc | WA | 13ms | 8088kb | Python3 | 500b | 2023-07-18 16:39:27 | 2023-07-18 16:39:28 |
Judging History
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