yull23's blog

By yull23, history, 3 years ago, In English

Good morning, someone knows the reason why it does not recognize python 3, it only recognizes python 2, and I always get an error when sending my code, I attach shipping images, the problem is my code

problem: https://codeforces.com/contest/1176/problem/B send: https://codeforces.com/contest/1176/submission/129864181

thanks.

input: 2 5 3 1 2 3 1 7 1 1 1 1 1 2 2

code:

Para el conteo de datos

def count(x): k = 0 for i in x: if i % 3 == 0: k = k + 1 return k

def mx(x): n = [] for i in x: n.append(i % 3) x0 = n.count(0) x1 = n.count(1) x2 = n.count(2) if x1 < x2: x0 = x0 + x1 + (x2 — x1) * 2 // 3 elif x1 > x2: x0 = x0 + x2 + (x1 — x2) // 3 else: x0 = x0 return x0

num = int(input()) f = [] for i in range(num): num2 = input() y = list(map(int, input().split())) f.append(mx(y)) for i in f: print(i)

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it