📅  最后修改于: 2022-03-11 14:45:51.141000             🧑  作者: Mango
import math
import sys
f = lambda x: math.sqrt(2.0 * x + 0.25) - 0.5
g = lambda x: f(x) % 1 == 0
inp = map(int, sys.stdin.read().split()[1:])
print(" ".join("1" if g(x-1) else "0" for x in inp))