03 2022 档案
摘要:https://codeforces.com/contest/1313/problem/C1 // 构造一个单顶(峰)的数组,并且sum最大 // O(N^2) #include<bits/stdc++.h> using namespace std; int main() { int n; vect
阅读全文
摘要:题目链接 https://codeforces.com/problemset/problem/1654/C 切蛋糕,判断数组是否为合法的切割中间状态 #include<bits/stdc++.h> using namespace std; typedef long long ll; bool ok(
阅读全文
摘要:class Solution { public: int bestRotation(vector<int>& A) { int N = A.size(); vector<int> mark(N, 0); for (int i = 0; i < N; ++i) { int L = (i + 1) %
阅读全文
摘要:class Solution { public: bool isMatch(string s, string p) { int m = s.size(); int n = p.size(); auto matches = [&](int i, int j) { if (i == 0) { retur
阅读全文
摘要:组合数学 \(O(N\cdot M)\) class Solution { public: int f[10][10]; int C(int n, int m) { if (n == m || m == 0) return 1; return f[n][m] = C(n - 1, m - 1) +
阅读全文
摘要:class Solution { public: bool isSubsequence(string s, string t) { int n = s.length(), m = t.length(); int i = 0, j = 0; while (i < n && j < m) { if (s
阅读全文
摘要:解题思路 精彩 O(1) class Solution { public: bool isPalindrome(ListNode* head) { if (head == nullptr) { return true; } ListNode* firstHalfEnd = endOfFirstHal
阅读全文
摘要:微软一面 - 2022.3.7 GG 自我介绍 我有点草率,就单一点讲太多了,也没有跟面试官互动 大概几分钟吧,面试官也比较干脆,于是说,那就上题目? 然后就开始写题了…… 三门问题 面试官本意是想让我写随机模拟 哪知道我直接用古典概型给他求精确概率,应该给他整无语了 个人感觉应该很扣分吧,没有 g
阅读全文

浙公网安备 33010602011771号