Posts Tagged ‘Python’

Solving equations of upper triangular matrices

Upper triangular matrices

Suppose you have an equation like with and . and are given and you want to solve for . Example With , the problem could look like this: This is only a shorthand for: First step: Solve for First you see that . So you divide by the current row. Don’t divide through 0. When [...]

Solving equations of lower unitriangular matrices

Unipotent lower triangular matrix

Suppose you have an equation like with and . and are given and you want to solve for . Example With , the problem could look like this: This is only a shorthand for: This is easy to solve, isn’t it? First step: Solve for First you see that . Now you replace every occurence [...]

Google Code Jam – Round 1B 2013

Google Code Jam Logo Thumbnail

Problem A (Osmos): Small Set: 4668/7250 users (64%) Large Set: 3537/4578 users (77%) Problem B (Falling Diamonds): Small Set: 952/1882 users (51%) Large Set: 525/724 users (73%) Problem C (Garbled Email): Small Set: 444/896 users (50%) Large Set: 255/345 users (74%) More information are on go-hero.net. Osmos Falling Diamonds Oncee you’ve read the task, you [...]

Google Code Jam – Round 1A 2013

Google Code Jam Logo Thumbnail

Problem A (Bullseye): Small Set: 5856/6195 users (95%) Large Set: 1806/4795 users (38%) Problem B (Manage your Energy): Small Set: 2323/3789 users (61%) Large Set: 456/1133 users (40%) Problem C (Good Luck): Small Set: 1366/1774 users (77%) Large Set: 31/605 users (5%) More information might soon be on go-hero.net. I’m too slow for Google Code [...]

Google Code Jam Templates

Google Code Jam Logo Thumbnail

Here are some templates that are a good start for Google Code Jam. C++ Compile Execute Python Input: input, raw_input() String parsing: strip(), split() Execute Java This is an ajusted version of mystics solution for “Dancing with Googlers”. You might want to take a look at Scanner and PrintWriter. Adjust the path and execute it [...]

What does #!/usr/bin/python mean?

Python-Logo

You’ve probably already seen one of the following lines: This is a shebang. It’s a directive for your command line interpreter how it should execute a script. For example, you have a file with this content: Now you can execute it via python3 yourFile.py. But alternatively, you can make it executable and simply type ./yourFile.py [...]

Part II: The Strassen algorithm in Python, Java and C++

Strassen algorithm - Thumbnail

This is Part II of my matrix multiplication series. Part I was about simple implementations and libraries: Performance of Matrix multiplication in Python, Java and C++ The usual matrix multiplication of two matrices has a time-complexity of . This means, if doubles, the time for the computation increases by a factor of 8. But you [...]