struct point{ double x, y; }; struct line{ double A, B, C;//Ax + By + C = 0; }; line PPL(point a, point b){// 两点确定直线的一般式 if(a.x == b.x) return line{1, ...
分类:
其他好文 时间:
2020-07-29 17:50:20
阅读次数:
62
1004.Tokitsukaze and Multiple 求和为p的倍数的块的最大数量 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (register in ...
分类:
其他好文 时间:
2020-07-29 17:32:55
阅读次数:
99
##输出1到n以内所有的二进制回文数 #include <stdio.h> #define SIZE 50 typedef enum bool Bool; enum bool { false, true }; int main() { int n, i, j; Bool flag = false; ...
分类:
其他好文 时间:
2020-07-29 10:02:00
阅读次数:
84
// C++ #include<iostream> using namespace std; //链表的定义 struct ListNode { int val; ListNode* next; ListNode(int n) :val(n), next(nullptr) {} }; //链表的打印 ...
分类:
其他好文 时间:
2020-07-29 09:59:12
阅读次数:
68
#include <iostream> #include <map> using namespace std; typedef struct alertInfo { double alertUp; double alertDown; alertInfo(double up, double down) ...
分类:
其他好文 时间:
2020-07-28 22:25:22
阅读次数:
75
邻接表储存结构 /*邻接表的边*/ typedef struct ArcNode { int adjvex; struct ArcNode *next; }ArcNode; /*邻接表的结点*/ typedef struct VNode { char date; ArcNode *firstarc; ...
分类:
编程语言 时间:
2020-07-28 17:32:12
阅读次数:
91
题目 原题链接 解说 刷$Tarjan$题的时候看到的题目,第一次见到把分层图和$Tarjan$结合的题目,觉得这样的思路很有趣,写博客以记之。 总思路:建双层图->Tarjan缩点->最长路 首先看到题目中“只能走一次的逆向边”这样的条件,我们会很自然地想到建一个分层图。每一个点$i$在第二层有一 ...
分类:
其他好文 时间:
2020-07-28 17:19:27
阅读次数:
69
#include<bits/stdc++.h> using namespace std; const int N=450; struct data { int to,stb,vol; } a[N]; int head[2*N],root,tot,v[N],f[N][101],n,p,o[N]; in ...
分类:
移动开发 时间:
2020-07-28 16:55:50
阅读次数:
98
AcWing 788. 逆序对的数量 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N=1e6+10; int q[N],tmp[N]; LL merge_sort(int l,int r) ...
一、开放定址法构造的哈希表的运算算法 1、哈希表类型 #define NULLKEY-1 //定义空关键字 #define DELKEY-2 //定义被删关键字 typedef int KeyType; //关键字类型 typedef struct { KeyType key; //关键字域 int ...
分类:
编程语言 时间:
2020-07-28 14:17:47
阅读次数:
71