Compare commits
2 Commits
2694f8d4d0
...
0ce9f9aafa
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ce9f9aafa | |||
| ea530e7d8d |
@@ -41,7 +41,8 @@ CFLAGS += -DDEBUG_DEBUG # activate general debug (debug.c)
|
|||||||
CFLAGS += -DDEBUG_POOL # memory pools management
|
CFLAGS += -DDEBUG_POOL # memory pools management
|
||||||
|
|
||||||
VALGRIND := valgrind
|
VALGRIND := valgrind
|
||||||
VALGRINDFLAGS := -q -s --leak-check=full --show-leak-kinds=all --track-origins=yes
|
VALGRINDFLAGS := --leak-check=full --show-leak-kinds=all --track-origins=yes \
|
||||||
|
--sigill-diagnostics=yes --quiet --show-error-list=yes
|
||||||
|
|
||||||
|
|
||||||
TIME := \time -f "\ttime: %E real, %U user, %S sys\n\tcontext-switch:\t%c+%w, page-faults: %F+%R\n"
|
TIME := \time -f "\ttime: %E real, %U user, %S sys\n\tcontext-switch:\t%c+%w, page-faults: %F+%R\n"
|
||||||
|
|||||||
@@ -34,16 +34,12 @@ static int is_valid(int number, int part)
|
|||||||
dups[digit] += 2;
|
dups[digit] += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!valid)
|
if (!valid || part == 1)
|
||||||
return 0;
|
return valid;
|
||||||
if (part == 2) {
|
for (int i = 0; i < 10; ++i)
|
||||||
valid = 0;
|
if (dups[i] == 2)
|
||||||
for (int i = 0; i < 10; ++i) {
|
return 1;
|
||||||
if (dups[i] == 2)
|
return 0;
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return valid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int doit(int *nums, int part)
|
static int doit(int *nums, int part)
|
||||||
|
|||||||
Reference in New Issue
Block a user