-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathC.cpp
More file actions
53 lines (49 loc) · 966 Bytes
/
C.cpp
File metadata and controls
53 lines (49 loc) · 966 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
#include<bits/stdc++.h>
using namespace std;
int main()
{
int x,xx;
cin>>x;
long long n=pow(2,x);
vector <int> v(n),a(n),aa;
for(int i=0;i<n;i++)
{
cin>>v[i];
a[i]=v[i];
}
while(v.size()!=2)
{
int i=0;
while(i<v.size())
{
if(i+1<v.size())
{
if(v[i]>v[i+1])
{
v.erase(v.begin()+(i+1));
i++;
continue;
}
else
{
v.erase(v.begin()+i);
i++;
continue;
}
}
else
{
i++;
}
}
}
int m=min(v[0],v[1]);
//cout<<v[0]<<' '<<v[1];
for(int i=0;i<n;i++)
{
if(a[i]==m)
cout<<i+1;
}
//cout<<endl<<m;
return 0;
}