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:
N=int(input())

t0=0
x0=0
y0=0

ans=True
for i in range(N):
    t,x,y=map(int,input().split())
    l=(t-t0)-abs(x+y-x0-y0)
    if l%2==0 and l>=0:
        continue
    else:
        ans=False

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

Submission status: Wrong Answer

Solution code:
import sys
N=int(input())

t0=0
x0=0
y0=0

for i in range(N):
    t,x,y=map(int,input().split())
    l=(t-t0)-abs(x+y-x0-y0)
    if l%2==0 and l>=0:
        continue
    else:
        print("No")
        sys.exit()
print("Yes")

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())
frag = 0
tmp = x[0] + y[0]
alp = 0
if tmp <= t[0]:
    if tmp % 2 == t[0] % 2:
        frag = 0
    else:
        frag = 1
else:
    frag = 1
for i in range(1, n):
    tmp = x[i] + y[i] - x[i - 1] - y[i - 1]
    alp = t[i] - t[i - 1]
    if tmp <= alp:
        if tmp % 2 == alp % 2:
            frag += 0
        else:
            frag = 1
    else:
        frag = 1
if frag == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
n = int(input())
t = 0
x = 0
y = 0
txy = []
for i in range(n):
    ti, xi, yi = list(map(int, input().split()))
    txy.append((ti, xi, yi))

for ti, xi, yi in txy:
    if abs(xi - x) + abs(yi - y) > abs(ti - t):
        print("NO")
        exit()
    elif (abs(xi - x) + abs(yi - y) - abs(ti - t)) % 2 != 0:
        print("NO")
        exit()
    else:
        t = ti
        x = xi
        y = yi
print("YES")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
n = int(input())
t = 0
x = 0
y = 0
txy = []
for i in range(n):
    ti, xi, yi = list(map(int, input().split()))
    txy.append((ti, xi, yi))

for ti, xi, yi in txy:
    if xi - x + yi - y > ti - t:
        print("NO")
        exit()
    elif (xi - x + yi - y - (ti - t)) % 2 != 0:
        print("NO")
        exit()
    else:
        t = ti
        x = xi
        y = yi
print("YES")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
n = int(input())
t = 0
x = 0
y = 0
for i in range(n):
    ti, xi, yi = list(map(int, input().split()))
    if xi - x + yi - y > ti - t:
        print("NO")
        exit()
    elif (xi - x + yi - y - (ti - t)) % 2 != 0:
        print("NO")
        exit()
    else:
        t = ti
        x = xi
        y = yi
print("YES")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
n = int(input())
t = 0
x = 0
y = 0
for i in range(n):
    ti, xi, yi = list(map(int, input().split()))
    if xi - x + yi - y > ti - t:
        print("NO")
        exit()
    elif (xi - x + yi - y - (ti - t)) % 2 != 0:
        print("NO")
        exit()
print("YES")

Submission status: Wrong Answer

Solution code:
# ABC_086_C_Traveling
N = int(input())
txy = [map(int, input().split()) for _ in range(N)]
t, x, y = [list(i) for i in zip(*txy)]
t.insert(0, 0)
x.insert(0, 0)
y.insert(0, 0)
can = True
distX = [0]*(N)
distY = [0]*(N)
dist = [0]*(N)
time = [0]*(N)

# distance
for i in range(N):
	distX[i] = abs(x[i]-x[i+1])
	distY[i] = abs(y[i]-y[i+1])
	dist[i] = distX[i]+distY[i]
	time[i] = t[i+1]-t[i]
	if dist[i] > time[i]:
		can = False
		break

# parity
for i in range(N):
	if (dist[i]-time[i]) % 2 == 1:
		can = False
		break

if can == True:
	print("YES")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:
N = int(input())
t=[[0,0,0]]
for i in range(N):
    A=list(map(int, input().strip().split()))
    t.append(A)

flag=0
flag2=0
for i in range(N):
    flag=0
    time=t[i+1][0]-t[i][0]
    x=t[i+1][1]-t[i][1]
    y=t[i+1][2]-t[i][2]
    time=abs(time)
    x=abs(x)
    y=abs(y)
    print(time)
    print(x)
    print(y)
    print((time-(x+y))%2)
    if (time-(x+y))%2==0 and time>=(x+y):
        flag=1
    if flag!=1:
        flag2=1    

if flag2==1:
    print("No")
