Submission #19327272


Source Code Expand

#include<bits/stdc++.h>

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define fst first
#define snd second
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define EPS (1e-9)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

bool LT(double a,double b) { return !equals(a,b) && a < b; }
bool LTE(double a,double b) { return equals(a,b) || a < b; }

const string YES = "";
const string NO  = "";

typedef long long ll;
typedef pair<int,int> ii;

int n;
vector<int> A;

int main() {
  cin >> n;
  A.clear();
  int v;
  rep(i,(1<<n)) {
    cin >> v;
    A.pb(v);
  }
  int p1=0,p2=(1<<n)-1;
  int m = (1<<n) / 2;
  rep(i,m) {
    if( A[p1] < A[i] ) p1 = i;
  }
  REP(i,m,(1<<n)) {
    if( A[p2] < A[i] ) p2 = i;
  }
  if( A[p1] < A[p2] ) {
    cout << p1 + 1 << endl;
  } else {
    cout << p2 + 1 << endl;
  }
  
  return 0;
}

Submission Info

Submission Time
Task C - ABC Tournament
User Eldora
Language C++ (GCC 9.2.1)
Score 300
Code Size 914 Byte
Status AC
Exec Time 25 ms
Memory 3760 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 12
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All extreme_00.txt, handmade_00.txt, handmade_01.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
extreme_00.txt AC 20 ms 3648 KiB
handmade_00.txt AC 2 ms 3624 KiB
handmade_01.txt AC 2 ms 3588 KiB
random_00.txt AC 23 ms 3584 KiB
random_01.txt AC 25 ms 3760 KiB
random_02.txt AC 23 ms 3620 KiB
random_03.txt AC 2 ms 3460 KiB
random_04.txt AC 2 ms 3528 KiB
random_05.txt AC 2 ms 3408 KiB
sample_01.txt AC 2 ms 3524 KiB
sample_02.txt AC 2 ms 3520 KiB
sample_03.txt AC 1 ms 3496 KiB