main.c (629B)
1 #include <stdio.h> 2 #include <time.h> 3 #include <string.h> 4 5 void puzzle(const char *filename, long long *res1, long long *res2); 6 7 int main(int argc, char *argv[]) { 8 printf("Advent of Code: day 15\n"); 9 double time_start = clock(); 10 11 if (argc <= 1) { 12 printf("Usage: %s inputfile.txt\n", argv[0]); 13 return -1; 14 } 15 16 const char *filename = argv[1]; 17 long long counter1 = -1; 18 long long counter2 = -1; 19 20 puzzle(filename, &counter1, &counter2); 21 22 printf("Puzzle #1: %lld\n", counter1); 23 printf("Puzzle #2: %lld\n", counter2); 24 25 double elapsed = clock() - time_start; 26 printf("Elapsed: %f\n", elapsed / CLOCKS_PER_SEC); 27 28 return 0; 29 }