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

a = [list(map(int,input().split())) for i in range(N)]
a.insert(0,[0,0,0])
for i in range(N-1):
    if abs((a[i+1][1]+a[i+1][2])-(a[i][1]+a[i][2]))<=a[i+1][0]-a[i][0] and ((a[i+1][0]-a[i][0])%2==0 and abs((a[i+1][1]+a[i+1][2])-(a[i][1]+a[i][2]))%2==0) or ((a[i+1][0]-a[i][0])%2!=0 and abs((a[i+1][1]+a[i+1][2])-(a[i][1]+a[i][2]))%2!=0):
    	pass
    else:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [list(map(int,input().split())) for i in range(N)]
a.insert(0,[0,0,0])

for i in range(N):
    if abs((a[i+1][1]+a[i+1][2])-(a[i][1]+a[i][2]))<=a[i+1][0]-a[i][0] and ((a[i+1][0]-a[i][0])%2==0 and abs((a[i+1][1]+a[i+1][2])-(a[i][1]+a[i][2]))%2==0) or ((a[i+1][0]-a[i][0])%2!=0 and abs((a[i+1][1]+a[i+1][2])-(a[i][1]+a[i][2]))%2!=0):
    	pass
    else:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())

s_x = 0
s_y = 0
s_t = 0
travel_flag = True

def judge_ok(d_p, d_t):
  print(d_p, d_t)
  if d_p > d_t:
    return False
  if d_p % 2 != d_t % 2:
    return False
  return True

for n in range(N):
  n_t, n_x, n_y = list(map(lambda x:int(x), input().split(" ")))

  if not judge_ok(abs(n_x - s_x) + abs(n_y - s_y), n_t - s_t):
    travel_flag = False
  
  s_x = n_x
  s_y = n_y
  s_t = n_t

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

Submission status: Wrong Answer

Solution code:
N = int(input())

s_x = 0
s_y = 0
s_t = 0
travel_flag = True

def judge_ok(d_p, d_t):
  print(d_p, d_t)
  if d_p > d_t:
    print("can't reach")
    return False
  if d_p % 2 != d_t % 2:
    print("can't stop")
    return False
  return True

for n in range(N):
  n_t, n_x, n_y = list(map(lambda x:int(x), input().split(" ")))

  if not judge_ok(abs(n_x - s_x) + abs(n_y - s_y), n_t - s_t):
    travel_flag = False
  
  s_x = n_x
  s_y = n_y
  s_t = n_t

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

Submission status: Wrong Answer

Solution code:
N = int(input())

s_x = 0
s_y = 0
s_t = 0
travel_flag = True

def judge_ok(d_p, d_t):
  if d_p > d_t:
    return False
  if d_p % 2 != d_t % 2:
    return False
  return False

for n in range(N):
  n_t, n_x, n_y = list(map(lambda x:int(x), input().split(" ")))

  if not judge_ok(n_x - s_x + n_y - s_y, n_t - s_t):
    travel_flag = False
  
  s_x = n_x
  s_y = n_y
  s_t = n_t

if travel_flag:
  print("Yes")
else:
  print("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)
    

cur_x = 0
cur_y = 0
cur_time = 0 
flg_possible = True

for i in range(N) :
    min_dist = abs(x[i] - cur_x) + abs(y[i] - cur_y)

    if min_dist > t[i] or not((t[i] - cur_time) % 2 == min_dist % 2):
        print("No")
        flg_possible = False
        break
    else :
        cur_x, cur_y, cur_time = x[i], y[i], t[i] - cur_time
        
if flg_possible == True :
    print("Yes")

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)
    

cur_x = 0
cur_y = 0
cur_time = 0 
flg_possible = True

for i in range(N) :
    min_dist = abs(x[i] - cur_x + y[i] - cur_y)

    if min_dist > t[i] or not((t[i] - cur_time) % 2 == min_dist % 2):
        print("No")
        flg_possible = False
        break
    else :
        cur_x, cur_y, cur_time = x[i], y[i], t[i] - cur_time
        
