hiho week 217 register

Ended

Participants:160

Verdict:Accepted
Score:100 / 100
Submitted:2018-08-26 01:41:39

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<bits/stdc++.h>
using namespace std;
struct node{
    int n;
    int t;
    int res;
    int c;
    int s[3];
}A[110];
int N,root;
int res(int x)
{
    int i,j,k,l;
    if(A[x].t<2)
    {
        A[x].res=A[x].n;
        A[x].c=-1;
        return A[x].res;
    }
    i=A[x].s[1];
    j=A[x].s[2];
    if(A[x].t==2)
    {
        A[x].res=res(i)&res(j);
        if(A[x].res==0)
        {
            if((A[i].res|A[j].res)==1)A[x].c=1;
            else{
                if(A[i].c==-1)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX