Created
April 8, 2019 19:06
-
-
Save lawrencefmm/957882a7e73cc359c3673b76f20d020d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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