Submission #19724607


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;

#define repi(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,a) repi(i,0,a)
#define rrep(i,a) for(ll i=a-1;i>=0;i--)
#define MOD 1000000007

//debug
#define debug(arr) cerr<<#arr<<"(l"<<__LINE__<<") : ";for(auto x:arr)cerr<<x<<" ";cerr<<endl;

int main(){
  ll N;
  cin >> N;
  ll A[1<<N], B[1<<N];
  rep(i, 1<<N){
    cin >> A[i];
    B[i] = A[i];
  }
  ll semi, ans;
  rep(rnd, N){
    rep(n, 1<<(N-rnd-1)){
      ll l = n << (rnd+1);
      ll r = l + (1<<rnd);
      if(rnd == N-1) semi = min(A[l], A[r]);
      if(A[l] < A[r]) A[l] = A[r]; 
    }
  }
  rep(i, 1<<N) if(B[i] == semi) ans = i + 1;
  cout << ans << endl;
  return 0;
}

Submission Info

Submission Time
Task C - ABC Tournament
User graythunder
Language C (GCC 9.2.1)
Score 0
Code Size 791 Byte
Status CE

Compile Error

./Main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.