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
#include <iostream> | |
#include <vector> | |
#include <cstdlib> | |
#include <algorithm> | |
#include <cassert> | |
using namespace std; | |
namespace Merge { |
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
def water(heights): | |
vol = 0 | |
currVol = 0 | |
maxWall = 0 | |
for h in heights: | |
if h>=maxWall: | |
# closed a puddle | |
vol += currVol | |
currVol = 0; | |
maxWall = h |
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
#include <time.h> | |
// #include <iostream> | |
// #include <errno.h> | |
int main() | |
{ | |
struct timespec tp; | |
int status = clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp); | |
// int errsv = errno; |