#include <stdio.h>
#include <stdlib.h>
int main() {
int N, repetidos = 0;
int *v1
= malloc(N
* sizeof (int)); int *aux
= malloc(N
* sizeof (int)); int *flag
= malloc(N
* sizeof (int)); int cont = 0;
for (int i = 0; i < N; i++) {
int achou = 0;
for (int j = 0; j < cont; j++) {
if (v1[i] == aux[j]) {
flag[j] = 1;
achou = 1;
break;
}
}
if (!achou) {
aux[cont] = v1[i];
flag[cont++] = 0;
}
}
for (int i = 0; i < cont; i++) {
repetidos += flag[i];
}
if (repetidos > 0) {
printf ("\n%d repetidos", repetidos
); }
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBtYWluKCkgewogICAgaW50IE4sIHJlcGV0aWRvcyA9IDA7CiAgICBwcmludGYgKCJFbnRyZSBjb20gTjogIik7CiAgICBzY2FuZiAoIiVkIiwgJk4pOwogICAgaW50ICp2MSA9IG1hbGxvYyhOICogc2l6ZW9mIChpbnQpKTsKIAlpbnQgKmF1eCA9IG1hbGxvYyhOICogc2l6ZW9mIChpbnQpKTsKCWludCAqZmxhZyA9IG1hbGxvYyhOICogc2l6ZW9mIChpbnQpKTsKCWludCBjb250ID0gMDsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTjsgaSsrKSB7CgkgICAgc2NhbmYgKCIlZCIsICZ2MVtpXSk7CgkJaW50IGFjaG91ID0gMDsKICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IGNvbnQ7IGorKykgewogICAgICAgICAgICBpZiAodjFbaV0gPT0gYXV4W2pdKSB7CiAgICAgICAgICAgICAgICBmbGFnW2pdID0gMTsKICAgICAgICAgICAgICAgIGFjaG91ID0gMTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmICghYWNob3UpIHsKICAgICAgICAJYXV4W2NvbnRdID0gdjFbaV07CiAgICAgICAgCWZsYWdbY29udCsrXSA9IDA7CiAgICAgICAgfQogICAgfQogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb250OyBpKyspIHsKICAgCQlyZXBldGlkb3MgKz0gZmxhZ1tpXTsKICAgIH0KICAgIGlmIChyZXBldGlkb3MgPiAwKSB7CiAgICAgICAgcHJpbnRmICgiXG4lZCByZXBldGlkb3MiLCByZXBldGlkb3MpOwogICAgfQp9