else:
    print("Yes")

print(t)

Submission status: Wrong Answer

Solution code:
N = int(input())
t=[[0,0,0]]
for i in range(N):
    A=list(map(int, input().strip().split()))
    t.append(A)

flag3=0
for i in range(N):
    flag=0
    flag2=0
    time=t[i+1][0]-t[i][0]
    x=t[i+1][1]-t[i][1]
    y=t[i+1][2]-t[i][2]
    time=abs(time)
    x=abs(x)
    y=abs(y)
    if time==(x+y):
        flag=1
    elif (time-(x+y))%2==0 and time>x+y:
        flag=1
    if flag!=1:
        flag3=1
if flag3==1:
    print("No")
else:
    print("Yes")

print(t)

Submission status: Wrong Answer

Solution code:
n = int(input())
L = [list(map(int,input().split())) for i in range(n)]
#print(L)
if n == 1:
    dis = abs(L[0][1]) + abs(L[0][2])
    if dis == 0:
        print("Yes")
        exit()
    if L[0][0] >= dis and L[0][0]%dis == 0:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
        
for i in range(n-1):
    t = L[i+1][0] - L[i][1]
    dis = abs(L[i+1][1] - L[i][1]) + abs(L[i+1][2] - L[i][2])

    if t >= dis and (t-dis)%2 == 0 and t%2 == 0:
        flag = True
    else:       
        flag = False
        break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n = int(input())
L = [list(map(int,input().split())) for i in range(n)]
#print(L)
if n == 1:
    dis = abs(L[0][1]) + abs(L[0][2])
    if dis == 0:
        print("Yes")
        exit()
    if L[0][0] >= dis and L[0][0]%dis == 0:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
        
for i in range(n-1):
    t = L[i+1][0] - L[i][1]
    dis = abs(L[i+1][1] - L[i][1]) + abs(L[i+1][2] - L[i][2])
    if dis == 0:
        if t%2 == 0:
            flag = True
        else:
            flag = False
            break
    else:
        if t >= dis and (t-dis)%2 == 0:
            flag = True
        else:       
            flag = False
            break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
prev,pt = (0,0),0
b = True
def f(a,b): return abs(b[0]- a[0]) + abs(b[1] - a[1])
for _ in range(int(raw_input())):
	t,x,y  = map(int, raw_input().split())
	if (t - pt) < f((x,y), prev) :
		b = False
		break 

	if (t - pt) > f((x,y), prev):
		if t - pt == 1:
			b = False
			break
	prev,pt = (x,y),t

print 'Yes' if b else 'No'

Submission status: Wrong Answer

Solution code:
prev,pt = (0,0),0
b = True
def f(a,b): return abs(b[0]- a[0]) + abs(b[1] - a[1])
for _ in range(int(raw_input())):
	t,x,y  = map(int, raw_input().split())
	if not((t - pt) == f((x,y), prev)):
		b = False
		break 
	prev,pt = (x,y),t

print 'Yes' if b else 'No'

Submission status: Wrong Answer

Solution code:
prev = (0,0)
pt = 0
b = True

def f(a,b): return abs(b[0]- a[0]) + abs(b[1] - a[1])
for _ in range(int(raw_input())):
	t,x,y  = map(int, raw_input().split())
	if (t - pt) < f((x,y), prev):
		b = False
		break 
	prev,pt = (x,y),t

print 'Yes' if b else 'No'

Submission status: Wrong Answer

Solution code:
N = int(input())
t, n = [], []
for i in range(N):
    temp = list(map(int, input().split()))
    t.append(temp[0])
    n.append(abs(temp[1]) + abs(temp[2]))
    
nowTime, nowPoint = 0, 0
f = True
for i in range(N):
    time, point = t[i]-nowTime, n[i]-nowPoint
    if time%2 != point%2:
        f = False
        break
    if time < point:
        f = False
        break
    nowTime, nowPoint = t[i], n[i]
    
if f:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())
a=[0]*(N+1)
a[0]=[0,0,0]
for i in range(1,N+1):
    a[i]=[int(j) for j in input().split()]

flag = True
for i in range(N):
    distance = abs(a[i][1]-a[i+1][1]) + abs(a[i][2]-a[i+1][2])
    del_t = a[i+1][0]-a[i][0]

    if del_t - distance < 0 or (del_t - distance)%2 != 0:
        flag = False
        
if flag:
    print("Yes")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
