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
from memory_profiler import profile | |
def chunks_with_list(l): | |
return [ | |
l[i:i + 100] for i in range(0, len(l), 100) | |
] | |
def chunks_with_gen(l): |
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 random | |
N_MIN = 3 | |
N_MAX = pow(10, 7) # 10e7 | |
M_MIN = 1 | |
M_MAX = 2 * pow(10, 5) # 2 * 10e5 | |
K_MIN = 0 | |
K_MAX = pow(10, 9) # 10e9 | |
AB_MIN = 1 | |
AB_MAX = N_MAX |
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
filetype plugin indent on | |
language en_US | |
set noswapfile | |
" line numbers | |
set relativenumber | |
" tab as spaces | |
set tabstop=4 |
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
#ifndef VMS | |
/* | |
* Wait "msec" msec until a character is available from file descriptor "fd". | |
* "msec" == 0 will check for characters once. | |
* "msec" == -1 will block until a character is available. | |
* When a GUI is being used, this will not be used for input -- webb | |
* Returns also, when a request from Sniff is waiting -- toni. | |
* Or when a Linux GPM mouse event is waiting. | |
*/ | |
#if defined(__BEOS__) |