counting atcoder another 259h

AtCoder Beginner Contest 326

A - 2UP3DOWN (abc326 A) 题目大意 100楼层,一次可以上最多两层,或下最多三层。 给定两楼层,问能否一次到达。 解题思路 比较大小,然后判断其差是是不是在\(2\)或 \(3\)内即可。 神奇的代码 #include <bits/stdc++.h> using namespa ......
Beginner AtCoder Contest 326

AtCoder Beginner Contest 326 题解

首先,\(\text{Happy Birthday to me !}\) A - 2UP3DOWN 常规ABCA... //If, one day, I finally manage to make my dreams a reality... //I wonder, will you still ......
题解 Beginner AtCoder Contest 326

【杂题乱写】AtCoder-ARC114

AtCoder-ARC114_A Not coprime \(50\) 内的质数只有 \(15\) 个,可能的答案也就只有 \(2^{15}\) 个,直接枚举。 提交记录:Submission - AtCoder AtCoder-ARC114_B Special Subsets 就是 \(i\) 与 ......
AtCoder-ARC AtCoder ARC 114

[ARC166D] Interval Counts 题解

Description 给定正整数 \(n\) 和长度为 \(n\) 的序列 \(x_i,y_i\),保证 \(x_i\) 单调递增。你要构造 \(m\) 个区间 \([L_i,R_i]\)(\(m\) 由你指定),使每个 \(x_i\) 恰好被 \(y_i\) 个区间包含。 最大化 \(\min_ ......
题解 Interval Counts 166D ARC

AtCoder Beginner Contest(abc) 310

B - Strictly Superior 难度: ⭐ 题目大意 给定n个商品的价格, 每个商品还有若干个属性, 请问是否存在一个商品是另外一个商品的上位品; 上位品的定义分两种, 一是价格相同, 但是商品A的属性不仅包括了商品B的属性, 还比商品B多了至少一个属性; 二是如果两商品的属性相同, 但 ......
Beginner AtCoder Contest 310 abc

UVA1485 Permutation Counting

传送门 description 一个长度为 \(n\) 的排列 \(a\),其权值为满足 \(a_i>i\) 的位置的数量。 求权值恰为 \(k\) 的长度为 \(n\) 的排列的方案数。 \(n,k\leq 1000\) solution 设 \(f_{i,j}\) 表示考虑前 \(i\) 个数, ......
Permutation Counting 1485 UVA

AtCoder Beginner Contest 325

感觉错失了上分机会 A - Takahashi san (abc325 A) 题目大意 给定姓和名,输出尊称,即姓+san。 解题思路 按照题意模拟即可。 神奇的代码 #include <bits/stdc++.h> using namespace std; using LL = long long ......
Beginner AtCoder Contest 325

CF1073G Yet Another LCP Problem

一道 *2600 调了一年,代码细节是有点粪了,但自己菜也是挺菜的。/oh/oh 考虑容斥,令 \(f(A)=\sum\limits_{i,j\in A}\operatorname{lcp}(i,j)\),那么答案就是 \(f(A\cup B)-f(A)-f(B)\)(这里的并表示可重集合并)。 令 ......
Another Problem 1073G 1073 Yet

PAT_A1049 Counting Ones【困难】

数学问题/简单数学 需要严格推理,具体见算法笔记上机指南p199.每次迭代,记录当前位出现1的个数;对当前位的数分三种情况讨论。 ......
Counting PAT_A 1049 Ones PAT

AtCoder Beginner Contest 216 H Random Robots

洛谷传送门 AtCoder 传送门 下文令 \(n\) 为原题中的 \(K\),\(m\) 为原题中的 \(N\)。 首先概率转方案数,最后除 \(2^{nm}\) 即可。 考虑一个指数级暴力:枚举每个 bot 的终点 \(y_i\)(因为存在不能相交的限制,需要满足 \(y_1 < y_2 < \ ......
Beginner AtCoder Contest Random Robots

AtCoder Regular Contest 164 F Subtree Reversi

洛谷传送门 AtCoder 传送门 非常好题目。 发现每个点颜色被反转的次数是固定的,为其深度(根结点深度为 \(0\))。于是可以看作是,一放棋子就得到分数。 那么先手取偶数层和后手取奇数层都会使先手得分,所以双方的目标都是尽可能多取偶数层的结点。 考虑若一开始有偶数层的叶子,那么当前的先手肯定会 ......
AtCoder Regular Contest Subtree Reversi

AtCoder Beginner Contest(abc) 309

B - Rotate 题目大意 给定一个n*n的矩阵, 要求把矩阵的最外围按照顺时针转动一个数据, 输出转动后的矩阵; 解题思路 数据不大, 暴力即可; 神秘代码 #include<bits/stdc++.h> #define int long long #define IOS ios::sync_ ......
Beginner AtCoder Contest 309 abc

MySQL多表联查和COUNT的性能问题解析

引言 在开发中,我们经常需要使用多表联查(Join)来获取数据。而如果在查询中还需要使用COUNT函数来统计满足条件的行数,有时会遇到性能较差的情况。 本文将分析这个问题,并提供一些解决方案。 问题描述 假设我们有两个表:users和orders。users表存储用户信息,而orders表存储用户的 ......
性能 问题 MySQL COUNT

题解 CF903G【Yet Another Maxflow Problem】

加边 \(A_n\stackrel{0}{\to}A_{n+1}\),\(B_0\stackrel{0}{\to}B_1\)。称形如 \(A_i\to A_{i+1}\) 的边为左部边,形如 \(B_j\to B_{j+1}\) 的边为右部边,形如 \(A_i\to B_j\) 的边为中间边。 根据 ......
题解 Another Maxflow Problem 903G

Vue中使用vue-count-to(数字滚动插件)

效果图 1. 简单介绍 npm官网:vue-count-to vue-count-to 就是一个组件插件,咱们引入进来,可以去打印一下,它就是一个组件实例,使用components注册一下,就可以在模板中使用了,具体方式如下: 2. 安装 npm install vue-count-to 3. 引入 ......
vue-count-to 插件 数字 count Vue

#结论#CF1776G Another Wine Tasting Event

题目 给定一个长度为 \(2n-1\) 的字符串,问一组使得 \(n\) 个长度不小于 \(n\) 的区间中字母W的个数相等的字母W的个数 分析 首先结论就是 \(\max_{i=1}^n\{cW[i\dots i+n-1]\}\) 一定是合法解 以这组解为基准,左右端点如果向外扩展那么个数一定会更 ......
结论 Another Tasting Event 1776

内核参数max_map_count 和 ORA-04030

PLSQL Procedure Causing ORA-04030: (pga heap,control file i/o buffer) And ORA-04030: (koh-kghu sessi,pmuccst: adt/record) or ORA-04030: (koh-kghucall ......
max_map_count 内核 参数 count 04030

[918] Copy the formatting from one cell in a table of a Word document to another cell in Python

To copy the formatting from one cell in a table of a Word document to another cell, you can use the python-docx library in Python. Here's a step-by-st ......
cell formatting document another Python

[920] Copy the font style from one cell in a table of a Word document to another cell using Python

To copy the font style from one cell in a table of a Word document to another cell using Python and the python-docx library, you can access the font p ......
cell document another Python style

AtCoder Regular Contest 167——B - Product of Divisors

题目很明显,给定 所有因数的积不断除以最多能除几次。 首先,很容易发现,对于每一对因子,都可以对答案得出B的贡献,设A的因子数目为n。 将A进行质因数分解,PBa1,PBa2,PBa3……PBam,那么因数个数就是质因子加一的乘积。 那么因子对数也就是前者一半。答案就是B乘因子对数除以二注意此处除操 ......
Divisors AtCoder Regular Contest Product

AtCoder Beginner Contest(abc) 308

B - Default Price 题目大意 小莫买了n个寿司, 现在给出m个寿司的名称和m+1个价格, 如果小莫买的其中一个寿司不在这m个寿司之中就用价格m0; 请问小莫买的寿司花了多少钱 解题思路 数据不大, 暴力哈希即可; 神秘代码 #include<bits/stdc++.h> #defin ......
Beginner AtCoder Contest 308 abc

Atcoder Beginner Contest 324 G Generate Arrays 题解-Treap

为了更好的阅读体验,请点击这里 题目链接 套上平衡树板子就能做的很快的题,然后因为是指针存树,因此交换只需要把序列大小较小的挨个拿出来插到相应的地方即可。复杂度 \(O(N \log^2 N)\)。 但是一定要记住 不可以直接使用 std::swap 交换包含带有指针的类的实例(如代码中的 Trea ......
题解 Beginner Generate Atcoder Contest

AtCoder Regular Contest 167

Preface 补一下上周日的ARC,因为当天白天和队友一起VP了一场所以就没有精力再打一场了 这场经典C计数不会D这种贪心乱搞反而是一眼秒了,后面的EF过的太少就没看 A - Toasts for Breakfast Party 用一个类似于蛇形的放法就好了,比如对于\(n=9,m=5\),放法为 ......
AtCoder Regular Contest 167

Codeforces Round 893 (Div. 2) C. Yet Another Permutation Problem

有一个 \(gcd\) 游戏,按以下步骤进行: 选择一个 \(n\) 的排列 \(p_1, p_2, \cdots, p_n\) 。 对于每个 \(i\) ,\(d_i = gcd(p_i, p_{i \% n + 1})\) 排列 \(p\) 的 \(score\) 为数组 \([d_1, d_2 ......
Permutation Codeforces Another Problem Round

Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contest 324) 赛后总结

Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contest 324) 赛后总结 可悲的是:我没来得及写题解。 T1 Same 秒切。 直接输入排一遍序再遍历即可。 #include <bits/s ......

比赛总结:Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contest 324)

比赛:Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contest 324) A-same 1.常规方法 int main() { int n; cin >> n; vector<int> s(n) ......

[910] Copy a file to another directory with a new name in Python

To copy a file to another directory with a new name in Python, you can use the shutil library. Here's how you can do it: import shutil # Specify the s ......
directory another Python Copy file

AtCoder Regular Contest 066 F Contest with Drinks Hard

洛谷传送门 AtCoder 传送门 下文令 \(a\) 为原题中的 \(T\)。 考虑若没有饮料,可以设 \(f_i\) 表示,考虑了前 \(i\) 道题,第 \(i\) 道题没做的最大得分。转移就枚举上一道没做的题 \(j\),那么 \([j + 1, i - 1]\) 形成一个连续段。设 \(b ......
Contest AtCoder Regular Drinks Hard

Atcoder Regular Contest 167

卡 B 下大分了,怎么回事呢。 A. Toasts for Breakfast Party 发现题意是让方差尽可能小,就是让 \(A\) 里的值尽可能接近。 所以从小到大排个序,把 \(A_{N,\dots,N-M+1}\) 依次放进 \(1,2,\dots,M\),再把 \(A_{N-M,\dot ......
Atcoder Regular Contest 167

AtCoder Beginner Contest 324

在高铁上加训! A - Same (abc324 A) 题目大意 给定\(n\)个数,问是否都相等。 解题思路 判断是不是全部数属于第一个数即可。或者直接拿set去重。 神奇的代码 #include <bits/stdc++.h> using namespace std; using LL = lo ......
Beginner AtCoder Contest 324