惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
Engineering at Meta
Engineering at Meta
Forbes - Security
Forbes - Security
MongoDB | Blog
MongoDB | Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
A
About on SuperTechFans
量子位
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
雷峰网
雷峰网
腾讯CDC
P
Proofpoint News Feed
S
Schneier on Security
S
Secure Thoughts
V
Visual Studio Blog
Help Net Security
Help Net Security
The Hacker News
The Hacker News
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Privacy International News Feed
SecWiki News
SecWiki News
S
SegmentFault 最新的问题
T
Threatpost
小众软件
小众软件
MyScale Blog
MyScale Blog
F
Fortinet All Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
T
Tailwind CSS Blog
I
Intezer
C
CERT Recently Published Vulnerability Notes
U
Unit 42
V
V2EX
Cyberwarzone
Cyberwarzone
Recorded Future
Recorded Future
O
OpenAI News
Project Zero
Project Zero
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
Know Your Adversary
Know Your Adversary
C
Cybersecurity and Infrastructure Security Agency CISA
Scott Helme
Scott Helme
V2EX - 技术
V2EX - 技术
博客园 - 叶小钗
S
Securelist
A
Arctic Wolf
The Cloudflare Blog
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
博客园 - Franky

某岛

AtCoder Beginner Contest 409 Luogu P5325. 【模板】Min_25 筛 UOJ #188. 【UR #13】Sanrd AtCoder Beginner Contest 371 AtCoder Beginner Contest 369 RPGMaker 2k3 百科 OneShot 的考古 2024“开创拓芯”游戏创享节的相关记录 CJ 回来后的戒断反应 Luogu P10221. [省选联考 2024] 重塑时光 Luogu P5308 [COCI2018-2019#4] Akvizna wqs 二分 歌唱王国 Lean 相关 BZOJ 3153. Sone1 The 2023 ICPC World Finals Luxor 新巴别塔 Sora 的想象与思考 Facebook Hacker Cup 2023 Round 1 AtCoder Beginner Contest 322 LLaMA 2 相关 HuggingFace AI Game Jam ACL 2023 Trans 相关… Luogu P2053. [SCOI2007] 修车 Luogu P1973. [NOI2011] NOI 嘉年华 Luogu P1933. [NOI2010] 旅行路线 Luogu P1954. [NOI2010] 航空管制 Luogu P2048. [NOI2010] 超级钢琴 Luogu P2046. [NOI2010] 海拔 Luogu P3227. [HNOI2013] 切糕 Luogu P8500. [NOI2022] 冒泡排序 Luogu P3629. [APIO2010] 巡逻 USACO 2018 February Contest, Gold Problem 2. Directory Traversal Luogu P3647. [APIO2014] 连珠线 IZhO 2017. Problem F. Hard route SPOJ TWOPATHS. Two Paths 换根 dp 洪恩电脑 —— 开天辟地 Facebook Hacker Cup 2022 Round 2 Codeforces Round #875 Luogu P5828 边双连通图计数 EC Final 拉格朗日反演定理 Luogu P5827. 点双连通图计数 无标号连通图 AtCoder Beginner Contest 284 Luogu P4708. 画画 Luogu P6295. 有标号 DAG 计数 BZOJ #2863. 愤怒的元首 HDU 3303. Harmony Forever 聊聊《明日方舟 Side Story 孤星》与《崩坏:星穹铁道》 SGU 208. Toral Tickets 后日谈,SHLUG 月度分享(上) 钢琴练习 EasyRPG x ChatGPT ControlNet 相关 The 1st Universal Cup, Stage 4, Ukraine EasyRPG —— Sliding Puzzle The 1st Universal Cup, Stage 3, Poland DP 优化练习 NOI 2009 TypeDB Forces 2023 Nas 买来做什么… Global Game Jam 2023 参赛纪录 The 1st Universal Cup, Stage 2, Hongkong The 1st Universal Cup, Stage 0, Nanjing Codeforces Round #850 舟游同人游戏 RM2k3 机能增强 —— EasyRPG Player 魔改版 《海之歌》设定与剧本 dfs 序求 lca Codeforces Round #844 P3768 简单的数学题 AtCoder Beginner Contest 281 ChatGPT 相关 AtCoder Grand Contest 059 AtCoder Beginner Contest 280 Codeforces Global Round 24 事实核查,以乌鲁木齐火灾为例 SPOJ MUSKET. Musketeers Pinely Round 1 Note about FTX Permutation ICPC World Final 2021 CodeTON Round 3 Codeforces Round #831 Educational Codeforces Round 138 NovelAI 法术指南 卡农 Educational Codeforces Round 135 Codeforces Round #819 瓦喵之夏 NOI 2022 Luogu P3765 总统选举 Luogu P3369 【模板】普通平衡树 网络国家 旋转卡壳 OFAC Sanctions && Tornado Cash BZOJ 1185. [HNOI2007]最小矩形覆盖
Atcoder 算法库
2021-06-30 · via 某岛

