-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB.cpp
More file actions
40 lines (37 loc) · 686 Bytes
/
B.cpp
File metadata and controls
40 lines (37 loc) · 686 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
#include<bits/stdc++.h>
using namespace std;
bool compare(string s1,string s2)
{
return s1.length()<s2.length();
}
int main()
{
int n,k;
string s;
cin>>n>>k;
vector <string> v(n);
for(int i=0;i<n;i++)
cin>>v[i];
cin>>s;
sort(v.begin(),v.end(),compare);
int l=s.length(),p1=-1,p2=-1;
for(int i=0;i<n;i++)
{
if(v[i].length()==l && p1==-1)
{
p1=i;
}
if(v[i].length()==l)
{
p2=i;
}
// cout<<v[i]<<endl;
}
p1++;
p2++;
//cout<<p1<<' '<<p2;
int t1=p1+((p1-1)/k)*5;
int t2=p2+((p2-1)/k)*5;
cout<<t1<<' '<<t2;
return 0;
}