随笔分类 - AcWing
P52 数组中出现次数超过一半的数字
摘要:题目链接: 方法一: 若数组中有数字的出现次数超过数组长度的一半(绝对众数),则将该数组排序后中间位置的数一定就是该数。 class Solution { public: int moreThanHalfNum_Solution(vector<int>& nums) { sort(nums.begi
AcWing 768. 忽略大小写比较字符串大小
摘要:题目链接: #include <iostream> using namespace std; string get(string s) { string res; for (auto c : s) res += tolower(c); return res; } int main() { strin
AcWing 3559. 围圈报数
摘要:考点:约瑟夫环问题,环形链表,队列 #include <bits/stdc++.h> using namespace std; const int N = 55; int ne[N];//链表指针数组 int main() { ios::sync_with_stdio(false), cin.tie