regular backup

This commit is contained in:
arielherself 2024-09-18 14:45:51 +08:00
parent d6a51ead4c
commit dcd5417e73
Signed by: arielherself
SSH Key Fingerprint: SHA256:AK3cyo9tFsp7Mox7K0sYphleC8hReXhnRKxwuDT5LBc
4 changed files with 13 additions and 8 deletions

View File

@ -349,7 +349,7 @@ clientkeys = gears.table.join(
{description = "toggle fullscreen", group = "client"}), {description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}), {description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , awful.key({ modkey, }, "v", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}), {description = "toggle floating", group = "client"}),
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}), {description = "move to master", group = "client"}),

View File

@ -7,8 +7,8 @@ let
mypkgs = import (pkgs.fetchFromGitHub { mypkgs = import (pkgs.fetchFromGitHub {
owner = "arielherself"; owner = "arielherself";
repo = "mypkgs"; repo = "mypkgs";
rev = "dc9d9be"; rev = "165a9d4";
hash = "sha256-+SdZ8H4qAcLG6baYb1WU/Sd1Dgh2eo/DHmi2Ig7NAnI="; hash = "sha256-F9DXUqsF8YwA49mc25MTE/3uiZJm82kImF3KrUyEUTs=";
}); });
in { in {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@ -163,7 +163,7 @@ in {
pkgs.mtr pkgs.mtr
pkgs.htop pkgs.htop
pkgs.gdb pkgs.gdb
pkgs.dropbox mypkgs.dropbox
pkgs.brightnessctl pkgs.brightnessctl
pkgs.psmisc pkgs.psmisc
pkgs.xclip # Clipboard support pkgs.xclip # Clipboard support
@ -212,7 +212,7 @@ in {
pkgs.kdePackages.gwenview # Image viewer pkgs.kdePackages.gwenview # Image viewer
pkgs.vlc pkgs.vlc
pkgs.playerctl pkgs.playerctl
pkgs.ffmpeg pkgs.jellyfin-ffmpeg
pkgs.spotify pkgs.spotify
unstable.spotify-player unstable.spotify-player

View File

@ -2,11 +2,11 @@ return [=[
struct bounded_mcmf { struct bounded_mcmf {
int n, m, S, T; int n, m, S, T;
mcmf net; mcmf net;
ll sum; ll sum, pre;
vector<ll> fl; vector<ll> fl;
vector<ll> init; vector<ll> init;
vector<ll> costs; vector<ll> costs;
bounded_mcmf(int n, int m) : sum(0), n(n), m(m), S(0), T(n + 1), net(n + 1), fl(m), init(n + 1), costs(m) {} bounded_mcmf(int n, int m) : sum(0), pre(0), n(n), m(m), S(0), T(n + 1), net(n + 1), fl(m), init(n + 1), costs(m) {}
// handle negative loop case // handle negative loop case
void add_edge(int from, int to, ll low, ll high, ll cost, int edge_id = -1) { void add_edge(int from, int to, ll low, ll high, ll cost, int edge_id = -1) {
if (cost < 0) { if (cost < 0) {
@ -27,6 +27,7 @@ struct bounded_mcmf {
void __add_edge(int from, int to, ll low, ll high, ll cost, int edge_id = -1) { void __add_edge(int from, int to, ll low, ll high, ll cost, int edge_id = -1) {
net.add_edge(from, to, high - low, cost, edge_id, -1); net.add_edge(from, to, high - low, cost, edge_id, -1);
init[to] += low, init[from] -= low; init[to] += low, init[from] -= low;
pre += low * cost;
} }
void prep(int s, int t) { void prep(int s, int t) {
for (int i = 1; i <= n; ++i) { for (int i = 1; i <= n; ++i) {
@ -57,6 +58,7 @@ struct bounded_mcmf {
} }
} }
} }
res_cost += pre;
return {{res_flow, res_cost, fl}}; return {{res_flow, res_cost, fl}};
} }
} }
@ -64,6 +66,7 @@ struct bounded_mcmf {
optional<tuple<ll, ll, vector<ll>>> run_mcf(int s, int t) { optional<tuple<ll, ll, vector<ll>>> run_mcf(int s, int t) {
prep(s, t); prep(s, t);
auto [res_flow, res_cost] = net.run(S, T); auto [res_flow, res_cost] = net.run(S, T);
res_cost += pre;
if (sum != res_flow) { if (sum != res_flow) {
return nullopt; return nullopt;
} else { } else {

View File

@ -69,9 +69,10 @@ struct HLD {
swap(u, v); swap(u, v);
} }
tr.range_apply(info[info[u].head].dfn, info[u].dfn, t); tr.range_apply(info[info[u].head].dfn, info[u].dfn, t);
u = info[info[u].head].father;
} }
if (info[u].depth < info[v].depth) swap(u, v); if (info[u].depth < info[v].depth) swap(u, v);
tr.range_apply(info[v].dfn, info[u].dfn); tr.range_apply(info[v].dfn, info[u].dfn, t);
} }
Info path_query(int u, int v) { Info path_query(int u, int v) {
@ -81,6 +82,7 @@ struct HLD {
swap(u, v); swap(u, v);
} }
res = res + tr.range_query(info[info[u].head].dfn, info[u].dfn); res = res + tr.range_query(info[info[u].head].dfn, info[u].dfn);
u = info[info[u].head].father;
} }
if (info[u].depth < info[v].depth) swap(u, v); if (info[u].depth < info[v].depth) swap(u, v);
res = res + tr.range_query(info[v].dfn, info[u].dfn); res = res + tr.range_query(info[v].dfn, info[u].dfn);