摘要:
1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 { 6 string s; 7 cin>>s; 8 int ans=0,cnt=0; 9 for(auto &p:s) 10 { 11 if(p=='(')cnt++; 阅读全文
posted @ 2022-01-09 20:22
matt-11
阅读(53)
评论(0)
推荐(0)
摘要:
1 #include<bits/stdc++.h> 2 using namespace std; 3 int n; 4 5 unordered_map<string,set<string>>mp; 6 vector<string>vec; 7 unordered_map<string,int>ch; 阅读全文
posted @ 2022-01-09 20:19
matt-11
阅读(28)
评论(0)
推荐(0)
摘要:
1 任选两颗A,B两颗种子,pa是种A种子需要的天数,ga是A种子开花需要的天数; 2 1.考虑先种A,后种B 3 mina_day=max(pa+ga,pa+pb+gb); 4 2.先种B,后种A; 5 minb_day=max(pb+gb,pb+pa+ga); 6 7 不妨设ga>gb; 8 p 阅读全文
posted @ 2022-01-09 18:02
matt-11
阅读(64)
评论(0)
推荐(0)
摘要:
1 class Solution { 2 public: 3 int minSwaps(vector<int>& nums) { 4 int n=nums.size(),sum1=0; 5 for(auto &p:nums)if(p)sum1++; 6 for(int i=0;i<n;i++)num 阅读全文
posted @ 2022-01-09 14:06
matt-11
阅读(92)
评论(0)
推荐(0)
摘要:
1 class Solution { 2 public: 3 int wordCount(vector<string>& startWords, vector<string>& targetWords) { 4 int n=startWords.size(),ans=0; 5 unordered_s 阅读全文
posted @ 2022-01-09 13:54
matt-11
阅读(38)
评论(0)
推荐(0)

浙公网安备 33010602011771号