摘要: 用栈简单模拟就可以 class Solution { public: int minOperations(vector<string>& logs) { stack<int> st; for(auto s:logs){ if(s[0]=='.'&&s[1]=='.'){ if(st.size()) 阅读全文
posted @ 2020-09-27 17:11 CrosseaLL 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 通过dfs搜出每条边会被走过的次数 然后贪心的分配就行 #include<bits/stdc++.h> using namespace std; #define rep(i,j,k) for(LL i=(j); i<(k); ++i) #define pb push_back #define PII 阅读全文
posted @ 2020-09-27 17:05 CrosseaLL 阅读(101) 评论(0) 推荐(0) 编辑