N = int(input())
PX = PY = PT = 0

for _ in range(N):
  T,X,Y = map(int,input().split())
  if abs(X-PX)+abs(Y-PY)>T or (X+Y-PX-PY)%2 != (T-PT)%2:
    print("No")
    exit()
  else:
    PX = X
    PY = Y
    PT = T
    
print("Yes")

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
x=[list(map(int, input().split())) for _ in range(n)]

now=0
nplace=[0,0]
noflag=False
for y in x:
    dis=sum(map(abs, (np.array(y[1:]) - np.array(nplace))))
    # print(dis)
    if not (dis<=(y[0]-now) & (y[0]-now-dis)%2==0):
        noflag=True
    now=y[0]
    nplace=y[1:]
print('Yes') if noflag==False else print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
x=[list(map(int, input().split())) for _ in range(n)]

now=0
nplace=[0,0]
noflag=False
for y in x:
    dis=sum(map(abs, (np.array(y[1:]) - np.array(nplace))))
    # print(dis)
    if not (dis<=(y[0]-now) & (dis-now-y[0])%2==0):
        noflag=True
    now=y[0]
    nplace=y[1:]
print('Yes') if noflag==False else print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
x=[list(map(int, input().split())) for _ in range(n)]

now=0
nplace=[0,0]
noflag=False
for y in x:
    dis=sum(map(abs, (np.array(y[1:]) - np.array(nplace))))
    if not (dis>0 & (dis-y[0])%2==0):
        noflag=True
    now=y[0]
    nplace=y[1:]
print('Yes') if noflag==False else print('No')

Submission status: Wrong Answer

Solution code:
N=int(input())
x,y=0,0
for i in range(N):
    T,X,Y=map(int,input().split())
    r=abs(X-x)+abs(Y-y)
    if r%2!=T%2 or T<r:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = True
preT,preX,preY = 0,0,0
for i in range(N):
    t,x,y = map(int,input().split())

    if abs(x-preX)+abs(y-preY) > t - preT:
        ans=False
    if (-abs(x-preX)-abs(y-preY) + t - preT)%2==1:
        ans=False

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

N = int(input())
A = []
for i in range(N):
    A.append([int(i) for i in input().split()])

t0 = 0
x0 = 0
y0 = 0
flg = True
for t1,x1,y1 in A:
    dt = t1 - t0
    dx = abs(x1-x0)
    dy = abs(y1-y0)
    if dt < dx+dy or dt % 2 != (dx+dy) % 2:
        flg = False
        break

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

Submission status: Wrong Answer

Solution code:
n = int(input())

points = []
for i in range(n):
    points.append([i for i in map(int, input().split())])

can = True
for i in range(len(points)-1):
    move_n = points[i+1][0] - points[i][0]
    dist = abs(points[i+1][1] - points[i][1]) + abs(points[i+1][2] - points[i][2])
    if move_n < dist or dist % 2 != move_n % 2:
        can = False 
        break

if can:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n = int(input())

points = []
for i in range(n):
    points.append([i for i in map(int, input().split())])

can = True
for i in range(len(points)-1):
    move_n = points[i+1][0] - points[i][0]
    dist = abs(points[i+1][1] - points[i][1]) + abs(points[i+1][2] - points[i][2])
    if move_n < dist or dist % 2 != move_n % 2:
        can = False 
        break