June 30, 2021

Atcoder 算法库(ACL) 出了快一年了,一直没仔细看,这两天写 《天才算法少女》 的主线剧情,正好复习一下这个。不过这玩意更新的着实挺慢的,还没我的 Template 算法多。。。不过至少可以和 rng_58 学习一下怎么写 test 。。。

首先讲一下怎么像 STL 一样加入 cpp 的默认头文件,方法当然是编辑编译器的 Search directories。这个库结构非常简单,对于不支持 ACL 的 OJ,估计也可以手动展开一下。

例题

为了推广这个库,rng_58 还准备了两场 ACL contest,用来测试模板。当然这个东西的适用范围还有待观察,毕竟模板的缺点是不能进去魔改,最典型的缺陷可能就是无法给 std::set<int> 里的二叉树节点加卫星数据 size 以实现求第 kth 大这种实用操作。。。?。。。(比如需要加卫星数据的并查集可能也没法搞了)

A – Disjoint Set Union

并查集
https://vjudge.net/problem/AtCoder-abc181_f

B – Fenwick Tree

树状数组

C – Floor Sum

等差数列每一项除以 M 下取整的和。(这玩意居然也需要进模板?)
$$\sum_{i = 0}^{N – 1} \lfloor(A \times i + B) / M\rfloor$$

D – Maxflow

最大流
https://vjudge.net/problem/AtCoder-agc038_f
https://atcoder.jp/contests/arc107/tasks/arc107_f
https://atcoder.jp/contests/abc193/tasks/abc193_f

import sys
from atcoder.maxflow import MFGraph
I = lambda: [int(x) for x in input().split()]

n, m = I()
s = 2*n
t = s+1
G = MFGraph(t+1)
a = I()
b = I()
z = 0

for i in range(n):
    bb = abs(b[i])
    z += bb
    G.add_edge(i, i+n, a[i] + bb)
    bb *= 2
    if (b[i] < 0):
        G.add_edge(i+n, t, bb)
    else:
        G.add_edge(s, i, bb)

for i in range(m):
    x, y = I()
    x -= 1
    y -= 1
    G.add_edge(x+n, y, sys.maxsize)
    G.add_edge(y+n, x, sys.maxsize)

print(z-G.flow(s,t))

E – MinCostFlow

最小费用最大流
https://atcoder.jp/contests/agc034/tasks/agc034_d

F – Convolution

FFT 卷积

G – SCC

强连通分量

H – Two SAT

2SAT

I – Number of Substrings

后缀数组
里面的实现用的是 sa-is 线性构造算法。
https://atcoder.jp/contests/abc141/submissions/23884310
https://atcoder.jp/contests/arc097/tasks/arc097_a

J – Segment Tree

线段树

K – Range Affine Range Sum

懒标记线段树

L – Lazy Segment Tree

懒标记线段树

Posted by xiaodao
Category: 日常