今天真$TM$又菜鸡了,无路赛无路赛。 估分:$100 + 0 + 40 = 140$ 考场:$30 + 0 + 40 = 70$ \(T1\) 算错时间复杂度了。。。我的莫队+倍增(看上去很高级的做法)是$O(n*sqrt(n)*logn)$,极限$19s$。。。 无语了,正解是线段树或者分块+\ ...
分类:
其他好文 时间:
2020-07-30 18:11:51
阅读次数:
57
#include <bits/stdc++.h> #define MAXN 200005 using namespace std; int node,edge,ans=0,k=0; int fat[MAXN],siz[MAXN]; struct EDGE { int from,to,cost; } ...
分类:
编程语言 时间:
2020-07-30 01:20:30
阅读次数:
71
节点的数据结构 struct Node { int value; struct Node* next; }; typedef struct Node Node; 操作和演示 #include <stdlib.h> #include <stdio.h> // 建立一个节点 Node *createNo ...
分类:
编程语言 时间:
2020-07-30 01:18:43
阅读次数:
82
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
// 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
一、开放定址法构造的哈希表的运算算法 1、哈希表类型 #define NULLKEY-1 //定义空关键字 #define DELKEY-2 //定义被删关键字 typedef int KeyType; //关键字类型 typedef struct { KeyType key; //关键字域 int ...
分类:
编程语言 时间:
2020-07-28 14:17:47
阅读次数:
71