05 2022 档案
摘要:##分支算法 ###题意描述: 在2k * 2k的正方形棋盘上有一个缺口,这里可以认为是已经被填充了,要求给出使用三角板去填满这个棋盘的方案 #include <iostream> using namespace std; int amount,Board[100][100]; void Cover
阅读全文
摘要:#include <iostream> using namespace std; const int N = 100010, MOD = 1e9 + 7; int n1, n2, m; // n1种普通币,n2种纪念币,凑成面值m int f[N]; // 背包问题:完全背包(普通币) + 0/1背
阅读全文
摘要:#include <iostream> #include <algorithm> #include <cstring> using namespace std; const int N = 1010; int a[N], b[N]; int n; int main() { while(cin >>
阅读全文
摘要:#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 100010; int n; int a[N], f[N], g[N];
阅读全文
摘要:#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 10010; int n; struct Segment { int x,
阅读全文
摘要:####不修改val的值,只改变链表结构,时间复杂度O (nlgn), 额外空间O(lgn) class Solution { public: ListNode* getTail(ListNode *head){ while(head->next){ head = head->next; } ret
阅读全文
摘要:ACwing class Solution { public: vector<int> getMinimumValue(int n) { const int INF = ~(1 << 31); //自然是有符号数的最大值 int l = 0, r = n - 1; //二分边界 while(l <=
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 1010; int n,m; int cnt; int mp[N][N]; int ans[N*N]; //mp 该点所属连通块的标号, ans表示该连通块的大小 char g[N
阅读全文
摘要:csdn 能添加&符号的就是左值,否则就是右值,匿名变量一律都属于右值
阅读全文
摘要:vector的find函数 int pos=s.find(' '); 返回vector中第一个' '的下标
阅读全文