FBMT - Editorial

okay I found the solution there was a memory leak which happens due to multiple buffer reader objects sharing the same input stream so I declared a static field like

static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

and it worked fine

check the logic the brackets are a bit messed up .its showing runtime error on codechef but working well on codeblocks

Hello, my python code is working for custom input case but is not getting accepted and showing “Wrong Answer”.Can anyone tell me my mistake, please?
Thanks in advance!
[Pythoncode]:
https://www.codechef.com/viewsolution/23700466

1 Like
t = int(input())
while(t>0):
n = int(input())
if(n!=0):
    str1 = ""
    str2 = ""
    str1 = input()
    count1 = 1
    count2 = 0
    n -= 1
    if(n>=1):
        while(n>0):
            str2 = input()
            if(str2 != str1):
                count2 += 1
            elif(str2 == str1):
                count1 += 1
            n -= 1
    if(count1 > count2):
        print(str1)
    elif(count1 == count2):
        print("Draw")
    else:
        print(str2)
    t -= 1
else:
    print("Draw")
    t -= 1

Can someone provide me test case that fails, seems to be working all the time :smiley:
It’s not getting accepting I am getting Wrong Answer, also the problem needs to be clear with n = 0 as inout the output should be draw. It could have been clear when no teams are given as the question says there are atleast two teams, highly contradicting.