-
Notifications
You must be signed in to change notification settings - Fork 0
/
50792116.cpp
61 lines (61 loc) · 1.12 KB
/
50792116.cpp
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
58
59
60
61
#include <iostream>
using namespace std;
int main()
{
int n,m,k;
cin>>n>>m>>k;
int students[n];
int schools[n];
for(int i =0 ; i<n;i++)
{
cin >> students[i];
}
for(int i =0 ; i<n;i++)
{
cin >> schools[i];
}
int cheat[k];
//cout<<"hh"<<endl;
for(int i=0;i<k;i++)
{
cin >> cheat[i];
}
//cout<<"kkkk"<<endl;
int result[m];
for(int i =1;i<=m;i++)
{
int max=0;
int index_max=0;
for(int j =0;j<n;j++)
{
if(schools[j]==i)
{
if(students[j]>max)
{
max = students[j];
index_max = j;
}
}
}
result[i-1] = index_max+1;
}
int sum=0;
for(int i =0;i<k;i++)
{
for(int j=0;j<m;j++)
{
if(cheat[i] == result[j])
{
sum++;
break;
}
}
}
/*for(int i =0;i<m;i++)
{
cout <<"result[i]: " << result[i]<< endl;
}
cout << "sum: " << sum << endl;*/
cout << k-sum<< endl;
return 0;
}