Submission #3690121

Source Code Expand

Copy
def solve(x,y):
  u = x+y
  if u % 4 != 0:
    return False
  u /= 4  # a+b
  v = y-x
  if v % 2 != 0:
    return False
  v /= 2  # a-b
  aa = u+v
  if aa % 2 != 0:
    return False
  a = aa / 2
  if a < 0:
    return False
  bb = u-v
  if bb % 2 != 0:
    return False
  b = bb / 2
  if b < 0:
    return False
  # print (a,b)
  return True
  
x,y=map(int,raw_input().split())
if solve(x,y):
  print 'Yes'
else:
  print 'No'

Submission Info

Submission Time
Task B - Colored Balls
User naoya_t
Language Python2 (2.7.6)
Score 200
Code Size 455 Byte
Status
Exec Time 12 ms
Memory 2692 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 s1.txt, s2.txt, s3.txt
All 200 / 200 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt 11 ms 2568 KB
02.txt 11 ms 2568 KB
03.txt 12 ms 2692 KB
04.txt 11 ms 2568 KB
05.txt 11 ms 2568 KB
06.txt 11 ms 2568 KB
07.txt 11 ms 2568 KB
08.txt 11 ms 2568 KB
09.txt 11 ms 2568 KB
10.txt 11 ms 2568 KB
11.txt 11 ms 2568 KB
12.txt 11 ms 2568 KB
13.txt 11 ms 2568 KB
14.txt 11 ms 2568 KB
15.txt 11 ms 2568 KB
16.txt 11 ms 2568 KB
s1.txt 11 ms 2568 KB
s2.txt 11 ms 2568 KB
s3.txt 11 ms 2568 KB