QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#126566 | #5158. Interview Question | esahc | WA | 13ms | 8128kb | Python3 | 651b | 2023-07-18 17:27:59 | 2023-07-18 17:28:03 |
Judging History
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