if flg_possible == True :
    print("Yes")

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)
    

cur_x = 0
cur_y = 0
cur_time = 0 
flg_possible = True

for i in range(N) :
    min_dist = abs(x[i] - cur_x + y[i] - cur_y)
    
    # print("DBG : ", min_dist > t[i], not(t[i] - cur_time) % 2 == min_dist & 2), min_dist, t[i], (t[i] - cur_time) % 2, min_dist % 2)
    if min_dist > t[i] or (min_dist <= t[i] and not(t[i] - cur_time) % 2 == min_dist % 2):
        print("No")
        flg_possible = False
        break
    else :
        cur_x, cur_y, cur_time = x[i], y[i], t[i] - cur_time
        
if flg_possible == True :
    print("Yes")

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)

cur_x, cur_y = 0, 0
cur_t = 0
flg_impossible = "YES"

for i in range(N) :
    dloc = (x[i] - cur_x) + (y[i] - cur_y)
    dt = t[i] - cur_t
    
    if ((dloc % 2 == 0 and dt % 2 == 0) or (dloc % 2 != 0 and dt % 2 != 0)) and dloc <= dt :
        cur_x, cur_y, cur_t = x[i], y[i], t[i]
    else :
        flg_impossible = "NO"
        
print(flg_impossible)

Submission status: Wrong Answer

Solution code:
n = int(input())
past_x = 0
past_y = 0
past_t = 0
for _ in range(n):
    t, x, y = tuple(map(int, input().split(" ")))
    diff = abs(past_x - x) + abs(past_y - y)
    if (t - past_t) >= diff and (t - diff) % 2 == 0:
        past_t, past_x, past_y = t, x, y
        continue
    else:
        print("No")
        exit(0)

print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
past_x = 0
past_y = 0
for _ in range(n):
    t, x, y = tuple(map(int, input().split(" ")))
    diff = abs(past_x - x) + abs(past_y - y)
    if (t - diff) % 2 == 0:
        continue
    else:
        print("No")
        exit(0)

print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
N = int(input().strip())
grid = []
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)
t = [0]
x = [0]
y = [0]
for lists in grid:
  t.append(lists[0])
  x.append(lists[1])
  y.append(lists[2])
i = 0
while i < N-1:
  d = abs(x[i+1]-x[i])+abs(y[i+1]-y[i])
  dt = t[i+1]-t[i]
  if dt >= d and (dt-d)%2==0:
    i += 1
  else:
    print('No')
    sys.exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())
before_t, before_x, before_y = 0, 0, 0
for i in range(n):
	txy_strs = input().split()
	t, x, y = tuple(map(int, txy_strs))
	
	movable = t - before_t
	min_move = abs(x - before_x) + abs(y - before_y)

	remaining = movable - min_move
	if 0 <= remaining and remaining % 2 == 0:
		before_t, before_min = t, min_move
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())
before_t, before_min = 0, 0
for i in range(n):
	txy_strs = input().split()
	t = int(txy_strs[0])
	movable = t - before_t
	min_move = abs(int(txy_strs[1])) + abs(int(txy_strs[2])) - before_min

	remaining = movable - (min_move - before_min)
	if 0 <= remaining and remaining % 2 == 0:
		before_t, before_min = t, min_move
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())
before_want, before_min = 0, 0
for i in range(n):
	txy_strs = input().split()
	want_count = int(txy_strs[0]) - before_want
	min_count = abs(int(txy_strs[1])) + abs(int(txy_strs[2])) - before_min

	remaining = want_count - (min_count - before_min)
	if 0 <= remaining and remaining % 2 == 0:
		before_want, before_min = want_count, min_count
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())
before_count, before_size = 0, 0
for i in range(n):
	txy_strs = input().split()
	move_count = int(txy_strs[0]) - before_count
	move_size = abs(int(txy_strs[1]) - before_size) + abs(int(txy_strs[2]) - before_size)

	remaining = move_count - move_size
	if 0 <= remaining and remaining % 2 == 0:
		before_count, before_size = move_count, move_size
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())
before_count, before_size = 0, 0
for i in range(n):
	txy_strs = input().split()
	move_count = int(txy_strs[0]) - before_count
	move_size = abs(int(txy_strs[1])) + abs(int(txy_strs[2]))
	
	remaining = move_count - (before_size - move_size)
	if 0 <= remaining and remaining % 2 == 0:
		before_count, before_size = move_count, move_size
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
import sys 

