SyHoMadara's blog

By SyHoMadara, history, 4 years ago, In English

we have 3 points coordinate of 3 corners of specific rectangle fine the other point you can't use array. Input : in first 3 line we have $$$x_i , y_i$$$ of i-th point. Output : print $$$x_4 , y_4$$$.

example :
   input 
        1 2
        3 5
        3 2
   output 
        1 5

    input 
        11 26
        -2 7
        5 5
    output
        4 28

Full text and comments »

  • Vote: I like it
  • -7
  • Vote: I do not like it

By SyHoMadara, 4 years ago, In English

I was thinking on this problem Taxi Problem and it was not solved then I see the smallest code that was written in python 3 it was this :

a=[*open(0)][1].count;print(a('4')+a('3')+(a('2')*2+max(0,a('1')-a('3'))+3)//4)

So i could not understand what is [*open(0)] that was used and after I run it in my laptop it return

Traceback (most recent call last):

File "/home/hosein/Python/test.py", line 1, in <module>

a=[*open(0)][1].count;print(a('4')+a('3')+(a('2')*2+max(0,a('1')-a('3'))+3)//4)

IndexError: list index out of range

but when i submit it, it was Accepted whats the point of this?

Full text and comments »

  • Vote: I like it
  • -18
  • Vote: I do not like it