This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
height = int(sys.argv[1]) | |
total = 0 | |
row = 0 | |
for i in range(height): | |
row = i + height | |
print " "*(height-i) + "<>"*row | |
total = total+row |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static class NonsimultaneousTimeSeries<T> extends TreeMap<Long, T> { | |
@Override | |
public T put(Long when, T what) { | |
//If something already happened on this millisecond, try the next one: | |
while(containsKey(when)) when++; | |
return super.put(when, what); | |
} |