n = int(input())
before_count, before_size = 0, 0
for i in range(n):
	txy_strs = input().split()
	move_count = int(txy_strs[0]) - before_count
	move_size = abs(int(txy_strs[1])) + abs(int(txy_strs[2]))
	
	remaining = move_count - move_size
	if 0 <= remaining and remaining % 2 == 0:
		before_count, before_size = move_count, move_size
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
# Relative rela
import sys

n = int(input())
txy_list = [[int(n) for n in input().split()] for i in range(n)]
times_list = [txy_list[0][0]] + [txy_list[i][0] - txy_list[i+1][0] for i in range(n-1)]

before_x, before_y = 0, 0
for i, txy in enumerate(txy_list):
	t, x, y = txy
	rela_x, rela_y = x - before_x, y - before_y
	remaining = times_list[i] - (abs(rela_x) + abs(rela_y))
	if 0 <= remaining and remaining % 2 == 0:
		before_x, before_y = x, y
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
# Relative rela
import sys

n = int(input())
txy_list = [[int(n) for n in input().split()] for i in range(n)]


before_x, before_y = 0, 0
for i, txy in enumerate(txy_list):
	t, x, y = txy
	rela_x, rela_y = x - before_x, y - before_y
	remaining = txy_list[i][0] - (abs(rela_x) + abs(rela_y))
	if 0 <= remaining and remaining % 2 == 0:
		before_x, before_y = x, y
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
# Relative rela
import sys

n = int(input())
txy_list = [[int(n) for n in input().split()] for i in range(n)]


before_x, before_y = 0, 0
for i, txy in enumerate(txy_list):
	t, x, y = txy
	rela_x, rela_y = x - before_x, y - before_y
	remaining = t - txy_list[i][0] - (abs(rela_x) + abs(rela_y))
	if 0 <= remaining and remaining % 2 == 0:
		before_x, before_y = x, y
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
# Relative rela
import sys

n = int(input())
txy_list = [[int(n) for n in input().split()] for i in range(n)]


before_x, before_y = 0, 0
for i, txy in enumerate(txy_list):
	t, x, y = txy
	rela_x, rela_y = x - before_x, y - before_y
	remaining = t - (abs(rela_x) + abs(rela_y))
	if 0 <= remaining and remaining % 2 == 0:
		before_x, before_y = x, y
	else:
		print("No")
		sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
# Relative rela
import sys

n = int(input())
txy_list = [[int(n) for n in input().split()] for i in range(n)]

before_x, before_y = 0, 0
for t, x, y in txy_list:
	rela_x, rela_y = x - before_x, y - before_y
	remaining = t - (abs(rela_x) + abs(rela_y))
	if 0 <= remaining and remaining % 2 == 0:
		before_x, before_y = x, y
	else:
		print("No")
		sys.exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
# Relative rela
import sys

n = int(input())
txy_list = [[int(n) for n in input().split()] for i in range(n)]

before_x, before_y = 0, 0
for t, x, y in txy_list:
	rela_x, rela_y = x - before_x, y - before_y
	remaining = t - abs(rela_x) + abs(rela_y)
	if 0 <= remaining and remaining % 2 == 0:
		before_x, before_y = x, y
	else:
		print("No")
		sys.exit()

print("Yes")

Submission status: Wrong Answer

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

