Problem:


Score : 300 points

Problem Statement

AtCoDeer the deer is going on a trip in a two-dimensional plane.
In his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.

If AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1).
Note that he cannot stay at his place.
Determine whether he can carry out his plan.

Constraints

1 ≤ N ≤ 10^5

0 ≤ x_i ≤ 10^5

0 ≤ y_i ≤ 10^5

1 ≤ t_i ≤ 10^5

t_i < t_{i+1} (1 ≤ i ≤ N-1)

All input values are integers.

Input

Input is given from Standard Input in the following format:

N
t_1 x_1 y_1
t_2 x_2 y_2
:
t_N x_N y_N

Output

If AtCoDeer can carry out his plan, print Yes; if he cannot, print No.

Sample Input 1

2
3 1 2
6 1 1

Sample Output 1

Yes

For example, he can travel as follows: (0,0), (0,1), (1,1), (1,2), (1,1), (1,0), then (1,1).

Sample Input 2

1
2 100 100

Sample Output 2

No

It is impossible to be at (100,100) two seconds after being at (0,0).

Sample Input 3

2
5 1 1
100 1 1

Sample Output 3

No



Sample input:
2
3 1 2
6 1 1


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
import numpy

N=int(input())
S = numpy.zeros(N*3,dtype=int).reshape(N,3)
for i in range(N):
	S[i,:]= list(map(int,input().split())) 

i=0
while i <N:
	L=S[i,0] - S[i,1] - S[i,2]
	if L<0:
		break
	elif L%2==0:
		i+=1
	else:
		break

if i ==N:
	print("YES")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:
import numpy

N=int(input())
S = numpy.zeros(N*3,dtype=int).reshape(N,3)
for i in range(N):
	S[i,:]= list(map(int,input().split())) 

i=0
while i <N:
	L=S[i,0] - abs(S[i,1]) - abs(S[i,2])
	if L<0:
		break
	elif L%2==0:
		i+=1
	else:
		break

if i ==N:
	print("YES")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:
import numpy

N=int(input())
S = numpy.zeros(N*3,dtype=int).reshape(N,3)
for i in range(N):
	S[i,:]= list(map(int,input().split())) 

i=0
while i <N:
	L=S[i,0] - S[i,1] - S[i,2]
	if L<0:
		break
	elif L%2==0:
		i+=1
	else:
		break

if i ==N:
	print("YES")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:
N=int(input())

clear_flag=0
for i in range(N):
  txy=list(map(int,input().split()))
  x=0
  y=0
  next_flag=0
  for x_plus in range(txy[0]+1):
    if next_flag==1:
      break
    for x_minus in range(txy[0]+1-x_plus):
      if next_flag==1:
        break
      for y_plus in range(txy[0]+1-x_plus-x_minus):
        if next_flag==1:
          break
        for y_minus in range(txy[0]+1-x_plus-x_minus-y_plus):
          if x_plus+x_minus+y_plus+y_minus==txy[0]:
            #print(x_plus,x_minus,y_plus,y_minus)
            x=x_plus-x_minus
            y=y_plus-y_minus
            if x==txy[1] and y==txy[2]:
            	next_flag=1
            	clear_flag+=1
            	break
            
          
if clear_flag==N:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
N = int(input())
[t, x, y] = [[],[],[]]
for i in range(N):
  input_line = list(map(int, input().split()))
  t.append(input_line[0])
  x.append(input_line[1])
  y.append(input_line[2])

can = True
for i in range(0, N-1):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  if dt < dist:
    can = False
  if dt%2 != dist%2:
    can = False
  
if can == True:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N = int(input())
t = [0]*N
x = [0]*N
y = [0]*N

cx, cy, ct = 0, 0, 0
for i in range(N):
  t[i], x[i], y[i] = map(int, input().split())
  dx, dy, dt = abs(x[i]-cx), abs(y[i]-cy), abs(t[i]-ct)
  if dt < dx+dy:
    print("No")
    exit()
  if (dt-dx-dy) % 2 == 1:
    print("No")

print("Yes")

