-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcodecheif.cpp
More file actions
54 lines (48 loc) · 936 Bytes
/
codecheif.cpp
File metadata and controls
54 lines (48 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include<iterator>
#include<unordered_map>
#include<iterator>
using namespace std;
#define ll long long int
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int testcase;cin>>testcase;
while(testcase--)
{
unordered_map<int, int> a;
unordered_map<int, int> b;
int n,j=0;
while(n--)
{
int x;
cin>>x;
a[x]++;
}
while(n--)
{
int x;
cin>>x;
a[x]++;
}
for (auto x : mp)
{
if(((x.second)&1)==1)
{
j++;
break;
}
}
// cout << x.first << " " << x.second << endl;
if(j!=0)
{
cout<<"-1";
}
}
return 0;
}