t_pre,x_pre,y_pre = 0,0,0
for i in range(n):
    t,x,y = map(int, input().split())
    t_dif, x_dif, y_dif = abs(t_pre-t), abs(x_pre-x), abs(y_pre-y)
    if 0 <= x_dif+y_dif <= t_dif:
        t_pre, x_pre, y_pre = t, x, y
        continue
    print('No')
    sys.exit()
    
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

def dis(x0, y0, x1, y1):
    d = 0
    d += abs(x0 - x1)
    d += abs(y0 - y1)
    return d

if __name__ == '__main__':
    N = int(sys.stdin.readline())
    lines = sys.stdin.readlines()

    ls = [[0, 0, 0]]
    for line in lines:
        ls.append([int(i) for i in line.split()])

    for i in range(1, len(ls)):
        d = dis(ls[i][1], ls[i][2], ls[i-1][1], ls[i-1][2])
        t = ls[i][0] - ls[i-1][0]
        # print(ls[i], d, t)
        if d <= t and t % 2 == d %  2:
            continue
        else:
            print('NO')
            break
    else:
        print('YES')

Submission status: Wrong Answer

Solution code:
import sys

def dis(x0, y0, x1, y1):
    d = 0
    d += abs(x0 - x1)
    d += abs(y0 - y1)
    return d

if __name__ == '__main__':
    N = int(sys.stdin.readline())
    lines = sys.stdin.readlines()

    ls = [[0, 0, 0]]
    for line in lines:
        ls.append([int(i) for i in line.split()])

    for i in range(1, len(ls)):
        d = dis(ls[i][1], ls[i][2], ls[i-1][1], ls[i-1][2])
        t = ls[i][0] - ls[i-1][0]
        print(ls[i], d, t)
        if d <= t and t % 2 == d %  2:
            continue
        else:
            print('NO')
            break
    else:
        print('YES')

Submission status: Wrong Answer

Solution code:
import sys

def dis(x0, y0, x1, y1):
    d = 0
    d += abs(x0 - x1)
    d += abs(y0 - y1)
    return d

if __name__ == '__main__':
    N = int(sys.stdin.readline())
    lines = sys.stdin.readlines()

    ls = []
    for line in lines:
        ls.append([int(i) for i in line.split()])

    t, x, y = 0, 0, 0
    for l in ls:
        d = dis(x, y, l[1], l[2])
        dt = l[0] - t
        #print(t, x, y, l, d)
        if dt < d:
            print('NO')
            break
        if dt % 2 == d %  2:
            t, x, y = l
        else:
            print('NO')
            break
    else:
        print('YES')

Submission status: Wrong Answer

Solution code:
import sys

def dis(x0, y0, x1, y1):
    d = 0
    d += abs(x0 - x1)
    d += abs(y0 - y1)
    return d

if __name__ == '__main__':
    N = int(sys.stdin.readline())
    lines = sys.stdin.readlines()

    ls = []
    for line in lines:
        ls.append([int(i) for i in line.split()])

    t, x, y = 0, 0, 0
    for l in ls:
        d = dis(x, y, l[1], l[2])
        # print(t, x, y, l, d)
        if (l[0] - t) % 2 == d % 2:
            t, x, y = l
        else:
            print('NO')
            break
    else:
        print('YES')

Submission status: Wrong Answer

Solution code:
import sys

def dis(x0, y0, x1, y1):
    d = 0
    d += abs(x0 - x1)
    d += abs(y0 - y1)
    return d

if __name__ == '__main__':
    N = int(sys.stdin.readline())
    lines = sys.stdin.readlines()

    ls = []
    for line in lines:
        ls.append([int(i) for i in line.split()])

    t, x, y = 0, 0, 0
    for l in ls:
        d = dis(x, y, l[1], l[2])
        # print(t, x, y, l, d)
        if (l[0] - t) % d == 0:
            t, x, y = l
        else:
            print('NO')
            break
    else:
        print('YES')

Submission status: Wrong Answer