Submission status: Wrong Answer

Solution code:
N = int(input())
x = [[0,0,0]]
for i in range(N):
    num = [int(i) for i in input().split()]
    x.append(num)

count = 0    
for i in range(1,len(x)):
    dist = 0
    dist = dist + x[i][1]-x[i-1][1] + x[i][2]-x[i-1][2]
    
    if dist == 0:
        (x[i][0]-x[i-1][0])%2==0
        count += 1
        continue
        
    if dist <= x[i][0]-x[i-1][0]:
        if (x[i][0]-x[i-1][0])%dist==0:
            count += 1

        elif ((x[i][0]-x[i-1][0])%dist)%2==0:
            count += 1

if count == (len(x)-1):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n = int(input())
 
flg = True
t_ = 0
x_ = 0
y_ = 0

for i in range(n):
  t, x, y = map(int, input().split())
  t_ = abs(t - t_)
  x_ = abs(x - x_)
  y_ = abs(y - y_)
  
  if t_ - x_ - y_ <= 0:
    print('No')
    flg = False
    break
  elif (t_ - x_ - y_) % 2 != 0:
    print('No')
    flg = False
    break
  t_ = t
  x_ = x
  y_ = y
 
if flg:
  print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
 
flg = True
t_ = 0
x_ = 0
y_ = 0
for i in range(n):
  t, x, y = map(int, input().split())
  t_ = abs(t_ - t)
  x_ = abs(x_ - x)
  y_ = abs(y_ - y)
  
  if t_ - x_ - y_ <= 0:
    print('No')
    flg = False
    break
  elif (t_ - x_ - y_) % 2 != 0:
    print('No')
    flg = False
    break
  t_ = t
  x_ = x
  y_ = y
 
if flg:
  print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
p = [list(map(int,input().split())) for _ in range(n)] 

ans = 0
for i in range(n):
    #時間的に不可能
    if (p[i][0] < p[i][1]) or (p[i][0] < p[i][2]):
        #print('No')
        ans += 1
    #t-1に目的の座標の±１にいなければならない。
    #つまり座標の合計が偶数であれば時間は偶数である必要がある。
    elif (p[i][1] + p[i][2]) == 0:
        if p[i][0] % 2 != 0:
            ans += 1
        else:
            continue
    elif p[i][0]%(p[i][1] + p[i][2]) != 0 :
        ans += 1
    else:
        break

if ans == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n = int(input())
p = [list(map(int,input().split())) for _ in range(n)] 

ans = 0
for i in range(n):
    #時間的に不可能
    if (p[i][0] < p[i][1]) or (p[i][0] < p[i][2]):
        #print('No')
        break
    #t-1に目的の座標の±１にいなければならない。
    #つまり座標の合計が偶数であれば時間は偶数である必要がある。
    elif (p[i][1] + p[i][2]) == 0:
        if p[i][0] % 2 == 0:
            ans += 1
        else:
            break
        break
    elif p[i][0]%(p[i][1] + p[i][2]) == 0 :
        ans += 1
    else:
        break

if ans == 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
p = [list(map(int,input().split())) for _ in range(n)] 

ans = 0
for i in range(n):
    #時間的に不可能
    if (p[i][0] < p[i][1]) or (p[i][0] < p[i][2]):
        #print('No')
        break
    #t-1に目的の座標の±１にいなければならない。
    #つまり座標の合計が偶数であれば時間は偶数である必要がある。
    elif p[i][0]%(p[i][1] + p[i][2]) == 0 or (p[i][1] + p[i][2]) == 0:
        ans += 1
    else:
        break

if ans == 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
p = [list(map(int,input().split())) for _ in range(n)] 

ans = 0
for i in range(n):
    #時間的に不可能
    if (p[i][0] < p[i][1]) or (p[i][0] < p[i][2]):
        #print('No')
        break
    #t-1に目的の座標の±１にいなければならない。
    #つまり座標の合計が偶数であれば時間は偶数である必要がある。
    elif p[i][0]%(p[i][1] + p[i][2]) == 0:
        ans += 1
    else:
        break

if ans == 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())

pairs = [list(map(int, input().split())) for _ in range(N)]

x0 = 0
y0 = 0
t0 = 0
res = "Yes"
for t, x, y in pairs:
    dx = x - x0
    dy = y - y0
    dt = t - t0

    # if abs(dx) + abs(dy) != dt:
    tmp = dt - (abs(dx) + abs(dy))
    if tmp <= 0 or tmp % 2 != 0:
        res = "No"
        break
    x0 = x
    y0 = y
    t0 = t

print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())

pairs = [list(map(int, input().split())) for _ in range(N)]

x0 = 0
y0 = 0
t0 = 0
res = "Yes"
for t, x, y in pairs:
    dx = x - x0
    dy = y - y0
    dt = t - t0

    if abs(dx) + abs(dy) != dt:
        tmp = dt - (abs(dx) + abs(dy))
        if tmp <= 0 or tmp % 2 != 0:
            print(", ".join(list(map(str, [t, x, y]))))
            res = "No"
            break
    x0 = x
    y0 = y
    t0 = t

print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())

pairs = [list(map(int, input().split())) for _ in range(N)]

x0 = 0
y0 = 0
t0 = 0
res = "Yes"
for t, x, y in pairs:
    dx = x - x0
    dy = y - y0
    dt = t - t0

    if abs(dx) + abs(dy) != dt:
        tmp = dt - (abs(dx) + abs(dy))
        if tmp <= 0 or tmp % 2 != 0:
            res = "No"
            break
    x0 += x
    y0 += y
    t0 += t

print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())

pairs = [list(map(int, input().split())) for _ in range(N)]

x0 = 0
y0 = 0
t0 = 0
res = "Yes"
for t, x, y in pairs:
    dx = x - x0
    dy = y - y0

    if dx + dy != t - t0:
        tmp = t - t0 - (dx + dy)
        if tmp < 0 or tmp % 2 != 0:
            res = "No"
            break
    x0 += x
    y0 += y
    t0 += t

print(res)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

n = int(input())
t, x, y = [0], [0], [0]
for i in range(n):
  t_i, x_i, y_i = map(int, input().strip().split())
  t.append(t_i)
  x.append(x_i)
  y.append(y_i)

  
can = "YES"
for i in range(n):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  if (dt < dist):
    can = "NO"
  if(dist % 2 != dt % 2):
    can = "NO"
print(can)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

n = int(input())
t, x, y = [0], [0], [0]
for i in range(n):
  t_i, x_i, y_i = map(int, input().strip().split())
  t.append(t_i)
  x.append(x_i)
  y.append(y_i)
  
can = "YES"
for i in range(n):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  if (dt < dist):
    can = "NO"
  if(dist % 2) != (dt % 2):
    can = "NO"
print(can)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

n = int(input())
t, x, y = [0], [0], [0]
for i in range(n):
  t_i, x_i, y_i = map(int, input().strip().split())
  t.append(t_i)
  x.append(x_i)
  y.append(y_i)
  
can = "YES"
for i in range(n):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  if (dt < dist):
    can = "NO"
  if(dist % 2 != dt % 2):
    can = "NO"
print(can)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
 
n = int(input())
t, x, y = [0], [0], [0]
for i in range(n):
  t_i, x_i, y_i = map(int, input().strip().split())
  t.append(t_i)
  x.append(x_i)
  y.append(y_i)
  
can = "YES"
for i in range(n):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  if (dt < dist):
    can = "NO"
  if (dist % 2 != dt % 2):
    can = "NO"
print(can)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

n = int(input())
t, x, y = [0], [0], [0]
for i in range(n):
  t_i, x_i, y_i = map(int, input().strip().split())
  t.append(t_i)
  x.append(x_i)
  y.append(y_i)
  
can = "YES"
for i in range(n):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  if (dt < dist) | (dist % 2 != dt % 2):
    can = "NO"
print(can)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

n = int(input())
t, x, y = [0], [0], [0]
for i in range(n):
  t_i, x_i, y_i = map(int, input().strip().split())
  t.append(t_i)
  x.append(x_i)
  y.append(y_i)
  
can = "YES"
for i in range(n):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  can = "NO" if dt < dist else "YES"
  can = "NO" if dist % 2 != dt % 2 else "YES"
print(can)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 0
b = 0
c = 0
for _ in range(N):
    t, x, y = map(int, input().split())
    if t - c >= abs((a + b) - (x + y)):
        if abs((a + b) - (x + y)) - (t - c) % 2 == 1:
            print("No")
            exit()
        else:
            a = x
            b = y
            c = t
    else:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 0
b = 0
c = 0
for _ in range(N):
    t, x, y = map(int, input().split())
    if t - c >= abs((a + b) - (x + y)):
        if a == x and b == y and (t - c) % 2 == 1:
            print("No")
            exit()
        else:
            a = x
            b = y
            c = t
    else:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
posdata = [list(map(int,input().split())) for i in range(n)]
nowpos = [0,0,0]

for i in range(n):
    diff = posdata[i][1] - nowpos[1] + posdata[i][2] - nowpos[2]
    l_parity = diff % 2
    t_parity = (posdata[i][0] - nowpos[0]) % 2
    
    if (posdata[i][0] - nowpos[0]) >= diff and l_parity == t_parity:
        nowpos = posdata[i]
        print(nowpos)
    else:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
posdata = [list(map(int,input().split())) for i in range(n)]
nowpos = [0,0,0]

for i in range(n):
    diff = posdata[i][1] - nowpos[1] + posdata[i][2] - nowpos[2]
    l_parity = diff % 2
    t_parity = (posdata[i][0] - nowpos[0]) % 2
    
    if diff > (nowpos[0] - posdata[i][0]) and l_parity == t_parity:
        nowpos = posdata[i]
    else:
        print("No")
        exit()
    print(nowpos)
print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
posdata = [list(map(int,input().split())) for i in range(n)]
nowpos = [0,0,0]

for i in range(n):
    diff = posdata[i][1] - nowpos[1] + posdata[i][2] - nowpos[2]
    l_parity = diff % 2
    t_parity = posdata[i][0] % 2
    
    if diff > (posdata[i][0] - posdata[i - 1][0]) and l_parity == t_parity:
        nowpos = posdata[i]
        
    else:
        print("No")
        exit()
        
print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
posdata = [list(map(int,input().split())) for i in range(n)]
nowpos = [0,0,0]

for i in range(n):
    diff = posdata[i][1] - nowpos[1] + posdata[i][2] - nowpos[2]
    l_parity = diff % 2
    t_parity = posdata[i][0] % 2
    
    if diff > (posdata[i][0] - posdata[i - 1][0]) and l_parity == t_parity:
        i = i
    else:
        print("No")
        exit()
        
print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
posdata = [list(map(int,input().split())) for i in range(n)]
nowpos = [0,0,0]

for i in range(n):
    diff = posdata[i][1] - nowpos[1] + posdata[i][2] - nowpos[2]
    l_parity = diff % 2
    t_parity = posdata[i][0] % 2
    
    if diff < (posdata[i-1][0] - posdata[i][0]) and l_parity != t_parity:
        print("No")
        exit()
        
print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
posdata = [list(map(int,input().split())) for i in range(n)]
nowpos = [0,0,0]

for i in range(n):
    diff = posdata[i][1] - nowpos[1] + posdata[i][2] - nowpos[2]
    l_parity = diff % 2
    t_parity = posdata[i][0] % 2
    
    if diff < posdata[i][0] and l_parity != t_parity:
        print("No")
        exit()
        
print("Yes")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
t_prev = 0

for n in range(N):
    t, x, y = map(int, input().split())
    if (t - t_prev) >= (x + y) and (t + x + y) % 2 == 0:
        t_prev = t
    else:
        print('No')
        break
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
lst1 = [list(map(int,input().split())) for i in range(n)]

lst1.sort()

x,y = 0,0
t = 0
for i in range(n):
    t = lst1[i][0] - t
    move = abs(lst1[i][1]-x) + abs(lst1[i][2]-y)
    if move > t:
        print("No")
        exit()
    elif move%2 != t%2:
        print("No")
        exit()

    x,y = lst1[i][1],lst1[i][2]

print("Yes")

Submission status: Wrong Answer

Solution code:
N=int(input())
t=0
x=0
y=0
for i in range(N):
    t_next,x_next,y_next=map(int,input().split())
    zikan=t_next - t
    kyori=abs(x_next-x)+abs(y_next-y)
    if kyori>zikan or (zikan-kyori)%2==1:
        print('NO')
        exit(0)
    t,x,y=t_next,x_next,y_next
print('YES')

Submission status: Wrong Answer

Solution code:
N=int(input())
t=0
x=0
y=0
for i in range(N):
    t_next,x_next,y_next=map(int,input().split())
    zikan=t_next - t
    kyori=abs(x_next-x)+abs(y_next-y)
    if kyori>zikan or (zikan-kyori)%2==1:
        print('NO')
        exit(0)
print('YES')

Submission status: Wrong Answer

Solution code:
N = int(input())
t0, x0, y0 = 0, 0, 0
flag=True
for i in range(N):
    t1,x1,y1 = [int(j) for j in input().split()]
    dt = t1 - t0
    dist = abs(x0-x1) + abs(y0-y1)

    if dist > dt:
        print('No')
        flag=False

    elif (dist%2==0 and dt%2==0) or  (dist%2==1 and dt%2==1):
        t0, x0, y0 = t1, x1, y1

    else:
        print('No')
        flag=False

if flag:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
ll = []

for _ in range(N):
    t,x,y = map(int,input().split())
    ll.append([t,x,y])


ll.insert(0,[0,0,0])

for i in range(1,N+1):
    if ll[i][0] % 2 == ((ll[i][1] + ll[i][2]) % 2) and (ll[i][0] - ll[i-1][0]) >= (ll[i][1] + ll[i][2]):
        ans = 1
    else:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
# 初期状態
T = [0]
X = [0]
Y = [0]
for i in range(N):
    t, x, y = map(int, input().split())
    T.append(t)
    X.append(x)
    Y.append(y)

# パリティに着目せよ
count = 0
for i in range(N):
    distanceSum = abs(X[i+1]-X[i]) + abs(Y[i+1]-Y[i])
    T_parity = (T[i+1]-T[i]) % 2
    Distance_parity = distanceSum % 2
    if (T_parity - Distance_parity) % 2 == 0 and (T_parity - Distance_parity) >= 0:
        count += 1

if count == N:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())
# 初期状態
T = [0]
X = [0]
Y = [0]
for i in range(N):
    t, x, y = map(int, input().split())
    T.append(t)
    X.append(x)
    Y.append(y)

# パリティに着目せよ
count = 0
for i in range(N):
    distanceSum = abs(X[i+1]-X[i]) + abs(Y[i+1]-Y[i])
    T_parity = (T[i+1]-T[i]) % 2
    Distance_parity = distanceSum % 2
    if (T_parity - Distance_parity) % 2 == 0:
        count += 1

if count == N:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
for i in range(N):
    t,x,y=map(int,input().split())
    if x+y<=t and t==(x+y):count+=1
print("Yes" if count==N else "No")

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
for i in range(N):
    t,x,y=map(int,input().split())
    if x+y<=t:
      count+=1
print("Yes" if count==N else "No")

Submission status: Wrong Answer

Solution code:
N = int(input())
# 初期状態
T = []
X = []
Y = []
for i in range(N):
    t, x, y = map(int, input().split())
    T.append(t)
    X.append(x)
    Y.append(y)

# パリティに着目せよ
count=0
for i in range(N):
    if x + y <= t and t % 2 == (x+y)%2:
        count += 1

if count == N:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

N = int(input())
t = [0] * N
x = [0] * N
y = [0] * N

for i in range(N):
    t[i], x[i], y[i] = map(int, input().split())

