Skip to content

Instantly share code, notes, and snippets.

@peroon
Created March 14, 2017 16:20
Show Gist options
  • Select an option

  • Save peroon/869fab8ee85b6975f2916d7eeaa363f3 to your computer and use it in GitHub Desktop.

Select an option

Save peroon/869fab8ee85b6975f2916d7eeaa363f3 to your computer and use it in GitHub Desktop.
def call():
print('call')
for i in range(0, N):
for j in range(i+1, N):
call()
# Q. callは何回呼ばれるか?
# A. N-1, N-2, ..., 1の和なので、(N-1) * N / 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment