摘要:
题目链接 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 阅读全文