hantei="Yes"

for i in range(N):
    if i==0:
        if t[i]-x[i]-y[i]>=0 and t[i]%2==(x[i]+y[i])%2:
            continue
        else:
            break
    else:
        if t[i]-t[i-1]-x[i]-y[i]>=0 and (t[i]-t[i-1])%2==(x[i]-x[i-1]+y[i]-y[i-1])%2:
            continue
        
        else:
            break
    
print(hantei)

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(N):
    t, x, y = list(map(int, input().split()))

flag = 1
for i in range(N):
    if(t%2==(x+y)%2 and x+y<t):
        continue
    else:
        flag = 0
        break

if(flag):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
txy = []
for i in range(n):
  txy.append(list(map(int, input().split())))
pt = 0
py = 0
px = 0
for t, x, y in txy:
  dt = t - pt
  dx = x - px
  dy = y - py
  ax = abs(dx) % 2
  ay = abs(dy) % 2
  a = ax + ay % 2
  if abs(dx) + abs(dy) > dt or a != dt % 2:
    print("No")
    sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
N = int(input())

can = True
for i in range(N):
    t, x, y = list(map(int, input().split()))
    
    if not t%2 == (x+y)%2 or (x+y) > t:
        can = False
        break
print(can)

Submission status: Wrong Answer

Solution code:
n=int(input())

from numpy import array 

i=0
o=array([0,0,0])
while i<n:
   t,x,y=map(int,input().split())
   z=array([t,x,y])
   w=z-o
   a,b=map(str,[bin(w[0]),bin(w[1]+w[2])])

   if w[0]<w[1]+w[2]:
       print("No")
       break

   else:
       if a==b:
           o=o+w
           i=i+1
       else:
           print("No")
           break
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = True
for i in range(n):
    t,x,y = map(int,input().split())
    if (x+y)%2 != t%2:
        ans = False

if ans:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N = int(input())
T, points= [],[]
for i in range(N):
    t,x,y = map(int, input().split())
    T.append(t)
    points.append([x,y])
    
flag = False
t_now = x_now = y_now = 0
for i in range(N):
    t_diff = T[i] - t_now
    d_diff = abs(points[i][0]-x_now) + abs(points[i][1]-y_now)
    if t_diff-d_diff>=0 and (t_diff-d_diff)%2==0:
        flag = True
    t_now = T[i]
    x_now = points[i][0]
    y_now = points[i][1]

print("Yes") if flag else print("No")

Submission status: Wrong Answer

Solution code:
N = int(input())
T, points= [],[]
for i in range(N):
    t,x,y = map(int, input().split())
    T.append(t)
    points.append([x,y])
    
flag = False
t_now = x_now = y_now = 0
for i in range(N):
    t_diff = T[i] - t_now
    d_diff = abs(points[i][0]-x_now) + abs(points[i][1]-y_now)
    if t_diff-d_diff>=0 and (d_diff-t_diff)%2==0:
        flag = True
    t_now = T[i]
    x_now = points[i][0]
    y_now = points[i][1]

print("Yes") if flag else print("No")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
n=int(input())

t1,x1,y1=0,0,0
flg=True
for i in range(n):
    t2,x2,y2=map(int,input().split())
    l=abs(x2-x1)+abs(y2-y1)
    print(l,t2-t1)
    if l<=(t2-t1) and (t2-t1-l-1)%2==0:
        t1,x1,y1=t2,x2,y2
    else:
        flg=False
        break
print("Yes" if flg else "No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys

N = int(input())
t = [0]
x = [0]
y = [0]
for i in range(N):
	txy = [int(x) for x in input().split()]
	t.append(txy[0])
	x.append(txy[1])
	y.append(txy[2])

for i in range(N - 1):
	d = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])
	dt = t[i + 1] - t[i]
	if dt < d or dt % 2 != d % 2:
		print("No")
		sys.exit()
	
print("Yes")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys

N = int(input())
t = [0]
x = [0]
y = [0]
for i in range(N):
	txy = [int(x) for x in input().split()]
	t.append(txy[0])
	x.append(txy[1])
	y.append(txy[2])

