We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5907dc5 commit bd20834Copy full SHA for bd20834
Codechef solutions/QUIZPLAG.cpp
@@ -0,0 +1,43 @@
1
+// THIS QUESTION IS AVAILABLE ON CODECHEF https://www.codechef.com/problems/QUIZPLAG
2
+#include <iostream>
3
+#include<vector>
4
+#include<cstring>
5
+using namespace std;
6
+void solve()
7
+{
8
+ int n,m,k,id;
9
+ cin>>n>>m>>k;
10
+ int L[n+m+1];
11
+ memset(L,0,sizeof(L));
12
+ for(int i=1;i<=k;i++)
13
+ {
14
+ cin>>id;
15
+ L[id]++;
16
+ }
17
+ vector<int>ans;
18
+ for(int i=1;i<=n;i++)
19
20
+ if(L[i]>1)
21
22
+ ans.push_back(i);
23
24
25
+ int size=ans.size();
26
+ cout<<size;
27
+ for(int i=0;i<size;i++)
28
29
+ cout<<" "<<ans[i];
30
31
+ cout<<endl;
32
+
33
+}
34
35
+int main() {
36
+ int t;
37
+ cin>>t;
38
+ while(t--)
39
40
+ solve();
41
42
+ return 0;
43
0 commit comments