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
|
||||
|
||||
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"
|
||||
|
||||
@@ -34,16 +34,12 @@ static int is_valid(int number, int part)
|
||||
dups[digit] += 2;
|
||||
}
|
||||
}
|
||||
if (!valid)
|
||||
return 0;
|
||||
if (part == 2) {
|
||||
valid = 0;
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
if (dups[i] == 2)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return valid;
|
||||
if (!valid || part == 1)
|
||||
return valid;
|
||||
for (int i = 0; i < 10; ++i)
|
||||
if (dups[i] == 2)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int doit(int *nums, int part)
|
||||
|
||||
Reference in New Issue
Block a user