codeforces divisible numbers version

Oracle 分组排序函数详解 (row_number、rank、dense_rank)

1 概述 项目开发中,我们有时会碰到需要分组排序来解决问题的情况:1)要求取出按field1分组后,并在每组中按照field2排序;2)亦或更加要求取出1中已经分组排序好的前多少行的数据。 1. 完整格式 (1) row_number() over(partition by col1 order b ......
rank row_number dense_rank 函数 Oracle

Codeforces Round 905 (Div. 2)

目录写在前面ABCD1/D2E写在最后 写在前面 比赛地址:https://codeforces.com/contest/1884 oonp 这场 div2 怎么才 2k5 人打啊我草 里面还不知道多少大神的小号,呃呃 打了 1k3 掉了 75 分也是牛逼 A 考虑如何拼出一个长度为 \(n-k\) ......
Codeforces Round 905 Div

vue2 el-input-number 千分位显示的支持(不影响v-model的数值取值)

<!-- 增加v-thousands指令 --> <el-input-number v-model="row.money" v-thousands :controls="false" :min="0" :precision="2" style="width: 100%" // 添加全局指令或局部指令 ......
el-input-number 数值 v-model number input

CF1883G1 Dances (Easy version)

思路 考虑从大到小给每一个 \(b_i\) 匹配一个 \(a_j\),那么如果对于 \(b_i\),\(a_j\) 不能匹配,那么对于后续更小的 \(b_i\),\(a_j\) 同样无法匹配,所以可以直接忽略,跳到下一个,一直匹配,直到无法匹配为止,那么无法匹配的 \(b_i\) 的数量就是需要的操 ......
version Dances 1883G 1883 Easy

CF1883G2 Dances (Hard Version)

思路 大体上的思路应该和简单版本一致,建议先看本人关于简单版本的题解。 与简单版本不同的是,困难版本的 \(m\) 可以不为 \(1\),而是取遍 \([1,m]\) 中的整数,所以答案的总值会变大很多倍。 如果直接枚举 \(m\) 次,时间复杂度将会达到 \(O(mn\log n)\) 显然过不了 ......
Version Dances 1883G 1883 Hard

Codeforces Round 905 - div.3(A B C D E)

目录Codeforces Round 905 (Div. 3)A. MorningB. Chemistry Codeforces Round 905 (Div. 3) A. Morning 模拟光标移动即可 void solve(){ string ss; cin >> ss; char ch = ......
Codeforces Round 905 div

Codeforces Round 904 (Div. 2)

目录写在前面ABCD写在最后 写在前面 比赛地址:https://codeforces.com/contest/1884 捏吗我不会容斥,我是飞舞。 A \(k\le 10\),于是直接枚举 \(x\sim x+20\) 检查即可。 // /* By:Luckyblock */ #include < ......
Codeforces Round 904 Div

TLS Handshake failed: tls: server selected unsupported protocol version 301

2023/10/23 21:04:55 D:/Dev/sre/gormSQLServer/main.go:20 [error] failed to initialize database, got error TLS Handshake failed: tls: server selected un ......

Codeforces Round 905 Div 1 (CF1887)

A1. Dances (Easy version) 把 \(a,b\) 序列都从小到大排序,\(a\) 贪心删大的,\(b\) 贪心删小的,二分答案并 \(O(n)\) \(\text{check}\)。 Code ```cpp const int N=1e5+5; int T,n,m; int a ......
Codeforces Round 1887 905 Div

[ABC234E] Arithmetic Number 题解

题目传送门 一道枚举题。 暴力枚举数字位数、首位、等差数列的公差即可。注意公差的枚举范围,并且需要看看末尾合不合法。顺便提一下,我是用字符串存储枚举的数字的,所以写了一个 check 函数代替大于号。 Code #include <bits/stdc++.h> using namespace std ......
题解 Arithmetic Number 234E ABC

VMware Fusion 13.5 OEM BIOS Version

VMware Fusion 13.5 OEM BIOS Version VMware Fusion 13 原版 App 中集成 OEM BIOS 请访问原文链接:https://sysin.org/blog/vmware-fusion-13-oem/,查看最新版。原创作品,转载请保留出处。 作者主页 ......
Version VMware Fusion 13.5 BIOS

[LeetCode] 1356. Sort Integers by The Number of 1 Bits 根据数字二进制下1 的数目排序

You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case ......
二进制 数目 LeetCode Integers 数字

Codeforces Round 887 (Div. 2)

Codeforces Round 887 (Div. 2) A. Desorting 解题思路: 每次操作能使相邻数之差减\(2\),设最小相邻数之差为\(mind\),答案为\(ans = (mind + 1) / 2\)。 代码: #include <bits/stdc++.h> using n ......
Codeforces Round 887 Div

Codeforces Round 855 (Div. 3) C. Powering the Hero

有 \(n\) 张卡的卡堆,你可以自顶向下抽卡。装备卡显示数值为 \(a_i(a_i>0)\) ,英雄卡显示数值为 \(a_i = 0\) 。 如果是装备卡,你可以将卡抽出放在装备堆。如果是英雄卡,你可以将装备堆顶端的一张数值为 \(x\) 的装备卡装备给英雄,英雄数值 \(+ x\) 。无论是否装 ......
Codeforces Powering Round Hero 855

Codeforces Round 857 (Div. 2) B. Settlement of Guinea Pigs

你非常喜欢豚鼠。每个笼子可以住两只豚鼠,且你不想把每个笼子放入不同性别的豚鼠。豚鼠只有两种性别。假设你买到豚鼠时并不知道性别,只有医生能够分辨。 接下来的 \(n\) 天方案中,若第 \(i\) 天为 \(1\) ,你买入一只豚鼠;若为 \(2\) ,你请医生分辨你的豚鼠性别。 给出方案,你最少需要 ......
Codeforces Settlement Guinea Round Pigs

Educational Codeforces Round 145 (Rated for Div. 2) B. Points on Plane

给一个二维平面,你需要在上面放 \(n\) 个芯片。将一个芯片放在 \((x, y)\) 的代价为 \(|x| + |y|\) 。放 \(n\) 个代价的代价为,所有芯片中耗费的最大代价。并且你需要保证任意两个芯片之间的距离严格 \(> 1\) 。 现在给出 \(n\) 给芯片,询问放 \(n\) ......
Educational Codeforces Points Round Rated

Codeforces Round 875 (Div. 2) C. Copil Copac Draws Trees( DFS )

Codeforces Round 875 (Div. 2) C. Copil Copac Draws Trees 思路: 在输入树的边的同时记录他们的输入顺序 从 1 开始跑 DFS ,遇到未连上的边时 , 有两种情况(用 q 表示当前点的顺序序号) 1.边的顺序在这个点连上之前,那么 DFS 的 ......
Codeforces Round Copil Copac Draws

Educational Codeforces Round 149 (Rated for Div. 2)

这场D被切穿了。 A题 答案为 x 或者 x-1 1 B题 答案就是最长的连续一段的长度+1 证明的话大概可以将它看成是几段连续上升和下降的段,然后在峰谷、峰顶分别填上最小、最大,剩下的就依次递增或递减就行。 C题 将一段连续的0/1视作一个块,那么我们最小化这个块的数量就行。 D题如果猜到如果有解 ......
Educational Codeforces Round Rated 149

Codeforces Round 863 (Div. 3) B. Conveyor Belts

给一个 \(n \times n\) 的矩阵, \(n\) 是偶数。将矩阵按圈分割,同一圈的位置可以不消耗代价移动,可以消耗一个代价移动到相邻圈。 给出 \(n, x_1, y_1, x_2, y_2\) ,询问 \((x_1, y_1)\) 移动到 \((x_2, y_2)\) 的代价最小是多少。 ......
Codeforces Conveyor Belts Round 863

Codeforces Round 865 (Div. 2) B. Grid Reconstruction

给一个 \(2 \times n\) 的网格,且 \(n\) 是偶数。你需要将 \(1 \sim 2 \times n\) 填入这个网格。 一条路径是从 \((1, 1)\) 开始,每次只能向右或向下,到 \((2, n)\) 结束时,所经过的位置。按经过点的顺序标号,一两条路径的代价是 \(cos ......
Reconstruction Codeforces Round Grid 865

Codeforces Round 902 (Div. 2, based on COMPFEST 15 - Final Round)

\(D. Effects of Anti Pimples\) 对每个数字能到达的所有位置先预处理最大值,那么就代表选择这个数字之后真实的贡献,那么对这样的预处理值,最小值显然只有一种做法,为 \(2^0\) ,第二小的值应该可以与最小值一起选择,所以答案为 \(2^1\) ,以此类推之后,每个值乘上 ......
Round Codeforces COMPFEST Final based

Codeforces 选做

CF878E Numbers on the blackboard 好题。看到这个东西考虑打表一下最后每个点系数,需要一定的眼力才能看出相当于一个除了只有第一个是 1,后面的点每次最多比前面一个乘二的序列。知道结论证明就可以简单归纳了。 然后考虑答案的形态,发现如果我们称每次乘二的一段为连续段,那么对 ......
Codeforces

ErrorReply: ERR wrong number of arguments node redis 连接问题解决

今天在测试kvrocks 与socket.io 集成的时候出现了此问题,刚好记录下 原始连接配置 const pubClient = createClient({ url:"redis://dalongdemo@localhost:6666/0"}); 问题修改 const pubClient = ......
ErrorReply arguments number 问题 wrong

Codeforces Round 872 (Div. 2) B. LuoTianyi and the Table

给一个 \(n \times m\) 的矩阵和 \(n \times m\) 个数,你需要把这些数填入矩阵。保证 \[\sum_{i=1}^n \sum_{j=1}^m \left ( \mathop{max}\limits_{1 \leq x \leq i, 1 \leq y \leq j} a_ ......
Codeforces LuoTianyi Round Table 872

Codeforces Round 871 (Div. 4) D. Gold Rush

给一个堆 \(n\) 个石子,如果可以分裂为整数,它将分裂为 \(\frac{1}{3} n\) 和 \(\frac{2}{3} n\) 的两堆石子。并且新石堆会继续分裂。 询问过程中是否出现过大小为 \(m\) 的石堆。 显然记忆化 \(dfs\) 即可。 记忆数组一般开全局。容易观察到值域很大, ......
Codeforces Round Gold Rush 871

Codeforces Round 875 (Div. 2) B. Array merging

给定两个长为 \(n\) 的数组 \(a\) 和 \(b\) 。你需要将 \(a\) \(b\) 归并成一个数组 \(c\) 。询问所有归并方法中,连续数相同的子段最长为多少。\(1 \leq a_i, b_i \leq 2n\) 。 显然归并在 \(a\) 可以任选一段 \([l_1, r_1]\ ......
Codeforces merging Array Round 875

Codeforces Round 879 (Div. 2) B. Maximum Strength

定义正整数 \(C = \overline{c_1c_2 \cdots c_k} = c_1 \cdot 10^{k-1} + c_2 \cdot 10^{k - 2} + \cdots + c_1\) 。 假设有两个正整数 \(X = \overline{x_1x_2 \cdots x_n}, Y ......
Codeforces Strength Maximum Round 879

CF367C Sereja and the Arrangement of Numbers

这题首先上来会发现题目中的很多信息都是假的,核心就是问要构造一个\(x\)个点的完全图至少要多长的序列 我们把序列中相邻的两个元素看作图上的一条边,则可以把问题转化为:给一个\(x\)个点的完全图,问至少要走多长的路径才可以遍历图中的所有边至少一次 简单讨论下会发现当\(x\)为奇数时,此时图中每个 ......
Arrangement Numbers Sereja 367C 367

Educational Codeforces Round 149 (Rated for Div. 2) C. Best Binary String

给一个字符串 \(s\) 包含 \(0, 1, ?\) 。 定义一个 \(01\) 串 \(s\) 的 \(cost\) 为:选择 \(s\) 的任意一个子段 \([l, r]\) 并 \(reverse\) 。将 \(s\) 变为一个非降序序列时的 \(reverse\) 最小次数即 \(cost ......
Educational Codeforces Binary String Round

Codeforces Round 901 (Div. 2)

Codeforces Round 901 (Div. 2) 比赛链接 "考古"啦!之前没有做,现在补上 A. Jellyfish and Undertale 题目链接 思路: 按理说用模拟应该也是可以做到的,但是我应该没有写好,因为我们要找的是最大时间,所以我们每次加上的是min(a-1,x[i]) ......
Codeforces Round 901 Div