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