CodeChef submission 698984 (PYTH) plaintext list. Status: AC, problem MARCHA2, contest . By cyberax (cyberax), 2011-10-11 05:04:38.
from sys import stdin def main(): x = stdin.readlines() for n in range(int(x[0])): k = int(x[2 * n + 1]) l = map(int, x[2 * n + 2].split()) r = True stems = 0 for i in xrange(k - 1, -1, -1): stems = stems / 2 + l[i] if (i and stems % 2) or (not i and stems != 1): r = False break print r and 'Yes' or 'No' main()
Comments

