原创 2019杭電多校第一場string(序列自動機)

#include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<cstdlib> #include<cmath> #include<st

原创 U41492 樹上數顏色(dsu on tree)

#include<bits/stdc++.h> #define endl '\n' #define PB push_back #define ll long long using namespace std; const int

原创 CCPC-Wannafly & Comet OJ 夏季歡樂賽(2019)茶顏悅色(掃描線)

#include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<cstdlib> #include<cmath> #include<st

原创 線段是否和圓相交

#include<bits/stdc++.h> using namespace std; const double EPS = 1e-8; struct point{ double x, y; }; point a, b, c;

原创 2018-2019 ACM-ICPC, 徐州 G. Rikka with Intersections of Paths(樹上差分+lca+容斥)

樹上差分求出一個點被幾條邊覆蓋(num[i]), 然後容斥算貢獻 #include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<cst

原创 The 13th Chinese Northeast Collegiate Programming Contest H Skyscraper

#include <iostream> #include <cstring> #include <cstdio> #include <queue> #include <cstdlib> #include <cmath> #incl

原创 2019杭電多校第1場 operation

暴力的做法可以用數據結構維護區間線性基,但肯定過不了。 貪心地維護序列的前綴線性基 (上三角形態),對於每個線性基,將出現位置靠右的數 字儘可能地放在高位,也就是說在插入新數字的時候,要同時記錄對應位置上數字的出現位 置,並且在找

原创 HDU Atlantis掃描線入門

#include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<cstdlib> #include<cmath> #include<st

原创 2019杭電多校部分題解的blog合集

HDU杭電多校第五場 6628 permutation 1 https://blog.csdn.net/zufesatoshi/article/details/98615028 最小費用最大流模板(ek和dinic) https:

原创 洛谷P1005 矩陣取數遊戲(附__int128版本)(區間dp入門)

#include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<cstdlib> #include<cmath> #include<st

原创 白兔的字符串(hash+模擬map)

#include<bits/stdc++.h> #define ll long long #define PB push_back #define endl '\n' #define INF 0x3f3f3f3f #define

原创 fhq 平衡樹

P3369 【模板】普通平衡樹(按照val值分裂) #include<bits/stdc++.h> #define random(x) ((rand() % x)) #define endl '\n' using namespac

原创 杭電多校第五場 three arrays

兩個序列每個建一顆字典樹然後dfs #include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<cstdlib> #include<

原创 數位dp回顧

不會數位dp的同學點這裏 數位dp教學 #include<bits/stdc++.h> using namespace std; #define ll long long #define lb long double #defi

原创 洛谷P2597 [ZJOI2012]災難

#include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<cstdlib> #include<cmath> #include<st