unrated 呜呜呜 #A 直接全输出1完事 #include <bits/stdc++.h> #define all(n) (n).begin(), (n).end() #define se second #define fi first #define pb push_back #define ...
分类:
其他好文 时间:
2020-07-12 12:42:52
阅读次数:
57
#pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e5 + 100; const int maxm = 1e6 + 100; co ...
分类:
其他好文 时间:
2020-07-11 21:14:46
阅读次数:
65
双链表一个节点里面有两个指针,一个指向左边,一个指向右边 不定义头结点和尾结点了 令下标是0的点表示head 令下标是1的点表示tail 邻接表的知识:把每个点的所有邻边全部存下来 邻接表就是n个单链表 head[i]存储第i个点的邻边 1 #include <bits/stdc++.h> 2 us ...
分类:
其他好文 时间:
2020-07-11 19:14:03
阅读次数:
46
牧场的安排 具体见代码: 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int mod = 1e8; 5 6 // dp[i][j]:第i行,第j种状态的方案数 7 int n, m ...
分类:
其他好文 时间:
2020-07-10 21:10:53
阅读次数:
63
涂抹果酱 题目分析:这道题跟上一道题有点像,不过这题有三种,所以想到三进制,而不是二进制了,然后把1,2,3化成0,1,2;然后,相应的比较部分换一下就好了 AC_Code: 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef lo ...
分类:
其他好文 时间:
2020-07-10 21:04:16
阅读次数:
77
题目 P1457 [USACO2.1]城堡 The Castle 思路 三遍DFS求解 代码 #include<bits/stdc++.h> using namespace std; int n,m; const int maxn=50+5; int a[maxn][maxn][maxn][maxn ...
分类:
其他好文 时间:
2020-07-10 18:45:26
阅读次数:
94
最近一直在做图论的题目。对于初始化的效率要求比较高。正巧我也对这三个函数不是很清楚。 就写了个测试程序来测试效率 测试程序: #include <bits/stdc++.h> //#pragma GCC optimize(2) using namespace std; #define max 100 ...
分类:
其他好文 时间:
2020-07-10 13:03:50
阅读次数:
82
把数组中所有的奇数放到偶数的左边不在意顺序 #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int N; int a[maxn]; int main() { scanf("%d", &N); for(i ...
分类:
编程语言 时间:
2020-07-10 09:21:57
阅读次数:
79
先求一下lca,之后比较一下给定两点的lca与所求点的关系后分类讨论 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=2e5+10; int h[N],ne[N],e[N],idx; int ...
分类:
其他好文 时间:
2020-07-09 23:58:04
阅读次数:
88
链表总结 链表基础 如何实现一个单链表 #include "bits/stdc++.h" using namespace std; struct MyListNode { int data; MyListNode *next; MyListNode(int left = -1, MyListNode ...
分类:
其他好文 时间:
2020-07-09 22:31:25
阅读次数:
55