-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwetclothes.cpp
More file actions
55 lines (40 loc) · 710 Bytes
/
Copy pathwetclothes.cpp
File metadata and controls
55 lines (40 loc) · 710 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
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n,m,g;
cin>>n>>m>>g;
int t[n],a[m];
int t1[n-1];
for(int i=0;i<n;i++)
{
cin>>t[i];
}
for(int j=0;j<m;j++)
{
cin>>a[j];
}
int temp=0;
long long int c=0;
bool visited[m];
for(int i=0;i<m;i++)
{
visited[i]=false;
}
for(int i=1;i<n;i++)
{
// temp=0;
temp=t[i]-t[i-1];
for(int j=0;j<m;j++)
{
if((temp>=a[j])&&(visited[j]==false))
{
c++;
visited[j]=true;
}
}
}
// sort(t1,t1+n-1);
// sort(a,a+n);
cout<<c<<endl;
}