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

推荐订阅源

B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Martin Fowler
Martin Fowler
GbyAI
GbyAI
P
Palo Alto Networks Blog
N
Netflix TechBlog - Medium
C
Cisco Blogs
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
A
About on SuperTechFans
PCI Perspectives
PCI Perspectives
Scott Helme
Scott Helme
TaoSecurity Blog
TaoSecurity Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
K
Kaspersky official blog
W
WeLiveSecurity
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
月光博客
月光博客
N
News | PayPal Newsroom
Microsoft Azure Blog
Microsoft Azure Blog
G
GRAHAM CLULEY
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
MongoDB | Blog
MongoDB | Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Know Your Adversary
Know Your Adversary
博客园 - Franky
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
F
Full Disclosure
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
Forbes - Security
Forbes - Security
Attack and Defense Labs
Attack and Defense Labs
MyScale Blog
MyScale Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Tor Project blog

某岛

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. 点双连通图计数 无标号连通图 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]最小矩形覆盖 Codeforces Round #814
AtCoder Beginner Contest 284
2023-05-23 · via 某岛

May 23, 2023

Ex. Count Unlabeled Graphs

k = 1 的情况下,显然就是无标号图计数。
所以做法也必然不会弱于 原题

回忆原题中,我们对点集的对称群,按照 cycle index 进行分类,再去生成对应的边置换群,再得到边置换群的 cycle index。不过看起来这里我们既要考虑边染色,还要考虑点染色,好在它们的结构都是用初始的点群的 cycle index 所决定的,可以一起参与计算。

最后再 简单冗斥 一下即可。

#include <lastweapon/number>

using namespace lastweapon;

const int N = int(5e1) + 9;
Int Fact[N]; VVI Partition; VI cur;
int n;

void gen(int n = ::n, int s = 1){
    if (!n){
        Partition.PB(cur);
    }
    else if (n >= s){
        cur.PB(s); gen(n-s, s); cur.pop_back();
        gen(n, s+1);
    }
}

Int c(const VI P){

    Int z = Fact[n]; int c = 0, l = P.front();

    ECH(it, P){
        z /= *it; if (*it != l){
            z /= Fact[c]; l = *it;
            c = 1;
        }
        else{
            ++c;
        }
    }

    z /= Fact[c];
    return z;
}

int g(const VI P){

    REP(i, SZ(P)) {
        w[i] = 0; vis[i] = 0;
        adj[i].clear();
    }

    int z = 0; REP(i, SZ(P)){
        z += P[i] / 2;
        REP(j, i) z += __gcd(P[i], P[j]);
    }
    return z;
}

Int binom(int n, int m) {
    return Fact[n] / (Fact[m] * Fact[n-m]);
}

int main(){

#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
#endif

    int k; RD(n, k, MOD); Fact[0] = 1; REP_1(i, n) Fact[i] = Fact[i-1] * i;

    gen();

    Int z = 0; ECH(it, Partition) if (SZ(*it) >= k) {
        Int zz = 0;
        REP(i, k) {
            Int d = binom(k, i) * pow(Int(k-i), SZ(*it));
            if (i&1) zz -= d; else zz += d;
        }
        z += zz * c(*it) * pow(Int(2), g(*it));
    }
    z /= Fact[n];
    cout << z << endl;
}

Posted by xiaodao
Category: 日常