Advertisement
TheMagnusRex

Untitled

Dec 6th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. a=raw_input().split()
  2. c=[]
  3. for b in a:
  4.     c.append(int(b))
  5. i=1
  6. x=0
  7. z=1
  8. schetchik2=1
  9. schetchik=0
  10. shag=1
  11. if len(c)==1:
  12.     print "yes"
  13. else:
  14.     while c[i-1]==c[i] and i<len(c)-1:
  15.         shag+=1
  16.         i+=1
  17.     hi = c[shag]-c[shag-1]
  18.     while x<shag:
  19.         if c[x:len(c):shag]==c[0:len(c):shag]:
  20.             schetchik+=1
  21.         x+=1
  22.     if shag == len(c)-1:
  23.         print "yes"
  24.     else:
  25.         while z< (len(c)/shag):
  26.             if (c[z*shag]-c[(z*shag)-1])**2 == hi*hi:
  27.                 schetchik2+=1
  28.             z+=1
  29.         if (schetchik == shag and schetchik2 == len(c)/shag):
  30.             print "yes"
  31.         else:
  32.             print "no"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement