hiho week 87 register

Ended

Participants:392

Verdict:Accepted
Score:100 / 100
Submitted:2016-03-02 14:07:44

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 <stack>
#include <string>
#include <cstring>
#include <vector>
#include <unordered_map>
using namespace std;
const int MAX_LEN = 205;
int t;
bool error_exit;
vector<string> getSubOperands(vector<string> str, int from)
{
    std::vector<string> v;
    if (str[from] != "(")
        v.push_back(str[from]);
    else
    {
        stack<string> leftBracket;
        for (int i = from; i < str.size(); ++i)
        {
            if (str[i] == "(")
                leftBracket.push("(");
            else if (str[i] == ")")
            {
                leftBracket.pop();
                if (leftBracket.empty())
                {
                    v.push_back(")");
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX