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

推荐订阅源

The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
C
Check Point Blog
有赞技术团队
有赞技术团队
H
Help Net Security
V
Vulnerabilities – Threatpost
N
News | PayPal Newsroom
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LINUX DO - 最新话题
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 【当耐特】
爱范儿
爱范儿
I
InfoQ
V
Visual Studio Blog
O
OpenAI News
Google DeepMind News
Google DeepMind News
S
Security Affairs
T
Troy Hunt's Blog
P
Palo Alto Networks Blog
Spread Privacy
Spread Privacy
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
N
Netflix TechBlog - Medium
Latest news
Latest news
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Webroot Blog
Webroot Blog
S
Schneier on Security
MongoDB | Blog
MongoDB | Blog
T
Tor Project blog
V2EX - 技术
V2EX - 技术
Security Latest
Security Latest
Cloudbric
Cloudbric
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog RSS Feed
C
CERT Recently Published Vulnerability Notes
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
S
Securelist
C
Cisco Blogs
博客园_首页
TaoSecurity Blog
TaoSecurity Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Security Archives - TechRepublic
Security Archives - TechRepublic
P
Proofpoint News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Threat Research - Cisco Blogs
阮一峰的网络日志
阮一峰的网络日志
S
Secure Thoughts

某岛

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 264
2022-08-15 · via 某岛

传送门

Table of Contents

Problem C. Matrix Reducing

数据范围很小,随便做。

#include <lastweapon/io>
using namespace lastweapon;
const int N = 10;
int A[N][N], B[N][N];
int h1, w1, h2, w2; VI H;

bool dfs(int k1 = 0, int k2 = 0, int h0 = 0, int w0 = 0) {
    if (k1 == h2) {
        if (k2 == w2) {
            return 1;
        } else {
            FOR(w, w0, w1-(w2-1)+k2) {
                bool ok = 1;
                REP(i, h2) if (A[H[i]][w] != B[i][k2]) {
                    ok = 0;
                    break;
                }
                if (!ok) continue;
                if (dfs(k1, k2+1, h0, w0+1)) return 1;
            }
        }
    } else {
        FOR(h, h0, h1-(h2-1)+k1) {
            H.push_back(h);
            if (dfs(k1+1, k2, h0+1, w0)) return 1;
            H.pop_back();
        }
    }
    return 0;
}


int main(){
#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
#endif
    RD(h1, w1); REP(i, h1) REP(j, w1) RD(A[i][j]);
    RD(h2, w2); REP(i, h2) REP(j, w2) RD(B[i][j]);
    puts(dfs() ? "Yes" : "No");
}

Problem D. “redocta”.swap(i,i+1)

暴力求下逆序对。

Problem E. Blackout 2

离线后倒叙并查集做法显然。。

#include <lastweapon/io>
#include <lastweapon/dsu>
using namespace lastweapon;
const int N = int(5e5) + 9;

int n, m, en, qn;
struct edge {
    int a, b; bool ok;
    void in() {
        RD(a, b); ok = 1;
        if (a > n) a = 0;
        if (b > n) b = 0;
    }
} E[N];
int Q[N], Z[N];


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

    RD(n, m, en); REP(i, en) E[i].in();
    RD(qn); REP(i, qn) E[--RD(Q[i])].ok = 0;
    dsu d(n+1); REP(i, en) if (E[i].ok) d.merge(E[i].a, E[i].b);

    DWN(i, qn, 0) {
        Z[i] = d.size(0);
        d.merge(E[Q[i]].a, E[Q[i]].b);
    }

    REP(i, qn) printf("%d\n", Z[i]-1);
}

atl 的 dsu 居然还带 size 函数。。。
至于能不能在线嘛。。。。。。
https://twitter.com/kyopro_friends/status/1558460630847594496

Problem F. Monochromatic Path

比赛时状态设计的时 dp[2][n][m] 然后转移写爆了。。浪费了大量时间。。
果然状态要 dp[2][2][n][m] 才行囧。。。

Problem G. String Fair

暴力自动机 dp,估计出一个字符串长度的上界,如果答案一直有更新就认为是无穷。

Problem Ex. Perfect Binary Tree

有点像是动态 dp。。。(但是这个题只有加叶子没有修改。。比如我们都直到加叶子求直径是有简单算法的。。)
那么我们只要每次加一个叶子去更新向上的所有路径即可,中间维护一下 delta 。。每次向上更新的深度不会超过 log(n)。。深度大于这个数的叶子直接跳过即可。

#include <lastweapon/number>
using namespace lastweapon;
const int N = int(3e5) + 9, LOGN = 20;
VI adj[N]; Int f[N][LOGN], s[N][LOGN]; int p[N], d[N];
int n;

void upd(int x) {
    int y = p[x]; d[x] = d[y] + 1; if (d[x] >= LOGN) return;
    Int d = f[x][0] = 1; for (int i=0;x;++i) {
        s[y][i] += d; d *= (s[y][i] - f[x][i]); f[y][i+1] += d;
        x = y; y = p[x];
    }
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
#endif
    MOD = 998244353;
    RD(n); cout << (f[0][0] = 1) << endl;
    FOR(i, 1, n) {
        adj[--RD(p[i])].PB(i); upd(i);
        Int z = 0; REP(i, LOGN) z += f[0][i];
        cout << z << endl;
    }
}

Posted by xiaodao
Category: 日常