Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>;
- #include <vector>;
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(0);
- freopen ("tickets.in", "r", stdin);
- freopen ("tickets.out", "w", stdout);
- int n,m, t, count=0;
- cin>>n>>m;
- int a[n];
- for(int i = 1; i <=n; i++) a[i] = 0;
- for(int i = 1; i <= m; i++){
- cin>>t;
- a[t]++;
- }
- for(int i = 1; i <=n; i++){
- if(a[i] > 1) count++;
- }
- cout<<count<<"\n";
- if(count == 0) return 0;
- for(int i = 1; i <= n; i++){
- if(a[i] > 1) cout<<i<<" ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement