-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathcodegladiors2020problem2.cpp
More file actions
57 lines (54 loc) · 939 Bytes
/
codegladiors2020problem2.cpp
File metadata and controls
57 lines (54 loc) · 939 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
55
56
57
/*Enter your code here. Read input from STDIN. Print your output to STDOUT*/
#include <iostream>
#include <bits/stdc++.h>
#include <list>
using namespace std;
int main()
{
//Write code here
long int t;
cin>>t;
for(long int j=0; j<t; j++)
{
long int n;
cin>>n;
list<long int> arr1;
list<long int> arr2;
long int p;
for(long int i=0;i<n;i++)
{
cin>>p;
arr1.push_back(p);
}
cout<<"hello";
for(long int i=0;i<n;i++)
{
cin>>p;
arr2.push_back(p);
}
cout<<"hello";
arr1.sort();
//cout<<arr1;
arr2.sort();
//cout<<arr2;
long int c=0;
long int a=0, b=0;
cout<<"hello /n";
long int len = arr1.size();
while(len!=0)
{
if (arr1.front() > arr2.front())
{
c=c+1;
arr1.pop_front();
arr2.pop_front();
len--;
}
else
{
arr2.pop_front();
}
}
cout<<c;
}
}