Solution code:
# N = 2
# a = [[3,1,2],[6,1,1]]
N = input()
N = int(N)
a = [input().split() for _ in range(N)]
b = [[0,0,0]]
b.extend(a)
rtn = 'YES'
for i in range(N):
    t1 = int(b[i][0])
    x1 = int(b[i][1])
    y1 = int(b[i][2])
    t2 = int(b[i+1][0])
    x2 = int(b[i+1][1])
    y2 = int(b[i+1][2])

    td = t2-t1
    xyd = (x2+y2) - (x1+y1)

    # 偶数
    if((td%2==xyd%2) & (td>=xyd)):
        rtn = rtn
    else:
        rtn = 'NO'

print(rtn)

Submission status: Wrong Answer

Solution code:
N = int(input())
tmp = [0,0,0]
data = [0,0,0]
flag = True
for i in range(N):
  tmp = list(map(int,(input()).split()))
  if (tmp[0] - data[0])%2 == (tmp[1] + tmp[2] - data[1] - data[2]) % 2 + 1:
    flag = False
    break
  else:
    data = tmp

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

Submission status: Wrong Answer

Solution code:
N = int(input())
tmp = [0,0,0]
data=list(map(int,(input()).split()))
flag = True
for i in range(N-1):
  tmp = list(map(int,(input()).split()))
  if (tmp[0] - data[0])%2 == (tmp[1] + tmp[2] - data[1] - data[2]) % 2 + 1:
    flag = False
    break
  else:
    data = tmp

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

Submission status: Wrong Answer

Solution code:
prev_t = 0
prev_x = 0
prev_y = 0

n = int(input())
ans = True
for _ in range(n):
    t, x, y = map(int, input().split())
    dist = (x - prev_x) + (y - prev_y)
    time = t - prev_t
    if dist <= time and dist % 2 == time % 2:
        ans = False
        break

    prev_x = x
    prev_y = y
    prev_t = t

if not ans:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
T,X,Y = [0],[0],[0]
a = 0
for n in range(N):
    t,x,y = map(int, input().split())
    T.append(t)
    X.append(x)
    Y.append(y)

for m in range(N):
    dt = T[m+1]-T[m]
    ds = abs(X[m+1]-X[m]) + abs(Y[m+1]-Y[m])
    if dt >= ds and dt%2 == ds%2:
        a = 1

if a:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
N = int(input())
T,X,Y = [0],[0],[0]
a = 1
for n in range(N):
    t,x,y = map(int, input().split())
    T.append(t)
    X.append(x)
    Y.append(y)

for m in range(N):
    dt = T[m+1]-T[m]
    ds = abs(X[m+1]-X[m]) + abs(Y[m+1]-Y[m])
    if dt < ds:
        a = 0
    if dt%2 != ds%2:
        a = 0

if a:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
N = int(input())
arr = [ list(map(int, input().split())) for i in range(N)]
res = 'Yes'

for i in range(N-1):
    x = arr[i+1][1] - arr[i][1]
    y = arr[i+1][2] - arr[i][2]
    t = arr[i+1][0] - arr[i][0]
    
    if x+y <= t:
        if (x+y-t)%2 == 0:
            pass
        else:
            res = 'No'
            break
    else:
        res = 'No'
        break
        
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
t1, x1, y1=map(int, input().split())
if t1<x1+y1 or (x1+y1+t1)%2==1:
  print("NO")
  exit()
for i in range(n-1):
  t2, x2, y2=map(int, input().split())
  if t2<x2+y2 or (abs(x2-x1)+abs(y2-y1))>t2-t1 or (x2+y2+t2)%2==1:
    print("NO")
    exit()
print("YES")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import math

n=int(input())

S=[]

NowT=0
Dist=0
Sx=0
Sy=0

for i in range(n):
    S.append(list(map(int,input().split())))

for i in range(n):
    NowT=S[i][0]-NowT
    Dist=abs(S[i][1]-Sx)+abs(S[i][2]-Sy)
    if NowT>=Dist and NowT%2 ==Dist%2:
        pass
    else:
        
        print("No")
        exit()
    Sx=S[i][1]
    Sy=S[i][2]
    
print("Yes")

Submission status: Wrong Answer

Solution code:

N=int(input())
Destinations=[[0,0,0]]
for i in range(N):
    Destinations.append(list(map(int, input().split())))

for i in range(N-1):
    x_distance = Destinations[i+1][1] - Destinations[i][1]
    y_distance = Destinations[i+1][2] - Destinations[i][2]
    if x_distance < 0:
        x_distance = -x_distance
    if y_distance < 0:
        y_distance = -y_distance
    move_distance = x_distance+y_distance

    move_time = Destinations[i+1][0] - Destinations[i][0]

    if move_distance == 0:
        print("No")

    if move_distance > move_time*1:
        print("No")
    elif move_distance%2 == move_time%2:
        print("Yes")
    else:
        print("No")

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

Submission status: Wrong Answer

Solution code:
def m():
    n = int(input())
    nowt = 0
    nowx = 0
    nowy = 0
    for i in range(n):
        t, x, y = map(int, input().split())
        divt = abs(nowt -t)
        divx = abs(nowx - x)
        divy = abs(nowy - y)
        if divt < divx + divy:
            return "No"
        if divt == divx + divy:
            return "Yes"
        if (divt - divx + divy) % 2 == 0:
            return "Yes"
        return "No"

print(m())

Submission status: Wrong Answer

Solution code:
N = int(input())
list = [[int(i) for i in input().split()] for i in range(N)]
list.insert(0, [0, 0, 0])

if N == 1:
    timeInterval = list[1][0] - list[0][0]
    distance = abs(list[1][1]+list[1][2]-list[0][1]-list[0][2])
    if timeInterval < distance:
        print("No")
    elif (timeInterval - distance)%2 == 0:
        print("Yes")
    else:
        print("No")
else:
    for i in range(N):
        timeInterval = list[i+1][0] - list[i][0]
        distance = abs(list[i+1][1]+list[i+1][2]-list[i][1]-list[i][2])
        if timeInterval < distance:
            print("No")
        elif (timeInterval - distance)%2 == 0 and i == N-1:
            print("Yes")
        else:
            print("No")

Submission status: Wrong Answer

Solution code:
N = int(input())
list = [[int(i) for i in input().split()] for i in range(N)]
list.insert(0, [0, 0, 0])

if N == 1:
    timeInterval = list[1][0] - list[0][0]
    distance = abs(list[1][1]+list[1][2]-list[0][1]-list[0][2])
    if timeInterval < distance:
        print("No")
    elif (timeInterval - distance)%2 == 0:
        print("Yes")
    else:
        print("No")
else:
    for i in range(N):
        timeInterval = list[i+1][0] - list[i][0]
        distance = abs(list[i+1][1]+list[i+1][2]-list[i][1]-list[i][2])
        if timeInterval < distance:
            if i == N-1:
                print("No")
        elif (timeInterval - distance)%2 == 0:
            if i == N-1:
                print("Yes")
        else:
            if i == N-1:
                print("No")

Submission status: Wrong Answer

Solution code:
N = int(input())
list = [[int(i) for i in input().split()] for i in range(N)]

if N == 1:
    diff = list[0][0] - list[0][1] - list[0][2]
    if diff < 0:
        print("No")
    elif diff % 2 == 0:
        print("Yes")
    else:
        print("No")
else:
    for i in range(N-1):
        timeInterval = list[i+1][0] - list[i][0]
        distance = abs(list[i+1][1]+list[i+1][2]-list[i][1]-list[i][2])
        if timeInterval < distance:
            print("No")
        elif (timeInterval - distance)%2 == 0:
            print("Yes")
        else:
            print("No")

Submission status: Wrong Answer

Solution code:
N = input()
tList = []
xList = []
yList = []
for i in range(N):
    t, x, y = map(int, raw_input().split())
    tList.append(t)
    xList.append(x)
    yList.append(y)