for i in range(N - 1):
	d = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])
	dt = t[i + 1] - t[i]
	if dt < d or (dt - d) % 2 == 1:
		print("No")
		sys.exit()
	
print("Yes")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys

N = int(input())
t = [0]
x = [0]
y = [0]
for i in range(N):
	txy = [int(x) for x in input().split()]
	t.append(txy[0])
	x.append(txy[1])
	y.append(txy[2])

for i in range(N - 1):
	d = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])
	print(d)
	dt = t[i + 1] - t[i]
	if dt < d or (dt - d) % 2 == 1:
		print("No")
		sys.exit()
	
print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())

travel = list()
#start point
travel.append((0,0,0))

for i in range(n):
  travel.append(tuple(map(int,input().split())))


for j in range(n):
  dist = abs(travel[j][0]-travel[j+1][0])

  dd = abs(travel[j][1]-travel[j+1][1])+abs(travel[j][2]-travel[j+1][2])
  
#fail
  if dist < dd or (dd%2 != dist%2):
    print("NO")
    exit(0) 

print("YES")

Submission status: Wrong Answer

Solution code:
N = int(input())

travels = []
for i in range(N):
    t, x, y = map(int, input().split())
    travels.append((t, x, y))

def is_possible(travels):
    current = (0, 0, 0)

    for t, x, y in travels:
        prev_t, prev_x, prev_y = current

        dt = t - prev_t
        dx = x - prev_x
        dy = y - prev_y
        dxy = dx + dy
        if dt < dxy:
            return False
        if dt == dxy:
            continue
        if (dt - dxy) % 2 != 0:
            return False

        current = (t, x, y)

    return True


if is_possible(travels):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
 t,x,y = map(int,input().split())
 if (x+y) > t or (x+y)%2==t%2:
  print("No")
  exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
  t,x,y = map(int,input().split())
  if (x+y) > t and (x+y)%2==t%2:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
#coding:utf-8
t = 0
n = int(input())
x, y = 0, 0
for _ in range(n):
    t_i, x_i, y_i = map(int, input().split(' '))
    t_d = t_i - t
    x_d = abs(x_i - x)
    y_d = abs(y_i - y)
    
    t, x, y = t_i, x_i, y_i
    if x_d + y_d <= t_d and (x_d + y_d) % 2 == t_d % 2:
        continue
    else:
        break
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
# ABC86 C - Traveling
N = int(input())
ans = "Yes"
t, x, y = 0, 0, 0
for i in range(N):
    ti, xi, yi = map(int, input().split())
    dt, dx, dy = ti - t, abs(xi - x), abs(yi - y)
    if (dt - (dx + dy)) % 2 == 0:
        t, x, y = ti, xi, yi
    else:
        ans = "No"
        break
print(ans)

Submission status: Wrong Answer

Solution code:
# ABC86 C - Traveling
N = int(input())
ans = "Yes"
t, x, y = 0, 0, 0
for i in range(N):
    ti, xi, yi = map(int, input().split())
    dt, dx, dy = ti - t, abs(xi - x), abs(yi - y)
    if (dx + dy - dt) % 2 == 0:
        t, x, y = ti, xi, yi
    else:
        ans = "No"
        break
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
li=[]
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break

#ans=Trueにしておいて、チェックにひっ掛かったらFalseに変える
ans=True

#設定より負の値になっていればNO
for i in range(n):
    if li[i][1]>=0 and li[i][2]>=0:
        continue
    ans=False
    print('No')
    break
        
        
#進める最大値よりも先に存在した場合にNOを出す
if ans==True:
    for j in range(n):
        if li[j][0]<=li[j][1]+li[j][2]:
            continue
        ans=False
        print('No')
        break
#秒数とマス目の和の偶奇を調べる
if ans==True:        
    for k in range(n):
        if li[k][0]%2==(li[k][1]+li[k][2])%2:
            continue
        ans=False
        print('No')
        break
        
if ans==True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n=int(input())
li=[]
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break

