Skip to content

Instantly share code, notes, and snippets.

@lawrencefmm
Created April 8, 2019 19:06
Show Gist options
  • Select an option

  • Save lawrencefmm/957882a7e73cc359c3673b76f20d020d to your computer and use it in GitHub Desktop.

Select an option

Save lawrencefmm/957882a7e73cc359c3673b76f20d020d to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
while(cin >> n >> m)
{
if(!n and !m) break;
int v[10010];
memset(v, 0, sizeof(v));
for(int i = 1; i <= m; i++)
{
int bilhete;
cin >> bilhete;
v[bilhete]++;
}
int cont = 0;
for(int i = 1; i <= n; i++)
{
if(v[i] > 1) cont++;
}
cout << cont << "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment