摘要: lc 3306. 元音辅音字符串计数 II aeiou没必要一个一个敲 一个班级有10个人至少20岁,有3个人至少21岁,那么恰好20岁得人是多少?就是10-7,这题可以用这个思路来写,(灵神nb) class Solution { const string VOWEL = "aeiou"; //后 阅读全文
posted @ 2026-03-11 23:06 Time_q 阅读(11) 评论(0) 推荐(0)
摘要: 和相同的二元子数组 题目大意,就是求这个数组中和为k的子数组的个数 解题思路1:哈希map法 class Solution { public: int numSubarraysWithSum(vector<int>& nums, int goal) { int n=nums.size(); unor 阅读全文
posted @ 2026-03-11 22:03 Time_q 阅读(15) 评论(0) 推荐(0)
摘要: lc 2537. 统计好子数组的数目 code class Solution { public: long long countGood(vector<int>& nums, int k) { long long ans = 0; unordered_map<int, int> cnt; int p 阅读全文
posted @ 2026-03-11 17:04 Time_q 阅读(16) 评论(0) 推荐(0)
摘要: [原题链接(https://atcoder.jp/contests/dp/tasks/dp_j)] code #include<bits/stdc++.h> using namespace std; //"O campeão tem nome, e se chama Charles Oliveira 阅读全文
posted @ 2026-03-11 15:06 Time_q 阅读(20) 评论(0) 推荐(0)