Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Firstly you need to put all the global statements into a function because of Python code runs faster in a function compared to global scope Python code runs faster in a function compared to global scope.

You don't need the arr variable. You can just use

x[i], y[i] = map(int, raw_input().split())

instead of using the two lines. map uses the function(1st argument) on each of the outputs from the second argument.

After placing the global statements into a function then instead of passing i, j, k you would need to pass the values directly.

I'll look up the algorithm and see if there are other changes that can be made.

Firstly you need to put all the global statements into a function because of Python code runs faster in a function compared to global scope.

You don't need the arr variable. You can just use

x[i], y[i] = map(int, raw_input().split())

instead of using the two lines. map uses the function(1st argument) on each of the outputs from the second argument.

After placing the global statements into a function then instead of passing i, j, k you would need to pass the values directly.

I'll look up the algorithm and see if there are other changes that can be made.

Firstly you need to put all the global statements into a function because of Python code runs faster in a function compared to global scope.

You don't need the arr variable. You can just use

x[i], y[i] = map(int, raw_input().split())

instead of using the two lines. map uses the function(1st argument) on each of the outputs from the second argument.

After placing the global statements into a function then instead of passing i, j, k you would need to pass the values directly.

I'll look up the algorithm and see if there are other changes that can be made.

Source Link
Aseem Bansal
  • 2.3k
  • 3
  • 22
  • 37

Firstly you need to put all the global statements into a function because of Python code runs faster in a function compared to global scope.

You don't need the arr variable. You can just use

x[i], y[i] = map(int, raw_input().split())

instead of using the two lines. map uses the function(1st argument) on each of the outputs from the second argument.

After placing the global statements into a function then instead of passing i, j, k you would need to pass the values directly.

I'll look up the algorithm and see if there are other changes that can be made.

lang-py

AltStyle によって変換されたページ (->オリジナル) /