if can:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
old_t = 0
old_x = 0
old_y = 0
for i in sys.stdin:
    a = list(map(int, i.split(' ')))
    t = a[0]
    x = a[1]
    y = a[2]
    d = abs(x - old_x) + abs(y-old_y)
    T = t - old_t
    if (T % 2 != d % 2):
        print('No')
        sys.exit(0)
    if (T <= d):
        print('No')
        sys.exit(0)
    old_t = t
    old_x = x
    old_y = y
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
old_t = 0
old_x = 0
old_y = 0
for i in sys.stdin:
    a = list(map(int, i.split(' ')))
    t = a[0]
    x = a[1]
    y = a[2]
    if (a[1] > N or a[2] > N):
        print('No')
        sys.exit(0)
    if ((x + y) > t + 1):
        print('No')
        sys.exit(0)
    if (t % 2 != (x + y) % 2):
        print('No')
        sys.exit(0)
    if (abs(x-old_x) - abs(y-old_y) > (t-old_t)):
        print('No')
        sys.exit(0)
    else:
        old_t = t
        old_x = x
        old_y = y
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
old_t = 0
old_x = 0
old_y = 0
for i in sys.stdin:
    a = list(map(int, i.split(' ')))
    t = a[0]
    x = a[1]
    y = a[2]
    if (a[1] > N or a[2] > N):
        print('No')
        sys.exit(0)
    if ((x + y) > t + 1):
        print('No')
        sys.exit(0)
    if (t % 2 != (x + y) % 2):
        print('No')
        sys.exit(0)
    if (abs(x-old_x) - abs(y-old_y) > (t-old_t)):
        print('No')
        sys.exit(0)
    else:
        old_t = t
        old_x = x
        old_y = y
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
old_t = 0
for i in sys.stdin:
    a = list(map(int, i.split(' ')))
    t = a[0]
    x = a[1]
    y = a[2]
    if (t <= old_t):
        print('No')
        sys.exit(0)
    else:
        old_t = t
    if (a[1] > N or a[2] > N):
        print('No')
        sys.exit(0)
    if ((x + y) > t + 1):
        print('No')
        sys.exit(0)
    if (t % 2 != (x + y) % 2):
        print('No')
        sys.exit(0)
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
for i in sys.stdin:
    a = list(map(int, i.split(' ')))
    t = a[0]
    x = a[1]
    y = a[2]
    if (a[1] > N or a[2] > N):
        print('No')
        sys.exit(0)
    if ((x + y) > t + 1):
        print('No')
        sys.exit(0)
    if (t % 2 != (x + y) % 2):
        print('No')
        sys.exit(0)
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
P = [list(map(int, input().split())) for i in range(N)]
t = [0] * N
p = [0] * N
for i in range(N):
    t[i] = P[i][0]
    p[i] = P[i][1] + P[i][2]

can = True

for i in range(N):
    if t[i] < p[i]:
        can = False
        break
    if t[i]%2 == 0 and p[i]%2 == 0:
        continue
    elif t[i]%2 == 1 and p[i]%2 == 1:
        continue
    else:
        can = False
        break

if can == True:
    print('Yes')
elif can == False:
    print('No')

Submission status: Wrong Answer

Solution code:
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

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

for txyi, txyip in zip([[0, 0, 0]] + txy[:-1], txy):
    ti, xi, yi = txyi
    tip, xip, yip = txyip
    dift = tip - ti
    difd = abs(xip-xi) + abs(yip-yi)
    if dift < difd:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

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

now = [0,0]
time = 0

for i in range(n):
    t,x,y = lst[i][0], lst[i][1], lst[i][2]
    distance = abs(now[0]-x) + abs(now[1]-y)
    if (t - time) % 2 == 0 and distance % 2 == 0 and (t - time) >= distance:
        now = [x,y]
        time += t
    elif (t - time) % 2 != 0 and distance % 2 != 0 and (t - time) >= distance:
        now = [x,y]
        time = t
    else:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

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

now = [0,0]
time = 0

for i in range(n):
    t,x,y = lst[i][0], lst[i][1], lst[i][2]
    distance = abs(now[0]-x) + abs(now[1]-y)
    if (t - time) % 2 == 0 and distance % 2 == 0 and (t - time) >= distance:
        now = [x,y]
        time += t
    elif (t - time) % 2 != 0 and distance % 2 != 0 and (t - time) >= distance:
        now = [x,y]
        time += t
    else:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

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

lastT, lastX, lastY = 0, 0, 0
flag = True

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

    # print( math.fabs(t - lastT) + math.fabs(t - lastT) )

    if ( t - lastT < math.fabs(x - lastX) + math.fabs(y - lastY)
        or ( (t - lastT) - math.fabs(x - lastX) - math.fabs(y - lastY) ) % 2 == 1 ):
        flag = False

    lastT = t
    lastX = x
    lastY = y

print(flag)

Submission status: Wrong Answer

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

for i in range(N):
    crr = A[i]
    nxt = A[i + 1]

    diff_t = nxt[0] - crr[0]
    diff_x = nxt[1] - crr[1]
    diff_y = nxt[2] - crr[2]

    if diff_t < diff_x + diff_y:
        print("No")
        exit(0)

print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())

now_time = 0
now_x = 0
now_y = 0

for i in range(n):
    t, x, y = map(int, input().split())
    xy_diff = abs(x - now_x) + abs(y - now_y)

    if t - now_time < xy_diff:
        print("No")
        exit()
    if t - now_time % 2 == 0:
        if xy_diff % 2 != 0:
            print("No")
            exit()
        else:
            now_time = t
            now_x = x
            now_y = y
    else:
        if xy_diff % 2 != 1:
            print("No")
            exit()
        else:
            now_time = t
            now_x = x
            now_y = y

print("Yes")

Submission status: Wrong Answer

Solution code:
N = int(input())
P = [[0,0,0]]+[list(map(int,input().split())) for n in range(N)]
ans = "Yes"

for n in range(N):
  dt = P[n+1][0]-P[n][0]
  dx = P[n+1][1]-P[n][1]
  dy = P[n+1][2]-P[n][2]  
  if dt<dx+dy or dt%2!=(dx+dy)%2:
    ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0
t_pre, x_pre, y_pre = 0, 0, 0

for i in range(N):
    t, x, y = map(int, input().split())
    
    if (abs(x - x_pre) + abs(y - y_pre) <= t - t_pre) and t%2 == (x + y)%2 :
        print('Yes')

    else:
        print('No')

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
T = []
for _ in range(N):
	T.append(list(map(int,input().split())))

#--------------------------------------------
now = [0,0]
now_time = 0
for i in range(N):
  left_time = T[i][0] - now_time
  target = [T[i][1],T[i][2]]
  distance = abs(T[i][1]-now[0]) + abs(T[i][2]-now[1])
  if distance <= left_time and distance % 2 == left_time % 2:
    now_time = T[i][0]
    now = target
    
  else:
    print("NO")
    sys.exit()

print("YES")

Submission status: Wrong Answer

Solution code:
n=int(input())
kot="Yes"
for i in range(n):
  a=list(map(int,input().split()))
  
  gou=max(a[1]+a[2],(-1*a[1])+a[2],a[1]+(-1*a[2]),(-1*a[1])+(-1*a[2]))
  if a[0]%2!=(gou)%2:
    kot="No"
    break
  if a[0] < gou:
    kot="No"
    break

print(kot)

Submission status: Wrong Answer

Solution code:
n=int(input())
kot="Yes"
for i in range(n):
  a=list(map(int,input().split()))
  
  if a[1]<0:
    a[1]=a[1]*-1
  if a[2]<0:
    a[2]=a[2]*-1
  if a[0]%2!=(a[1]+a[2])%2:
    kot="No"
    break
  if a[0]<a[1]+a[2]:
    kot="No"
    break

print(kot)

Submission status: Wrong Answer

Solution code:
n=int(input())
kot="Yes"
for i in range(n):
  a=list(map(int,input().split()))
  if a[0]%2!=(a[1]+a[2])%2:
    kot="No"
    break
  if a[1]<0:
    a[1]=a[1]*-1
  if a[2]<0:
    a[2]=a[2]*-1
  if a[0]<a[1]+a[2]:
    kot="No"
    break

print(kot)

Submission status: Wrong Answer

Solution code:
N = int(input())
now_t, now_x, now_y = 0, 0, 0

for _ in range(N):
  t, x, y = list(map(int, input().split()))
  if (abs(now_x - x) + abs(now_y - y) - (t - now_t)) % 2:
    print("No")
    break
  now_t, now_x, now_y = t, x, y
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
N = int(input())
now_t, now_x, now_y = (0, 0, 0)

for _ in range(N):
  t, x, y = list(map(int, input().split()))
  if (abs(now_x - x) + abs(now_y - y) - now_t) % 2:
    print("No")
    break
else:
  print("Yes")

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())

x_defo = 0
y_defo = 0
t_defo = 0
result = 0

for i in range(n):
    dt = t[i] - t_defo
    it = abs(x[i]-x_defo) + abs(y[i]-y_defo)
    if it > dt:
        result = 1
        break
    if it %2 != dt %2:
        result = 1
        break

if result ==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
count = int(input())
lis = [input() for i in range(count)]
n = [-1] * count
x = [-1] * count
y = [-1] * count
for i in range(len(lis)):
    n[i],x[i],y[i] =  map(int,lis[i].split())
i = 0    
n0 = 0
x0 = 0
y0 = 0 
res = 1

