Buggy python submission (verdict: Runtime Error):
import cmath
import math

N = int(input())
pc = []
for i in range(N):
  x, y = map(int, input().split())
  c = x + y*1j
  p = cmath.phase(c)
  pc.append([p, c])
pc = sorted(pc)

ps = [pc[i][0] for i in range(N)]
cs = [pc[i][1] for i in range(N)]

def L(i, j, N):
  if i<j:
    return list(range(i, j))
  else:
    return list(range(0, j)) + list(range(i+1, N))

s = 0
m = 0

for start in range(N):
  for end in range(N):
    s = 0
    #print(start,end,N,L(start,end,N))
    for k in L(start,end,N):
      s += cs[k]
    m = max(m, abs(s))
s = 0
for k in range(N):
  s += cs[k]
  m = max(m, abs(s))
print(m)

Fixed submission:
import cmath
import math

N = int(input())
pc = []
for i in range(N):
  x, y = map(int, input().split())
  c = x + y*1j
  p = cmath.phase(c)
  pc.append([p, c])
pc = sorted(pc, key=lambda x: x[0])

ps = [pc[i][0] for i in range(N)]
cs = [pc[i][1] for i in range(N)]

def L(i, j, N):
  if i<j:
    return list(range(i, j))
  else:
    return list(range(0, j)) + list(range(i+1, N))

s = 0
m = 0

for start in range(N):
  for end in range(N):
    s = 0
    #print(start,end,N,L(start,end,N))
    for k in L(start,end,N):
      s += cs[k]
    m = max(m, abs(s))
s = 0
for k in range(N):
  s += cs[k]
  m = max(m, abs(s))
print(m)

Buggy python submission (verdict: Runtime Error):
import cmath
import math

N = int(input())
pc = []
for i in range(N):
  x, y = map(int, input().split())
  c = x + y*1j
  p = cmath.phase(c)
  pc.append([p, c])
pc = sorted(pc)

ps = [pc[i][0] for i in range(N)]
cs = [pc[i][1] for i in range(N)]

def L(i, j, N):
  if i<j:
    return list(range(i, j))
  else:
    return list(range(0, i)) + list(range(j+1, N))

s = 0
m = 0

for i in range(N):
  for j in range(N):
    s = 0
    s = 0
    for k in L(i,j,N):
      s += cs[k]
    m = max(m, abs(s))

print(m)

Fixed submission:
import cmath
import math

N = int(input())
pc = []
for i in range(N):
  x, y = map(int, input().split())
  c = x + y*1j
  p = cmath.phase(c)
  pc.append([p, c])
pc = sorted(pc, key=lambda x: x[0])

ps = [pc[i][0] for i in range(N)]
cs = [pc[i][1] for i in range(N)]

def L(i, j, N):
  if i<j:
    return list(range(i, j))
  else:
    return list(range(0, j)) + list(range(i+1, N))

s = 0
m = 0

for start in range(N):
  for end in range(N):
    s = 0
    #print(start,end,N,L(start,end,N))
    for k in L(start,end,N):
      s += cs[k]
    m = max(m, abs(s))
s = 0
for k in range(N):
  s += cs[k]
  m = max(m, abs(s))
print(m)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
c=0
f = True
for i in range(N):
  A.append(list(map(int, input().split())))
idx = [0 for i in range(N)]

a = 0

btlf = [False for i in range(N)]#その周回ですでにバトルしたかどうかのフラグです

for i in range((N*(N-1))//2):#周回
  btlf = [False for i in range(N)]#リセット
  for j in range(N):
    #print(idx)
    if idx[j] != N-1:
      a = A[j][idx[j]]
      if A[a-1][idx[a-1]]-1==j and btlf[a-1] == False and btlf[j] == False:
        idx[a-1]+=1
        btlf[a-1] = True
        idx[j]+=1
        btlf[j] = True
        #c+=1#とりあえず試合数で実装して後から修正します
  if idx == [N-1 for i in range(N)]:
    print(i+1)
    f = False
    break
  if btlf == [False for i in range(N)]:#対戦が一度もなければ打ち切ります
    break
if f:
  print(-1)

Fixed submission:
import cmath
import math

N = int(input())
pc = []
for i in range(N):
  x, y = map(int, input().split())
  c = x + y*1j
  p = cmath.phase(c)
  pc.append([p, c])
pc = sorted(pc, key=lambda x: x[0])

ps = [pc[i][0] for i in range(N)]
cs = [pc[i][1] for i in range(N)]

def L(i, j, N):
  if i<j:
    return list(range(i, j))
  else:
    return list(range(0, j)) + list(range(i+1, N))

s = 0
m = 0

for start in range(N):
  for end in range(N):
    s = 0
    #print(start,end,N,L(start,end,N))
    for k in L(start,end,N):
      s += cs[k]
    m = max(m, abs(s))
s = 0
for k in range(N):
  s += cs[k]
  m = max(m, abs(s))
print(m)