hiho week 190 register

Ended

Participants:97

Verdict:Accepted
Score:100 / 100
Submitted:2018-02-19 01:47:28

Lang:G++

Edit
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
#include<iostream>
#include<climits>
using namespace std;
#define N 32
int a[N],b[N];
int n,m,k,ans,min_ans;
void print(int *a,int n)
{
    for(int i=1;i<=n;i++)
        cout<<a[i]<<" ";
    cout<<endl;
    ans++;
}
bool check(int h)
{
    if(h>1&&h%2==1&&(a[h]-a[h-1])<0)
        return true;
    if(h>1&&h%2==0&&(a[h]-a[h-1])>0)
        return true;
    return false;
}
void dfs(int n,int h,int z)
{
    if(h==n+1)
    {
        min_ans=min(min_ans,z);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX