solution p9194 the of
Solution of 洛谷-P1896
并不会有更好的阅读体验 \(\text{Sol}\) 我们先看一眼数据范围: \(1 \le N \le 9\) 没关系,DFS 会出手。 好吧,正经的说,如果暴搜的话复杂度会涨到 \(\text O(2^{n^2})\),\(\text T\) 到飞起。 此时我们发现有个东西叫状压 \(\text ......
Solution -「模拟赛」草莓蛋糕
\(\max(a_x + a_y, b_y + b_x)\) 的贡献形式不是独立的,并不好进行分析。考虑通过分类讨论将 \(\max\) 拆开。若令 \(h_i = a_i - b_i\),\(h'_i = b_i - a_i\),可以发现若 \(h_x \geqslant h'_y\) 取值则为 ......
Snapshot appears to have been created more than one day into the future!
Snapshot appears to have been created more than one day into the future! Raspberry PI 4b上安装freebsd13.2 aarch系统后,使用ssh链接,输入portsnap fetch extract命令,提示: ......
The 2021 China Collegiate Programming Contest (Harbin) JBEIDG
The 2021 China Collegiate Programming Contest (Harbin) 目录The 2021 China Collegiate Programming Contest (Harbin)VP概况J - Local MinimumB - Magical Subseq ......
Gym 104172 The 2023 ICPC Asia Hong Kong Regional Programming Contest (The 1st Universal Cup, Stage 2Hong Kong)
A. TreeScript 令 \(f_u\) 表示 \(u\) 及 \(u\) 子树中的节点都创建的最小数量。 如果 \(u\) 只有一个儿子,那么可以将子树最后一个节点存储在当前的 \(u\) 中,答案就是 \(f_v\)。 若 \(u\) 有多个儿子: 令 \(t=\max\limits_{v ......
[ARC124C] LCM of GCDs 题解
题面 给定 \(N\) 个正整数对 \((a_i, b_i)\) 和两个初始为空的集合 \(S, T\),你可以选择将每个数对的两个元素划分到两个不同的集合中。求 \[\max\operatorname{lcm}(\gcd\limits_{x \in S}x, \gcd\limits_{y \in ......
M-SOLUTIONS Programming Contest
A - Sum of Interior Angles 答案为 \(180(n-2)\)。 #include<iostream> #include<cstdio> using namespace std; int n; int main() { scanf("%d",&n); printf("%d", ......
连接正负极Connection of positive and negative poles
不要把物理公式看作数学公式,请也尊重自然的经验法则。 Don't see the physical formulas as mathematical formulas, please also respect the experience rules of nature. 连接正负极 Connect ......
CS61A: Structure and Interpretation of Computer Programs 笔记
Functions Environment Diagrams:左侧为 Frames,右侧为 Objects。 Name 类似变量名,它们存储在 Frame 中,指向各种各样的 Objects,比如值或函数。一个 Name 同时只能指向一个 Object,但可以改变自身指向,不受“类型”影响(Name ......
Docker|--E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
错误 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them ......
Go - Live reload of configurations
main.go: package main import ( "encoding/json" "fmt" "log" "os" "time" "github.com/fsnotify/fsnotify" ) type config struct { Name string `json:"name"` ......
nginx访问报错“maximum number of descriptors supported by select() is 1024 while connecting to upstream”问题的处理
1、问题背景 项目:一个人力的系统,主要用于考勤打卡 环境:windows server nginx版本:1.22 问题说明:当早上访问人数增加的时候,就会出现nginx的异常 nginx的后台报错日志: maximum number of descriptors supported by sele ......
[892] Change the background color of a table in a Word document
ref: python-docx Changing Table Cell Background Color. To change the background color of a table in a Word document using Python, you can use the pyth ......
Solution Set - 图上问题
CF360E Link&Submission. 首先显然可以选择的边的权值一定会取端点值。事实上,第一个人经过的边选最小,第一个人不经过的边选最大,这样一定不劣。进一步,如果 \(s_1\) 到点 \(u\) 的距离小于等于 \(s_2\),则 \((u,v)\) 这条边应该取最小值。所以可以初始全 ......
Shrine( Flask SSTI of config )
来自: [WesternCTF2018]shrine 打开是一段源码,这里贴一下: import flask import os app = flask.Flask(__name__) app.config['FLAG'] = os.environ.pop('FLAG') #注册了一个名字为FLAG ......
How to get the original size of an image using JavaScript All In One
How to get the original size of an image using JavaScript All In One
如何使用 JavaScript 获取一个图片像的原始大小
naturalWidth & naturalHeight
aspect ratio / 纵横比
......
爱数anybackup——控制台建立对应的ofs卷、重删卷、自备份卷、元数据卷
以admin登录系统,点击【存储】>【节点管理】>【配置】>【卷管理】 选择对应的【卷类型】 点击【+新建】 输入【卷名称】,选择【挂载路径】,输入【容量】,然后点击创建即可 ......
Knights of the Round Table
prologue 相信很多人都感觉这个题不就是求一下这个二分图的最大独立集嘛,有什么难的,(劈里啪啦、库里跨啦、叮里哐啷)好,不对,好好好,题解! analysis 这个题目实际上并不是一个完整的最大独立集问题,因为在这个题里面,是可以有相互仇恨的骑士的,只要不让他们二人坐成同桌就行。 那么我们就不 ......
ERROR: Could not find a version that satisfies the requirement selunium (from versions: none)
错误信息 ERROR: Could not find a version that satisfies the requirement selenium (from versions: none) ERROR: No matching distribution found for selenium ......
How to fix TypeScript error: expression of type can't be used to index type All In One
How to fix TypeScript error: expression of type can't be used to index type All In One
type guard
......
[LeetCode] 2582. Pass the Pillow
There are n people standing in a line labeled from 1 to n. The first person in the line is holding a pillow initially. Every second, the person holdin ......
CF1879D Sum of XOR Functions
异或和按位处理的典型例题。 要求所有子区间异或和乘区间长度的总和,朴素的方法是 \(O(n^2)\) 地枚举区间,显然无法通过。 因为涉及异或和,而异或运算不进位,故自然地想到把 \(a_i\) 写成二进制形式,单独研究每一位的贡献,最后再合并。这是处理此类问题的一般思路。 1. 二进制拆分 比方说 ......
「解题报告」The 1st Universal Cup. Stage 3: Poland
大概按难度排序。签到题没写。 QOJ M. Minor Evil 有 \(n\) 个球与 \(k\) 个操作,初始所有球都是白色的。第 \(i\) 个操作为如果 \(a_i\) 是白色的,那么就将 \(b_i\) 染成黑色,否则什么都不做。你可以选择每个操作执行或不执行,但是不能改变操作之间的相对顺 ......
[888] How to get the directory of the current Python file
To get the directory of the current Python file, you can use the os.path module in combination with the __file__ attribute. Here's how you can do it: ......
VSCode 安装插件 Unity 后,一直弹 The .NET Core SDK cannot be located
如题。 明明已经安装了.Net 7.0。并且添加到了 PATH 中。 (也就是在 终端/CMD 可以通过 dotnet 命令访问到。) 但 Vscode 还是一直弹 The .NET Core SDK cannot be located。 然后开始下载 .Net7.0。 解决方案 写在了 .NET ......
The 2023 ICPC Asia Regionals Online Contest (2) MDIELK
The 2023 ICPC Asia Regionals Online Contest (2) MDIELK M Dirty Work 题意:总共有\(n\)个问题,对于第\(i\)个问题需要\(a_i\)分钟。你可以随便选择一个没过的题去写,写完以后马上交,你有\(p_i\)的概率会错,错了不能跳 ......
The 2nd Universal Cup. Stage 2- SPb
A. Mixed Messages dp[i][j]表示前i位,选择\(j\)个移动到一起的最小花费。 #include<bits/stdc++.h> using namespace std; #define int long long constexpr int inf = 1E9; int32_ ......
requests 响应头部转json时报错TypeError: Object of type CaseInsensitiveDict is not JSON serializable
前言 requests 响应头部在转json时,想格式化输出,结果报错TypeError: Object of type CaseInsensitiveDict is not JSON serializable 报错详情 示例代码 import requests import json # 上海悠悠 ......
ORA-04030: out of process memory when trying to allocate 27760032 bytes (qmxuParseXobWi,qmxsaxAllocMemInternal)
1.alter日志 2023-09-24T19:59:02.474578+08:00LOGMINER: Begin mining logfile for session -2147289087 thread 1 sequence 2185, +DATA/DB/ONLINELOG/redo05a.lo ......