-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUncle Johny.cpp
More file actions
38 lines (30 loc) · 777 Bytes
/
Uncle Johny.cpp
File metadata and controls
38 lines (30 loc) · 777 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
Home » Uncle Johny » All Submissions » devika_sugathn [17818246]
Solution: 17818246
CodeChef submission 17818246 (C++14) plaintext list. Status: AC, problem JOHNY, contest CODECHEF. By devika_sugathn (devika_sugathn), 2018-03-12 20:06:00.
# include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
for(int i=0;i<t;i++)
{ int n,pos=0;
cin>>n;
int a[n];
for(int j=0;j<n;j++)
{
cin>>a[j];
}
int l;
cin>>l;
int temp =a[l-1];
for(int k=0;k<n;k++)
{ sort(a,a+n);
if(a[k]==temp)
{ pos=k;
}
}
cout<<pos+1<<endl;
}
return 0;
}