for i in range(len(n)):
    nt = n[i] - n0
    xt = x[i] - x0 
    yt = y[i] - y0
    if xt == 0 and yt == 0:
        res= -1
        break
    elif x[i] < 0 and y[i] < 0 and n[i] < 1:
        res = -1
        break
    elif xt + yt <= nt:
        if nt%2 == 0 and (xt+yt)%2 == 0:

            n0 = n[i]
            x0 = x[i]
            y0 = y[i]
        elif nt%2 == 1 and (xt+yt)%2 == 1:

            n0 = n[i]
            x0 = x[i]
            y0 = y[i]
        else:
 
            res = -1
            break
    else:
    
        res = -1
        break
if res > 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
count = int(input())
lis = [input() for i in range(count)]
n = [-1] * count
x = [-1] * count
y = [-1] * count
for i in range(len(lis)):
    n[i],x[i],y[i] =  map(int,lis[i].split())
i = 0    
n0 = 0
x0 = 0
y0 = 0 
res = 1
for i in range(len(n)):
    nt = n[i] - n0
    xt = x[i] - x0 
    yt = y[i] - y0
    if xt == 0 and yt == 0:
        res= -1
        break
    elif xt + yt <= nt:
        if nt%2 == 0 and (xt+yt)%2 == 0:

            n0 = n[i]
            x0 = x[i]
            y0 = y[i]
        elif nt%2 == 1 and (xt+yt)%2 == 1:

            n0 = n[i]
            x0 = x[i]
            y0 = y[i]
        else:
 
            res = -1
            break
    else:
    
        res = -1
        break
if res > 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
count = int(input())
lis = [input() for i in range(count)]
n = [-1] * count
x = [-1] * count
y = [-1] * count
for i in range(len(lis)):
    n[i],x[i],y[i] =  map(int,lis[i].split())
i = 0    
n0 = 0
x0 = 0
y0 = 0 
res = 1
for i in range(len(n)):
    nt = n[i] - n0
    xt = x[i] - x0 
    yt = y[i] - y0
    if xt == 0 and yt == 0:
        res= -1
        break
    elif xt + yt <= nt:
        if nt%2 == 0 and (xt+yt)%2 == 0:

            nt = n[i]
            xt = x[i]
            yt = y[i]
        elif nt%2 == 1 and (xt+yt)%2 == 1:

            nt = n[i]
            xt = x[i]
            yt = y[i]
        else:
 
            res = -1
            break
    else:
    
        res = -1
        break
if res > 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
count = int(input())
lis = [input() for i in range(count)]
n = [-1] * count
x = [-1] * count
y = [-1] * count
for i in range(len(lis)):
    n[i],x[i],y[i] =  map(int,lis[i].split())
i = 0    
n0 = 0
x0 = 0
y0 = 0 
res = 1
for i in range(len(n)):
    nt = n[i] - n0
    xt = x[i] - x0 
    yt = y[i] - y0
    if xt + yt <= nt:
        if nt%2 == 0 and (xt+yt)%2 == 0:

            nt = n[i]
            xt = x[i]
            yt = y[i]
        elif nt%2 == 1 and (xt+yt)%2 == 1:

            nt = n[i]
            xt = x[i]
            yt = y[i]
        else:
 
            res = -1
            break
    else:
    
        res = -1
        break
if res > 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n = int(input())

tn = 0
xn = 0
yn = 0
j = True
for i in range(n):
    td, xd, yd = map(int, input().split())
    t = td - tn
    x = abs(xd - xn)
    y = abs(yd - yn)
    if t%2 == (x + y)%2 and (x + y) <= t:
        continue
    j = False
if j:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N=int(input())

t_,x_,y_=(0,0,0)

ans = 'Yes'
for n in range(N):
    t,x,y = list(map(int,input().split()))
    T = t-t_
    manhattan_dist = abs(x-x_)+abs(y-y_)
    print(T,manhattan_dist)
    if T >= manhattan_dist and manhattan_dist%2 == T%2:
        pass
    else:
        ans='No'
        
    t_,x_,y_ = t,x,y

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
t_,x_,y_=(0,0,0)

ans = 'Yes'
for n in range(N):
    t,x,y = list(map(int,input().split()))
    T = t-t_
    manhattan_dist = abs(x-x_)+abs(y-y_)
    if T >= manhattan_dist and manhattan_dist%2 == T%2:
        pass
    else:
        ans='No'

print(ans)

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 (t-(x+y))%2 != 0:
          print('No')
          exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
