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

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
量子位
M
MIT News - Artificial intelligence
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
雷峰网
雷峰网
I
InfoQ
罗磊的独立博客
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
博客园 - 三生石上(FineUI控件)
The GitHub Blog
The GitHub Blog
K
Kaspersky official blog
P
Privacy & Cybersecurity Law Blog
S
SegmentFault 最新的问题
T
Threat Research - Cisco Blogs
H
Help Net Security
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CERT Recently Published Vulnerability Notes
WordPress大学
WordPress大学
T
Tenable Blog
T
The Blog of Author Tim Ferriss
C
Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - Franky
A
Arctic Wolf
T
Threatpost
Scott Helme
Scott Helme
C
Cybersecurity and Infrastructure Security Agency CISA
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
The Exploit Database - CXSecurity.com
G
GRAHAM CLULEY
Security Latest
Security Latest
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
V
Vulnerabilities – Threatpost
P
Privacy International News Feed
S
Schneier on Security
Latest news
Latest news
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com

某岛

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 Beginner Contest 263
2022-08-11 · via 某岛

传送门

Problem E. Sugoroku 3

题解:先写转移方程,发现自环的情况可以消掉,然后就很 straight forward。
官方题解 居然没有看懂。。。)

#include <lastweapon/number>
#include <lastweapon/fenwicktree>
using namespace lastweapon;

const int N = int(2e5) + 9;
Int f[N]; int a[N];
int n;

int main(){

#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("/Users/minakokojima/Documents/GitHub/ACM-Training/Workspace/out.txt", "w", stdout);
#endif

    RD(n); REP(i, n-1) RD(a[i]);
    fenwick_tree<Int> T(n);
    DWN(i, n-1, 0) f[i] = (T.sum(i+1, i+a[i]+1) + (a[i]+1)) / a[i];
    cout << f[0] << endl;
}


Problem F. Tournament

dp[u][i] 表示当前节点 u,获胜的玩家为 i 的最大得分。那么 i 当前轮次的连胜情况是可以通过 u 的高度推算出来的。
并且玩家 i 的得分和对手是无关的,因此 i 实际上是可以不记录在状态中的,复杂度 O(n2^n)。

实际在写的时候,在叶子处结算得分会更好写。
状态改成 dp[u][k] 表示当前节点为 u,且该节点的胜利者,未来向上还会连胜 k 场的最大得分。
(这个在状态中引入未来事件的方法很类似那个 SPOJ ZUMA)

#include <lastweapon/bitwise>
using namespace lastweapon;

const int N = int(16);
LL dp[1<<N][N+1]; int C[1<<N][N+1];
int n;

#define lx (x<<1)
#define rx (lx|1)
LL f(int x, int k) {
    if (x >= _1(n)) return C[x-_1(n)][k];
    LL &z = dp[x][k];
    if (!z) {
        ++k;
        z = max(f(lx,k)+f(rx,0),f(lx,0)+f(rx,k));
    }
    return z;
}

int main(){

#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("/Users/minakokojima/Documents/GitHub/ACM-Training/Workspace/out.txt", "w", stdout);
#endif

    RD(n); REP(i, _1(n)) REP_1(j, n) RD(C[i][j]);
    cout << f(1, 0) << endl;
}


Problem G. Erasing Prime Pairs

带花树可以处理边权的情况么,我不太确定= =
那么首先不考虑 1 的情况,就是二分图匹配,于是我们可以枚举 1 之间的匹配重数,然后当成二分图匹配来做,这个函数显然是凸的,那么可以二分答案。
另一方面这个凸函数十分特殊,delta 是 {1,1,1,1,0,0,0,0,-1,-1,-1,-1} 这样的 pattern,可以直接计算两边的函数值,找到最优点。

Problem Ex. Intersection 2

给定 n 条直线,问所有的交点里,距离原点第 k 远的点的距离是多少。

我们要设法避免算出所有的交点。
考虑二分答案,那么子问题 f(x) 变成 n 条直线被半径为 x 的圆切割,然后这 n 条线段求交点总数,
因为所有交点都在圆周上,所以可以开个树状数组用辐角做扫描线,复杂度 O(nlogn)。

难点最后只有直线和圆求交点。。。(还好模板里有现成的。。相切的情况不用考虑,因为测度为 0。。
最后还需要用不等式估计一下二分的上界。。。

#include <lastweapon/geometry>
#include <lastweapon/fenwicktree>

using namespace lastweapon;
using namespace CG;

const int N = int(5e4) + 9;
DB d[N]; Line L[N];
int n, K;

int f(DB r) {
    Circle C(Po(0, 0), r); r *= r;
    vector<pair<double, int>> P; int m = 0;
    REP(i, n) if (d[i] < r){
        Po p0, p1; C.getIntersect(L[i], p0, p1);
        P.PB({p0.arg(), m}); P.PB({p1.arg(), m});
        ++m;
    }

    int z = 0; VI l(m, -1); fenwick_tree<int> T(m*2); SRT(P);
    REP(i, m*2) {
        int x = P[i].se;
        if (~l[x]) {
            T.add(l[x], -1);
            z += T.sum(l[x], i);
        } else {
            T.add(l[x] = i, 1);
        }
    }
    return z;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
#endif

    RD(n, K); REP(i, n) {
        int A,B,C; RD(A,B,C);
        if (!A)
            L[i] = Line(Po(0, (DB)-C/B), Po(1, (DB)-C/B));
        else if (!B)
            L[i] = Line(Po((DB)-C/A, 0), Po((DB)-C/A, 1));
        else if (!C)
            L[i] = Line(Po(0, 0), Po(-B, A));
        else
            L[i] = Line(Po((DB)-C/A, 0), Po(0, (DB)-C/B));
        d[i] = dist2(L[i], Po(0, 0));
    }

    DB l = 0, r = 1e7;
    DO(233) {
        DB m = (l + r) / 2;
        if (f(m) < K) l = m;
        else r = m;
    }
    printf("%.9f\n", l);
}

Posted by xiaodao
Category: 日常