mirror of
https://github.com/tiennm99/codeforces.git
synced 2026-10-11 16:12:51 +00:00
[Init] Solved solutions
This commit is contained in:
1 parent
51f667ac81
commit
20542601dd
131 files changed
+4148
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
bool b[10];
|
||||
|
||||
int main()
|
||||
{
|
||||
unsigned short n, m;
|
||||
cin >> n >> m;
|
||||
int *a = new int[n];
|
||||
for (unsigned short i = 0; i < n; i++)
|
||||
{
|
||||
cin >> a[i];
|
||||
}
|
||||
for (unsigned short i = 0; i < m; i++)
|
||||
{
|
||||
int t;
|
||||
cin >> t;
|
||||
b[t] = 1;
|
||||
}
|
||||
for (unsigned short i = 0; i < n; i++)
|
||||
{
|
||||
if (b[a[i]] == 1)
|
||||
{
|
||||
cout << a[i] << " ";
|
||||
}
|
||||
}
|
||||
delete[] a;
|
||||
a = NULL;
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user