Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())

def minus_2(n):
    ans = ''
    if n == 1:
        ans += '1'
    else:
        for i in range(10**9):
            if n % 2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
            if n == 1:
                break
        ans += '1'
        ans = ans[::-1]
        
    return ans

print(minus_2(N))

Fixed submission:
import math
N = int(input())
 
def minus_2(n):
    ans = ''
    if n == 1:
        ans += '1'
    elif n == 0:
        ans += '0'
    else:
        while n != 1:
            if n % 2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
        ans += '1'
        ans = ans[::-1]
        
    return ans
 
print(minus_2(N))

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())

def minus_2(n):
    ans = ''
    if n == 1:
        ans += '1'
    else:
        while n != 1:
            if n % 2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
        ans += '1'
        ans = ans[::-1]
        
    return ans

print(minus_2(N))

Fixed submission:
import math
N = int(input())
 
def minus_2(n):
    ans = ''
    if n == 1:
        ans += '1'
    elif n == 0:
        ans += '0'
    else:
        while n != 1:
            if n % 2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
        ans += '1'
        ans = ans[::-1]
        
    return ans
 
print(minus_2(N))

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())

def minus_2(n):
    ans = ''
    if n == 1:
        ans.append('1')
    else:
        while n != 1:
            if n % -2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
        ans += '1'
        ans = ans[::-1]
        
    return ans

ans = minus_2(N)

print(ans)

Fixed submission:
import math
N = int(input())
 
def minus_2(n):
    ans = ''
    if n == 1:
        ans += '1'
    elif n == 0:
        ans += '0'
    else:
        while n != 1:
            if n % 2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
        ans += '1'
        ans = ans[::-1]
        
    return ans
 
print(minus_2(N))

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())

def minus_2(n):
    ans = ''
    if n == 1:
        ans.append('1')
    else:
        while n != 1:
            if n % -2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
        ans += '1'
        ans = ans[::-1]
        
    return ans

ans = minus_2(N)

print(''.join(ans))

Fixed submission:
import math
N = int(input())
 
def minus_2(n):
    ans = ''
    if n == 1:
        ans += '1'
    elif n == 0:
        ans += '0'
    else:
        while n != 1:
            if n % 2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
        ans += '1'
        ans = ans[::-1]
        
    return ans
 
print(minus_2(N))

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())

def minus_2(n):
    ans =[]
    if n == 1:
        ans.append('1')
    else:
        while n != 1:
            if n % -2 == 0:
                ans.append('0')
            else:
                ans.append('1')
            n = math.ceil(n/-2)
        ans.append('1')
        ans = ans[::-1]
        
    return ans

ans = minus_2(N)

print(''.join(ans))

Fixed submission:
import math
N = int(input())
 
def minus_2(n):
    ans = ''
    if n == 1:
        ans += '1'
    elif n == 0:
        ans += '0'
    else:
        while n != 1:
            if n % 2 == 0:
                ans += '0'
            else:
                ans += '1'
            n = math.ceil(n/-2)
        ans += '1'
        ans = ans[::-1]
        
    return ans
 
print(minus_2(N))