ones twos and

CF1874C Jellyfish and EVA 题解

题意 给定一个有向无环图,对于任意一条边 \((u_i, v_i)\),有 \(u_i < v_i\)。 定义一次从节点 \(u\) 开始的移动为如下过程: \(\tt{Alice}\) 选择从 \(u\) 出发的且未被删除的一条边。 \(\tt{Bob}\) 在从 \(u\) 出发的且未被删除的边 ......
题解 Jellyfish 1874C 1874 EVA

Java 21 新特性:Unnamed Classes and Instance Main Methods

Java 21引入了两个语言核心功能: 未命名的Java类你说 新的启动协议:该协议允许更简单地运行Java类,并且无需太多样板 下面一起来看个例子。通常,我们初学Java的时候,都会写类似下面这样的 Hello World 程序: public class HelloWorld { public ......
Instance 特性 Classes Unnamed Methods

CodeForces 1874B Jellyfish and Math

洛谷传送门 CF 传送门 看到这种操作乱七八糟不能直接算的题,可以考虑最短路。 对于 \(a, b, c, d, m\) 按位考虑,发现相同的 \((a, b, m)\) 无论如何操作必然还是相同的。 于是考虑对于每个可能的 \((0/1, 0/1, 0/1)\),所有终态有 \((c = 0/1, ......
CodeForces Jellyfish 1874B 1874 Math

Jellyfish and Mex

2023-10-01 题目 Jellyfish and Mex 难度&重要性(1~10):5 题目来源 luogu 题目算法 dp 解题思路 这道题一眼 dp。 我们需要考虑的是对于函数 \(\operatorname{mex}\) 的性质,假设当前 \(a\) 数组存在 \(0\sim x\),则 ......
Jellyfish and Mex

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' [duplicate]

str | None syntax is only supported in 3.10 or later. Use from typing import Optional name: Optional[str] = None For cases where the right hand side i ......
39 type unsupported TypeError duplicate

CF1875B Jellyfish and Game

思路 题意大概是两人都有一组数,奇数轮,第一个人可以选择和第二个人交换一个数字也可以不换,偶数轮,第二个人可以选择和第一个人交换一个数字也可以不换。 首先可以猜测,我们每次都应该选择交换对方的最大值和自己的最小值,如果自己的最小值都比对方大的话就不交换。应该比较好想,这里感性证明一下。 如果用的不是 ......
Jellyfish 1875B 1875 Game and

CF1875D Jellyfish and Mex

思路 看到 \(n\) 的范围只有 \(5000\),并且 \(\sum n\) 的范围也是 \(5000\),所以可以考虑 \(n^2\) 的做法。 每次操作肯定都是一次性删完某个数字,如果删除某个数字删一半又去删别的数字,答案肯定会变大。 所以我们可以考虑统计所有数字的数量,记为 \(num_i ......
Jellyfish 1875D 1875 and Mex

CF1875C Jellyfish and Green Apple

思路 首先我们可以考虑把能分的都先分了,再选择去切剩下的苹果。 那么我们只需要考虑苹果数量少于人数的情况,每个人能分的苹果都必然少于目前的单个苹果,所以每个苹果都必须切一刀,那么答案数就会增加当前的数量,再把能分的都分了,重复这一过程,直到分完为止。这样去切一定是最优的。 那么,什么时候无解呢? 因 ......
Jellyfish 1875C Apple Green 1875

题解 CF1875D【Jellyfish and Mex】

显然,除非 \(\operatorname{mex}a=0\),否则不会删除 \(>\operatorname{mex}a\) 的数。而 \(\operatorname{mex}a=0\) 时不对答案产生贡献,因此任意时刻我们都可以忽略 \(a\) 中 \(>\operatorname{mex}a\ ......
题解 Jellyfish 1875D 1875 and

mlpack is an intuitive, fast, and flexible header-only C++ machine learning library

https://github.com/mlpack/mlpack README.md a fast, header-only machine learning library Home | Documentation | Community | Help | IRC Chat Download: c ......

MongoDB playground All In One

MongoDB playground All In One MongoDB REPL Node.js aggregate ......
playground MongoDB All One In

Raspberry Pi 5 All In One

Raspberry Pi 5 All In One 树莓派 5 ......
Raspberry All One Pi In

CF441E Valera and Number

题目链接 这道题一个朴素的思路就是:维护 \(f_{i,j}\) 表示第 \(i\) 轮后 \(x=j\) 的方案数。时间复杂度 \(O(k\times 2^k)\)。显然过不了。 我们尝试寻找一个能抛开 \(x\) 的值域的做法。不妨重新设 \(f_{i,j}\) 表示第 \(i\) 轮结束时的 ......
Valera Number 441E 441 and

How to get Postman API request code All In One

How to get Postman API request code All In One Postman can convert an API request into a code snippet, and you can choose the programming language or ... ......
Postman request code How API

[Linux] Compile and Build h5py with MPI

How to Install H5PY-MPI 0. Preparation linux system gcc anaconda/miniconda 1. Install open-mpi Go to "https://www.open-mpi.org/software/". Download th ......
Compile Linux Build h5py with

结对项目——实现一个自动生成小学四则运算题目的命令行程序—陈泽瀚and林桂旭

软工作业3:结对项目:实现一个自动生成小学四则运算题目的命令行程序 作业属于课程 课程首页 - 计科21级1班 - 广东工业大学 - 班级博客 - 博客园 作业要求 个人项目-作业2- 计科21级1班 - 广东工业大学 - 班级博客 - 博客园 这个作业的目标 实现一个自动生成小学四则运算题目的命令 ......
四则 自动生成 题目 命令 小学

lvalue and rvalue

lvalue and rvalue 好用的工具 写在前面 如何记住 排 列 组 合 ? 那如何区分这些东西呢? const int& int& const int const & const …… What is a lvalue and what is an rvalue? Awsome vide ......
lvalue rvalue and

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命令,提示: ......
Snapshot appears created future have

Web3.js All In One

Web3.js All In One Web3 Web3.js A JavaScript library for building on Ethereum Comprehensive. Everything you need to start interacting with the Ethereu ......
Web3 Web All One In

国内网站域名备案信息查询平台 All In One

国内网站域名备案信息查询平台 All In One 网站备案查询 / 域名备案查询 ......
查询平台 域名 平台 网站 信息

[AGC012E] Camel and Oases

Camel and Oases 不难发现对于某个 V,一个点扩展出去的一段区间内所有点的区间相同。 故对于 v,\(\lfloor \frac{v}{2}\rfloor\),\(\lfloor\frac{\lfloor \frac{v}{2}\rfloor}{2}\rfloor\)...1,预处理 ......
Camel Oases 012E AGC 012

How to add a string that contains whitespace to array in shell script All In One

How to add a string that contains whitespace to array in shell script All In One ......
whitespace contains string script array

连接正负极Connection of positive and negative poles

不要把物理公式看作数学公式,请也尊重自然的经验法则。 Don't see the physical formulas as mathematical formulas, please also respect the experience rules of nature. 连接正负极 Connect ......
正负 Connection negative positive poles

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 ......
gnupg installed operation required Docker

SQL注入 --【过滤or(包含information、orderby这种也寄了)和and的类型】

来自: [SWPU2019]Web1 详见博客: https://blog.csdn.net/plant1234/article/details/124205120 payload如下: 查看行数 1'/**/group/**/by/**/1,'1 ...... 直到 1'/**/group/**/ ......
information orderby 类型 SQL and

Congratulations to Google on its 25th birthday All In One

Congratulations to Google on its 25th birthday All In One 祝贺 Google 25 周岁生日 All In One ......
Congratulations birthday Google All its

Wi-Fi Basic PHY and MAC

总体架构 Architecture Wi-Fi 网络的网络拓扑 首先我们从下面这张图来了解一下 Wi-Fi 网络的网络拓扑 BSS Basic Service Set 基本服务集是 802.11 网络的基本组件 building block。每个 BSS 基本服务集都一个唯一的标识,称为 BSSID ......
Wi-Fi Basic PHY MAC and

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 / 纵横比 ......
JavaScript original image using size

Codeforces Round 738 (Div. 2) A. Mocha and Math

给一个数组 \(a_1, a_2, \cdots, a_n\) 。可以执行以下操作任意次: 选择 \(l, r (1 \leq l < r \leq n)\) ,对于任意 \(l \leq i \leq r\) ,同时执行所有 \(a_{l + i} = a_{l + i} \& a_{r - i} ......
Codeforces Round Mocha Math 738