/**
 * Created by IntelliJ IDEA.
 * User: Taras_Brzezinsky
 * Date: 8/13/11
 * Time: 6:10 PM
 * To change this template use File | Settings | File Templates.
 */

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
import java.io.IOException;

public class DarkAssembly extends Thread {

    public DarkAssembly() {
        this.input = new BufferedReader(new InputStreamReader(System.in));
        this.output = new PrintWriter(System.out);
        this.setPriority(Thread.MAX_PRIORITY);
    }

    static class Senator {
        int loyalty;
        int level;

        public Senator(int level, int loyalty) {
            this.level = level;
            this.loyalty = loyalty;
        }
    }

    private static double doIt(Senator[] senators, int A) {
        double probability = .0;
        for (int mask = 0; mask < (1 << senators.length); ++mask) {
            int sum = A;
            double current = 1.0;
            for (int i = 0; i < senators.length; ++i) {
                if ((mask & (1 << i)) != 0) {
                    current *= .01 * senators[i].loyalty;
                } else {
                    current *= .01 * (100 - senators[i].loyalty);
                    sum += senators[i].level;
                }
            }
            if (getOnes(mask) > senators.length / 2) {
                probability += current;
            } else {
                probability += current * (double)A / sum;
            }
        }
        return probability;
    }

    private static double go(Senator []senators, int candies, int A, int current) {
        if (current == senators.length) {
            return doIt(senators, A);
        } else {
            double result = go(senators, candies, A, current + 1);
            if (candies > 0 && senators[current].loyalty < 100) {
                senators[current].loyalty += 10;
                result = Math.max(result, go(senators, candies - 1, A, current));
                senators[current].loyalty -= 10;
         ... What is the time complexity of the previous code?