咸鱼上接的单,赚了80
码农不管再怎么被黑,也是学以致用率最高的一个行业。
#include<bits/stdc++.h>
using namespace std;
vector<string> suffix_expression;
vector<string> operator_stack;
vector<string> opt_table;
map<string, int> opt_id_map;
map<string, int> opt_priority;
struct node {
int l, r;
int opt;
string label;
bool operator < (const node a) const {
return opt <= a.opt;
}
bool operator == (const node a) const {
return l == a.l && r == a.r && opt == a.opt && label == a.label;
}
};
vector<struct node> node_table;
map<struct node, int> node_id_map;
int new_opt(string s, int priority)
{
opt_table.push_back(s);
opt_id_map[s] = opt_table.size() - 1;
opt_priority[s] = priority;
return opt_table.size() - 1;
}
void print_opt(int opt_id)
{
cout << "