快手笔试3.9AC,破纪录的分数,mark一下。第一题:输出字符串中有效括号对数,落单左括号个数,落单右括号个数,通过90%第二题:题目忘了第三题:排队问题,按ai-bi的值从大到小排序就行bool cmp(pair a, pair b){return a.second > b.second;}vector WaitInLine(vector& a, vector& b) {// write code herepair couple;vector> vec;int diff;for (int i = 0; i {diff = a[i] - b[i];couple = make_pair(i + 1, diff);vec.push_back(couple);}sort(vec.begin(), vec.end(), cmp);vector res;for (int i = 0; i {res.push_back(vec[i].first);}return res;}第四题:一道比较简单的动态规划,但是写的可能有点啰嗦冲啊 #