codeforces divisible numbers version

./SNeP_111: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by ./SNeP_111)

001、软件报错如下: 002、系统 (base) [root@pc1 software]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) 003、查看glibc版本 (base) [root@pc1 software]# ......
SNeP 111 required version GLIBC

Codeforces Round 909 (Div. 3)

Codeforces Round 909 (Div. 3) 基本情况 第一次在 CF 上 AC 了超过一道题。(毕竟是Div3) B 题卡住了很久。 D 没有深入思考。 [B. 250 Thousand Tons of TNT](Problem - B - Codeforces) 一开始死活过不了的 ......
Codeforces Round 909 Div

游记 NOIP2023(public version)

游记 NOIP2023(public version) 11.17 20:30 提前一天到达考点:中山市中山纪念中学。没有看鸭子。 11.18 8:30 正式开考。然后打开了一下虚拟机,有了上一次的经验,这次直接挂好了虚拟机的共享文件夹,题目也找到在哪里了,比较顺利。 T1 感觉比较简单,先做;T2 ......
游记 version public NOIP 2023

SP3889 Closest Number题解

题意简述 有两个 \(n\) 位十进制数 \(a\),\(b\)。要将数字 \(b\) 的每一位重新排列后,使得得到的数字一个在大于等于 \(a\) 的情况下更接近 \(a\),另一个在小于 \(a\) 的情况下更接近 \(a\)。 求这两个数,如果找不到就输出 0。 思路 以大于等于 \(a\) ......
题解 Closest Number 3889 SP

[Javascript] Using Generator to create a number generate with condition

const generateTimeMs = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min /** * A generator which can generate numbers based on settings ......

Educational Codeforces Round 13 E

tilian 最开始看错了以为是 可以任意选择两人or选择一人胜出 但题意是 可以选择下一个擂主是谁 考虑dp的话 我们显然需要记录一个state以及当前擂主是谁 转移就是 dp[state][i]=max(dp[state][i],dp[state(1<<j)][j]*a[i][j]+dp[sta ......
Educational Codeforces Round 13

Codeforces Round 909 (Div. 3) A-E

Codeforces Round 909 (Div. 3) A. Game with Integers 题意: 两人轮流操作,可以加一或减一,若结果能被3整除则输出First,否则输出Second 思路: 若n不能被3整除,则第一个人可以直接通过加一或减一使结果被3整除,反之则一定不能 代码: #i ......
Codeforces Round 909 A-E Div

练习记录-cf-Codeforces Round 909 (Div. 3)(A-G)

好久没打div了 然后思维太差 现在被抓回来继续打了QWQ 终于被我逮到一场G数据结构的 ak了 既然ak了就开心地写下题解 别被hack别被hack别被hack 这场挺简单的 之前打的div3都好难qaq A. Game with Integers 题意:给一个数字,两人轮流操作,可以+1或者-1 ......
cf-Codeforces Codeforces Round 909 A-G

row_number()用法

select * from(select no = row_number() over(partition by Gender order by getdate()),* from Student) twhere no=1 row_number()和rownum差不多,功能更强一点(可以在各个分组内 ......
row_number number row

JDK 版本对照 versions

JDK version和class file version(Class编译版本号)对应关系 JDK 17 = 61, JDK 16 = 60, JDK 15 = 59, JDK 14 = 58, JDK 13 = 57, JDK 12 = 56, JDK 11 = 55, JDK 10 = 54, ......
versions 版本 JDK

CodeForces 1709F Multiset of Strings

洛谷传送门 CF 传送门 考虑若确定了所有 \(c_s\),如何计算集合最大大小。 下文令原题面中的 \(f\) 为 \(m\)。 发现我们可以类似倒推地确定。比如若 \(n = 3\),\(c_{00} = \min(c_{000}, c_{001})\),\(c_{01} = \min(c_{0 ......
CodeForces Multiset Strings 1709F 1709

CodeForces 1895G Two Characters, Two Colors

洛谷传送门 CF 传送门 要求最大化收益加上支出,又因为每个字符有染红和染蓝两种选择,考虑最小割模型。可以看成是一开始先获得 \(r_i + b_i\) 的收益,然后对于每个 \(0\),连边 \((S, i, b_i), (i, T, r_i)\);对于每个 \(1\),连边 \((S, i, r ......
CodeForces Characters Two Colors 1895G

C++ signal(SIGFPE,handler) ignore division by 0 exception

#include <stdexcept> #include <chrono> #include <csetjmp> #include <ctime> #include <fstream> #include <iostream> #include <iomanip> #include <signal. ......
exception division handler signal SIGFPE

Educational Codeforces Round 94 (Rated for Div. 2) D. Zigzags 题解

题意 给你一个数组 \(a1,a2…an\) 请计算有多少个四元组 \((i,j,k,l)\) 符合以下条件: \(1 <= i < j < k < l <= n\) \(a_i=a_k \ \&\&\ a_j=a_l\) \(4<=n<=3000,1<=a_i<=n\) \(input\) 2 5 ......
题解 Educational Codeforces Zigzags Round

CodeForces 1895E Infinite Card Game

洛谷传送门 CF 传送门 容易转化成经典的有向图博弈模型。每张牌建一个点,若 \(x\) 能打败 \(y\) 就连一条 \(x \to y\) 的边。入度为 \(0\) 的点为必败态,之后类似拓扑排序倒推即可。 具体就是若存在边 \(u \to v\),若 \(u\) 为必败态则 \(v\) 为必胜 ......
CodeForces Infinite 1895E 1895 Card

CodeForces 1895F Fancy Arrays

洛谷传送门 CF 传送门 看到题目感觉很怪,没有什么很好的直接做的办法。于是考虑容斥,\(\min a_i \le x + k - 1\) 的方案数减去 \(\max a_i < x\) 的方案数即为答案。 前者的方案数是好算的。注意到只要确定了 \(\min a_i\) 和差分数组 \(a_i - ......
CodeForces Arrays 1895F Fancy 1895

CF1542E2 Abnormal Permutation Pairs (hard version) 题解

怎么会有这么离谱的题目啊。 【模板】前缀和优化 dp。 思路 考虑一个基本的东西。 由于要求字典序的限制。 我们可以枚举最长公共前缀计算。 考虑如何求长度为 \(i\) 的排列有 \(j\) 个逆序对的数量。 设 \(dp_{i,j}\)。 \[dp_{i,j}=\sum_{k=0}^{i-1}dp ......
题解 Permutation Abnormal version 1542E

Codeforces Round 907 (Div. 2)

\(A. Sorting with Twos\) https://codeforces.com/contest/1891/submission/232689614 \(B. Deja Vu\) https://codeforces.com/contest/1891/submission/232690 ......
Codeforces Round 907 Div

Codeforces Round 906 (Div. 2)

A. 简单题 B. 简单题 C. 比赛时没做出来,赶着回宿舍,过了几天来补发现很简单秒掉 D. Doremy's Connecting Plan 给定n个结点的图,每个点有一个权值a[i],开始时图上没有边,如果与点i相邻的点(包括点i)的权值的和记为Sum_i. 给定一个常数c,如果 Sum_i+ ......
Codeforces Round 906 Div

Codeforces Round 809 (Div. 2) D1. Chopping Carrots (Easy Version) 题解

题意 Codeforces Round 809 (Div. 2) D1. Chopping Carrots (Easy Version) 给两个整数\(n, k\), 一个数组 \(a\), 要求构造一个同样长度的数组 \(p\), 使得 \(\max\limits_{1 \le i \le n}\ ......
题解 Codeforces Chopping Carrots Version

关于.UnsupportedClassVersionError: org/example/Merge has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of 问题的彻底解决

问题描述 之前我是改变了本机上面的JDK的版本17为8; 然后这次我再次尝试MapReduce运行就报错了; 尝试更改IDEA中的环境JDK为8,还是一直显示这个错误~~~ 问题解决 根本问题在pom.xml文件这里,里面有定义我们使用的JDK的版本, 只要将其中的17改为8,然后再运行,就没有问题 ......

Protobuf - FIELD NUMBERS

Required fields in a message can be thought of as frequently used fields since you cannot skip them as you can for optional fields. It is a best pract ......
Protobuf NUMBERS FIELD

[LeetCode] 1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance

There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge b ......
the Neighbors Threshold LeetCode Distance

v-model添加number修饰符,如果这个值无法被parseFloat()解析,则会返回原始的值。

在默认情况下,v-model 在每次 input 事件触发后将输入框的值与数据进行同步 。你可以添加 lazy 修饰符,从而转为在 change 事件_之后_进行同步: 如果想自动将用户的输入值转为数值类型,可以给 v-model 添加 number 修饰符:如果这个值无法被 parseFloat( ......
parseFloat v-model number model

Passable Paths (hard version)

先写正常写法: 我的评价是,后面的分讨我直接树剖拿下。 我觉得这样分讨方便一点。 lca(u,v)=v(或者u,反证就是一条链的形状),那么 lca(u,i)==i,保证i在链上。 然后还有Y字形路径,lca(u,v)=t,则lca(u,i)=i且d[i]>=d[t]。 统一起来就是 \(lca(u ......
Passable version Paths hard

Error: install profile containers-default-0.50.1: generate default profile into pipe: get AppArmor version: convert AppArmor patch version: strconv.Atoi: parsing "0~alpha2": invalid syntax

Bug #2040082 “error parsing AppArmor version” : Bugs : golang-github-containers-common package : Ubuntu Bug #2040082 “error parsing AppArmor version” ......

CodeForces 1452E Two Editorials

洛谷传送门 CF 传送门 考虑枚举其中一个区间取 \([i, i + K - 1]\),考虑对于每个 \(j\) 一次性处理出,区间取 \([j - K + 1, j]\) 多产生的贡献(即以 \(j\) 为右端点)。 对于一个 \([l_k, r_k]\),设其与 \([i, i + K - 1] ......
CodeForces Editorials 1452E 1452 Two

斗地主案例 Console version

package pers.landlord_fighting.thj; /* 按照斗地主的规则,完成洗牌发牌的动作。 要求完成以下功能: 准备牌:组装54张扑克牌 洗牌:54张牌顺序打乱 发牌:三个玩家参与游戏,三人交替摸牌,每人17张牌,最后三张留作底牌。 看牌:查看三人各自手中的牌(按照牌的大小 ......
斗地主 案例 Console version

pip下载python软件包时报错 Could not find a version that satisfies the requirement requests_toolbelt (from versions: none)

pip下载python软件包时报错,使用了国内源等各种方法,后来才知道是电脑中打开了抓包工具;打开抓包工具后一定要关闭抓包工具,这样下载软件包就下载下来了 关闭抓包工具后,下载成功了 ......