l = len(tList)


for i in range(l - 1):
    for j in range(i + 1, l):
        if tList[j] - tList[i] < 0:
            print "No"
        else:
            for i in range(l -1):
                for j in range(i + 1, l):
                    if xList[j] - xList[i] == 0 and yList[j] - xList[i] == 0:
                        print "No"
                    elif (xList[j] - xList[i] > 1 and yList[j] - yList[i] > 1):
                        print "No"
                    else:
                        print "Yes"

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
place_info_list = list()

for _ in range(N):
    t, x, y = list(map(int, input().split()))
    place_info_list.append({
        't': t,
        'x': x,
        'y': y,
    })

place_info_list.sort(key=lambda place: place["t"])

current_place_info = {
    't': 0,
    'x': 0,
    'y': 0,
}

for place_info in place_info_list:
    distance = abs(place_info['x'] - current_place_info['x']) +\
               abs(place_info['y'] - current_place_info['y']) 
    necessary_time = distance / 1.0
    remained_time = place_info['t'] - current_place_info['t']

    if remained_time < necessary_time:
        print("No")
        sys.exit()

    if (remained_time - necessary_time) % 2 == 1:
        print("No")
        sys.exit()
    
    current_place_info['t'] += place_info['t']
    current_place_info['x'] = place_info['x']
    current_place_info['y'] = place_info['y']

print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
s_list = [list(map(int, input().split())) for j in range(n)]
ans = "Yes"
for s in s_list:
    if s[0] < s[1] + s[2]:
        print("1:",s[0] < s[1] + s[2])
        ans = "No"
        break
    elif s[0] % 2 == 0 and (s[1] + s[2]) % 2 == 1:
        print("2", s[0] % 2 == 0 and (s[1] + s[2]) % 2 == 1)
        ans = "No"
        break
    elif s[0] % 2 == 1 and (s[1] + s[2]) % 2 == 0:
        print("3", s[0] % 2 == 1 and (s[1] + s[2]) % 2 == 0)
        ans = "No"
        break
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t = [[0, 0, 0]]
for i in range(n):
    t.append(list(map(int, input().split())))
for i in range(1, n):
    time = t[i][0] - t[i-1][0]
    move = t[i][1] + t[i][2] - (t[i-1][1] + t[i-1][2])
    if(move > time or move%2 != time%2):
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
trv = [[0,0,0]]
for i in range(n):
    t,x,y = map(int,input().split())
    a = [t,x,y]
    trv.append(a)

flag = 1
print(trv)
for i in range(1,len(trv)):
    time = trv[i][0]-trv[i-1][0]
    dist = abs(trv[i][1]-trv[i-1][1]) + abs(trv[i][2]-trv[i-1][2])
    if time < dist:
        flag = 0
    elif time >= dist and (time-dist) % 2 == 0:
        None
    else:
        flag = 0
        break
        
if flag == 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
trv = [[0,0,0]]
for i in range(n):
    t,x,y = map(int,input().split())
    a = [t,x,y]
    trv.append(a)

flag = 1
for i in range(1,len(trv)+1):
    time = trv[i][0]-trv[i-1][0]
    dist = abs(trv[i][1]-trv[i-1][1]) + abs(trv[i][2]-trv[i-1][2])
    if time <= dist:
        flag = 0
        break
    elif time >= dist and (time-dist) % 2 == 0:
        None
    else:
        flag = 0
        break
        
if flag == 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
trv = [[0,0,0]]
for i in range(n):
    t,x,n = map(int,input().split())
    a = [t,x,n]
    trv.append(a)

flag = 1
for i in range(1,len(trv)+1):
    time = trv[i][0]-trv[i-1][0]
    dist = abs(trv[i][1]-trv[i-1][1]) + abs(trv[i][2]-trv[i-1][2])
    if time <= dist:
        flag = 0
        break
    elif time >= dist and (time-dist) % 2 == 0:
        None
    else:
        flag = 0
        break
        