for _ in range(N):
    t, x, y = map(int, input().split())
    if x + y > t or (t + x + y)%2 != 0:
        print("No")
        quit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[]
for _ in range(n):
  a.append([int(i) for i in input().split()])
b=[0,0,0]
for i in range(n):
  minC=abs(a[i][1]-b[1])+abs(a[i][2]-b[2])
  if a[i][0]-b[0]<minC or (a[i][0]-b[0]-minC)%2==1:
    print("No")
    break
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
N = int(input())

pos_x=0
pos_y=0
t_now=0
flg = True
for i in range(N):
    t,x,y = map(int,input().split())
    t_del = t-t_now
    res = (t_del-abs(pos_x-x)-abs(pos_y-y))
    if (res>=0) & (res%2==0):
        t_now = t
        x_pos = x
        y_pos=y
        pass
    else:
        flg = False
        break

if flg == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())

pos_x=0
pos_y=0
flg = True
for i in range(N):
    t,x,y = map(int,input().split())
    res = (t-abs(pos_x-x)-abs(pos_y-y))
    if (res>=0) & (res%2==0):
        pass
    else:
        flg = False
        break

if flg == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())
t = 0
x = 0
y = 0
for ti, xi, yi in [map(int, input().split(' ')) for n in range(N)]:
    if not (xi-x+yi-y <= ti-t or (ti-t)%2 == (xi-x+yi-y)%2):
        print('No')
        exit()
    else:
        t = ti
        x = xi
        y = yi
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
t = 0
x = 0
y = 0
for ti, xi, yi in [map(int, input().split(' ')) for n in range(N)]:
    if not (xi-x+yi-y <= ti-t and (ti-t)%2 == (xi-x+yi-y)%2):
        print('No')
        exit()
    else:
        t = ti
        x = xi
        y = yi
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
t = 0
x = 0
y = 0
for ti, xi, yi in [map(int, input().split(' ')) for n in range(N)]:
    if not (xi-x+yi-y <= ti-t and ti%2 == (xi+yi)%2):
        print('No')
        exit()
    else:
        t = ti
        x = xi
        y = yi
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
t, x, y = (0, 0, 0)
for ti, xi, yi in [map(int, input().split(' ')) for n in range(N)]:
    if not (xi-x+yi-y <= ti-t and ti%2 == (xi+yi)%2):
        print('No')
        exit()
    else:
        t += ti
        x += xi
        y += yi
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
ti_xi_yi = [map(int, input().split(' ')) for n in range(N)]
for ti, xi, yi in ti_xi_yi:
    if not (xi+yi <= ti and ti%2 == (xi+yi)%2):
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
ti_xi_yi = [map(int, input().split(' ')) for n in range(N)]
for ti, xi, yi in ti_xi_yi:
    if not (abs(xi)+abs(yi) <= ti and ti%2 == (xi+yi)%2):
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
ti_xi_yi = [map(int, input().split(' ')) for n in range(N)]
for ti, xi, yi in ti_xi_yi:
    if not (abs(xi+yi) <= ti and abs(xi)+abs(yi) <= ti and ti%2 == (xi+yi)%2):
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ti_xi_yi = [map(int, input().split(' ')) for n in range(N)]
for ti, xi, yi in ti_xi_yi:
    if not (abs(xi+yi) <= abs(ti) and abs(xi)+abs(yi) <= abs(ti) and abs(abs(xi)-abs(yi)) < abs(ti) and ti%2 == (xi+yi)%2):
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
ti_xi_yi = [map(int, input().split(' ')) for n in range(N)]
for ti, xi, yi in ti_xi_yi:
    if not (abs(xi+yi) <= abs(ti) and abs(xi)+abs(yi) <= abs(ti) and ti%2 == (xi+yi)%2):
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
ti_xi_yi = [map(int, input().split(' ')) for n in range(N)]
for ti, xi, yi in ti_xi_yi:
    if not (xi+yi <= abs(ti) and abs(xi)+abs(yi) <= abs(ti) and ti%2 == (xi+yi)%2):
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
now_t = 0
now_x = 0
now_y = 0
flag = 0
for i in range(N):
    t,x,y = map(int,input().split())
    if abs(x-now_x)+abs(y-now_y)<= t and (abs(x-now_x)+abs(y-now_y))%2 == abs(t-now_t)%2:
        now_t = t
        now_x = x
        now_y = y
    else:
        flag += 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")