#ans=Trueにしておいて、チェックにひっ掛かったらFalseに変える
ans=True

#設定より負の値になっていればNO
for i in range(n):
    if li[i][1]>=0 and li[i][2]>=0:
        continue
    ans=False
    print('No')
        
        
#進める最大値よりも先に存在した場合にNOを出す
if ans==True:
    for j in range(n):
        if li[j][0]<=li[j][1]+li[j][2]:
            continue
        ans=False
        print('No')
#秒数とマス目の和の偶奇を調べる
if ans==True:        
    for k in range(n):
        if li[k][0]%2==(li[k][1]+li[k][2])%2:
            continue
        ans=False
        print('No')
        
if ans==True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n=int(input())
li=[]
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break

#ans=Trueにしておいて、チェックにひっ掛かったらFalseに変える
ans=True

#設定より負の値になっていればNO
for i in range(n):
    if li[i][1]>=0 and li[i][2]>=0:
        continue
        ans=False
        print('No')
        
        
#進める最大値よりも先に存在した場合にNOを出す
if ans==True:
    for j in range(n):
        if li[j][1]>=-1*li[j][0] or li[j][0]>=li[j][1] or li[j][2]>=li[j][0] or li[j][0]>=li[j][2]:
            continue
            ans=False
            print('No')
#秒数とマス目の和の偶奇を調べる
if ans==True:        
    for k in range(n):
        if li[k][0]%2==(li[k][1]+li[k][2])%2:
            continue
            ans=False
            print('No')
if ans==True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n=int(input())
li=[]
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break

#ans=Trueにしておいて、チェックにひっ掛かったらFalseに変える
ans=True

#設定より負の値になっていればNO
for i in range(n):
    if li[i][1]>=0 and li[i][2]>=0:
        continue
        ans=False
        print('NO')
        
        
#進める最大値よりも先に存在した場合にNOを出す
if ans==True:
    for j in range(n):
        if li[j][1]>=-1*li[j][0] or li[j][0]>=li[j][1] or li[j][2]>=li[j][0] or li[j][0]>=li[j][2]:
            continue
            ans=False
            print('NO')
#秒数とマス目の和の偶奇を調べる
if ans==True:        
    for k in range(n):
        if li[k][0]%2==(li[k][1]+li[k][2])%2:
            continue
            ans=False
            print('NO')
if ans==True:
    print('YES')

Submission status: Wrong Answer

Solution code:
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(n):
  d=txy[i+1][1]-txy[i][1]+txy[i+1][2]-txy[i][2]
  t=txy[i+1][0]-txy[i][0]
  if t-d<0 or d%2==0:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(n):
  d=abs(txy[i+1][1]-txy[i][1])+abs(txy[i+1][2]-txy[i][2])
  t=txy[i+1][0]-txy[i][0]
  if t-d<0 or d%2==0:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(n):
  d=abs(txy[i+1][1]-txy[i][1])+abs(txy[i+1][2]-txy[i][2])
  t=txy[i+1][0]-txy[i][0]
  if t-d<0 or d%2:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(n):
  d=abs(txy[i+1][1]-txy[i][1])+abs(txy[i+1][2]-txy[i][2])
  if ((txy[i+1][0]-txy[i][0])-d)<0:
    print("No")
    exit()
  elif d%2==0:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(1,n+1):
  d=abs(txy[i][1]-txy[i-1][1])+abs(txy[i][2]-txy[i-1][2])
  if ((txy[i][0]-txy[i-1][0])-d)<0:
    print("No")
    exit()
  elif d%2==0:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(1,n+1):
  d=abs(txy[i][1]-txy[i-1][1])+abs(txy[i][2]-txy[i-1][2])
  if ((txy[i][0]-txy[i-1][0])-d)<0:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(1,n+1):
  d=abs(txy[i][1]-txy[i-1][1])+abs(txy[i][2]-txy[i-1][2])
  if ((txy[i][0]-txy[i-1][0])-d)<0 or d%2==0:
    print("No")
    exit()
print("Yes")