if flag == 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
trv = []
for i in range(n):
    t,x,n = map(int,input().split())
    a = [t,x,n]
    trv.append(a)

flag = 1
for i in range(1,len(trv)):
    time = trv[i][0]-trv[i-1][0]
    dist = abs(trv[i][1]-trv[i-1][1]) + abs(trv[i][2]-trv[i-1][2])
    if time <= dist:
        flag = 0
        break
    elif time >= dist and (time-dist) % 2 == 0:
        None
    else:
        flag = 0
        break
        
if flag == 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
trv = []
for i in range(n):
    t,x,n = map(int,input().split())
    a = [t,x,n]
    trv.append(a)

flag = 1
for i in range(1,len(trv)):
    time = trv[i][0]-trv[i-1][0]
    dist = abs(trv[i][1]-trv[i-1][1]) + abs(trv[i][2]-trv[i-1][2])
    if time <= dist:
        flag = 0
        break
    elif time >= dist and (time-dist) % 2 == 0:
        None
    else:
        flag = 0
        break
        
if flag == 0:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
N = int(input())
t_list = [0]
x_list = [0]
y_list = [0]
for i in range(N):
    t, x, y = map(int, input().split())
    t_list.append(t)
    x_list.append(x)
    y_list.append(y)
result = 'Yes'
for i in range(N):
    if i == 0:
        pass
    else:
        d_t = t_list[i] - t_list[i-1]
        d_x = x_list[i] - x_list[i-1]
        d_y = y_list[i] - y_list[i-1]
        if d_t >= d_x + d_y:
            if (d_t - (d_x + d_y)) % 2 == 0:
                pass
            else:
                result = 'No'
        else:
            result = 'No'
print(result)

Submission status: Wrong Answer

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

def move(x, y):
    
    return x, y

# 入力
N = int(input())
txy = list([map(int, input().split()) for i in range(N)])
for i in range(N):
    txy[i] = list(txy[i])
txy.insert(0, [0, 0, 0])
    
# 処理
i = 0
ans = "Yes"

for i in range(N):
    t = txy[i+1][0] - txy[i][0]
    d = abs(txy[i][1]-txy[i+1][1]) + abs(txy[i][2]-txy[i+1][2])
    if not(d <= t and t%2 == d%2):
        ans = "no"
        break
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())

t_now=0
x_now=0
y_now=0

t=[0 for i in range (N)]
x=[0 for i in range (N)]
y=[0 for i in range (N)]


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

for i in range (N):
    if((abs(x[i]-x_now)+abs(y[i]-y_now)>abs(t[i]-t_now)) or (abs(abs(x[i]-x_now)+abs(y[i]-y_now)-abs(t[i]-t_now))%2!=0) ):
        print("No")
        exit(0)
    else:
        x_now=x[i]
        y_now=y[i]
        t_now+=t[i]

print("Yes")

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
m=flag=f=0
temp=[[0,0,0]]
for i in range(n):
	ip=map(int,raw_input().split())
	temp.append(ip)
	
for i in range(1,n+1):
	if temp[i][0]-temp[i-1][0] >=abs(temp[i][1]+temp[i][2]-temp[i-1][1]-temp[i-1][2]):
		flag=1
	if (temp[i][0]%(temp[i][1]+temp[i][2])==0):
		f=1
	if flag==1 and f==1:
		m=m+1
	flag=f=0
	
if n==m:
	print 'Yes'
else:
	print 'No'

Submission status: Wrong Answer

Solution code:
N = int(input())
x = []
x.append([0, 0, 0])
for i in range(N):
    x.append(list(map(int, input().split())))
for i in range(N):
    if abs(x[i+1][1]-x[i][1])+abs(x[i+1][2]-x[i][2]) <= x[i+1][0]-x[i][0] and (abs(x[i+1][1]-x[i][1])+abs(x[i+1][2]-x[i][2]))%2 == (x[i+1][0]-x[i][0])%2:
        print("Yes")
        break
    else:
        print("No")
        break