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

推荐订阅源

T
The Blog of Author Tim Ferriss
IT之家
IT之家
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
C
Check Point Blog
T
Tailwind CSS Blog
博客园 - Franky
H
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
博客园 - 叶小钗
J
Java Code Geeks
腾讯CDC
罗磊的独立博客
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
B
Blog
V
Visual Studio Blog
F
Fortinet All Blogs

某岛

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 P1973. [NOI2011] NOI 嘉年华 Luogu P1933. [NOI2010] 旅行路线 Luogu P1954. [NOI2010] 航空管制 Luogu P2048. [NOI2010] 超级钢琴 Luogu P2046. [NOI2010] 海拔 Luogu P3227. [HNOI2013] 切糕
Luogu P2053. [SCOI2007] 修车
2023-06-14 · via 某岛
#include <lastweapon/io>
#include <lastweapon/mincostflow>
using namespace lastweapon;

int main() {

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

    int m, n; RD(m, n); int s = n*(m+1), t = s+1;
    mcf_graph<int, int> G(t+1);

    REP(i, n) {
        G.add_edge(s, i, 1, 0);
        REP(j, m) {
            G.add_edge(n*(j+1)+i, t, 1, 0);
            int c; RD(c); REP(k, n) G.add_edge(i, n*(j+1)+k, 1, (k+1)*c);
        }
    }
    printf("%.2f\n", (DB)G.flow(s, t).se / n);
}
#include <lastweapon/mincostflow2>
using namespace lastweapon;

int main() {

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

    int m, n; RD(m, n); int s = n*(m+1), t = s+1;
    mcf_graph<int, int, 2047, 105536, 2047> G;
    G.s = s; G.t = t; G.n = t+1;

    REP(i, n) {
        G.add_edge(s, i, 1, 0);
        REP(j, m) {
            G.add_edge(n*(j+1)+i, t, 1, 0);
            int c; RD(c); REP(k, n) G.add_edge(i, n*(j+1)+k, 1, (k+1)*c);
        }
    }

    printf("%.2f\n", (DB)G.Run().se / n);
}

Posted by xiaodao
Category: 日常