how abc 306 ak

洛谷题解 | AT_abc321_c Primes on Interval

目录题目翻译题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1样例 #2样例输入 #2样例输出 #2样例 #3样例输入 #3样例输出 #3题目简化题目思路AC代码 题目翻译 【题目描述】 你决定用素数定理来做一个调查. 众所周知, 素数又被称为质数,其含义就是除了数字一和本身之外不能被其 ......
题解 Interval AT_abc Primes 321

The solution of ABC144F

都不知道什么时候做的题了 problem & blog 一开始很容易想到枚举断边然后 DP 算代价。 于是很容易想到 DP 状态定义:设 \(dp_u\) 为从 \(u\) 出发到 \(n\) 的期望步数。 那么显然有 \(dp_u = \sum^{v_n}_{v_1} \dfrac{dp_{v_{ ......
solution 144F The ABC 144

[ABC286F]

# [[ABC286F] Guess The Number 2](https://www.luogu.com.cn/problem/AT_abc286_f) 题意转换: 有一个数 $n$,你不知道是多少。让你构造一个 $m$ 个点($1\le m\le 110$),且每条边有且仅有一条出边的图。告诉 ......
286F ABC 286

ABC211D Number of Shortest paths

分析 一道显然的最短路,用 dijkstra 算法。 计算最短路的同时,保存最短路个数,如果与当前最短路相同,最短路个数相加,否则到这个节点的最短路个数为上一个节点的最短路个数。 Accepted Code #include <bits/stdc++.h> using namespace std; ......
Shortest Number paths 211D ABC

abc260F - Find 4-cycle

F - Find 4-cycle 显然就是在一个集合中枚举两个点,然后看在另一个集合中是否存在两个点与这个集合中的两个点都相连。 假设x是v1中的一个点,设它的两条出边是(x,a),(x,b),那么记录下f[a][b]=x,根据鸽巢原理,这样做是n^2的 #include<cstdio> #incl ......
cycle 260F Find abc 260

ABC321题解

以后应该都是从 E 开始。 E: problem LCA题。 我们枚举向上跳 \(t\) 步,跳到了 \(y\)。 假如说 \(t = 0\) 那么我们计算 \(\text{clac}(x,k)\) 即可。(\(\text{clac}\) 怎么算放在最后讲) 否则 计算 \(\text{clac}( ......
题解 ABC 321

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

加训日记 Day3——atcoder ABC321乐子场

Day3,9.23 ·打了场acwing周赛,第三题差点就想出来了,想歪到组合数上乱选了呜呜呜 ·ABC321场写的太抽象了,A题上来wa两次,B题少考虑情况乱wa ·C题更是重量级,想不出来正确做法直接暴力,结果打表最后少写了几个数,纯纯犯病场 ·最后加了36分没绷住 acwing周赛排名 atc ......
乐子 atcoder 日记 Day3 Day

[ABC256Ex] I like Query Problem

原题传送门 题意 区间整除,区间推平,查询区间和。 大家好啊,我喜欢暴力乱搞,所以这题我用暴力乱搞 AC 了。 首先观察到操作 \(1\) 的性质:首先保证了除数至少为 \(2\)(不然是 \(1\) 或者 \(0\) 的话也没啥意义啊),所以对一个数不断进行操作的话,每次数的大小至少会减少一半,减 ......
Problem Query like ABC 256

abc222G - 222

G - 222 如果知道阶的相关知识,那么就是道板题。 一个显然的结论是k最多只能有一个2的因子,同时不能有5的因子,直接特判即可 \[k| \frac{10^x -1}{9} \]那么剩余的情况我们可以保证(9p,10)=1,根据欧拉定理,在这种情况下一定有解。 那么问题转化为求最小的正整数x使得 ......
222 222G abc

abc212G - Power Pair

G - Power Pair 如果知道了原根的话这题就会简单很多 r是p的原根 \(r^a=x, r^b=y\) 那么$$r^{an} \equiv r^b (mod\ p) $$ 根据原根的性质 \[an \equiv b(mod\ p-1) \]\[an-k(p-1)=b \]令n=p-1 由裴 ......
Power 212G Pair abc 212

abc208

A - Rolling Dice 28 投 n 次骰子,总点数有没有可能是 k ? B - Factorial Yen Coin 51 好题,值得知道的贪心 面值为 \(1!,2!,3!,4!,5!,\cdots\) 的纸币各 \(100\) 张,问凑出 \(n(n\le 1e7)\) 块钱(不找零 ......
abc 208

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

Atcoder ABC321 笔记

A - 321-like Checker \(\color{gray}{22}\) 直接模拟 void solve() { int n; cin >> n; int lst = -1; for(int i = n; i; i /= 10) { int u = i % 10; if(u <= lst) ......
Atcoder 笔记 ABC 321

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

abc209

C - Not Equal 285 求长度为 n,两两不同,且满足 \(1\le a_i\le c_i\) 的数组的数量 数组 c 排序,答案就是 \(\prod\limits_i(c_i-(i-1))\),其中 \(i-1\) 个位置被前面占了 D - Collision 686 给定一棵树,q ......
abc 209

Windows Tools | How To Install VS Microsoft C++ Build Tools on Windows

How To Install VS Microsoft C++ Build Tools on Windows This can be used for installing anything that requires C++ compiler on Windows. Installation st ......
Windows Tools Microsoft Install Build

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 ......
type TypeScript expression error index

[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: ......
directory the current Python file

abc321E - Complete Binary Tree

E - Complete Binary Tree 首先我们只考虑x子树中的答案,非常明显,一定是一个连续的区间,那么我们只需要找到两个端点即可,左端点一直往左走即可,但是右端点要注意,如果走不了,如果左端点存在,说明n就是我们的右端点。 处理完子树之后往上跳即可,因为树高只有60 #include< ......
Complete Binary 321E Tree abc

abc246F - typewriter

F - typewriter 直接容斥即可,每次选出它们的并集。 #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #define fo(i,a,b) for (int (i) ......
typewriter 246F abc 246

《AT_abc310_h Negative Cost》 解题报告

神仙题 看到没人交题解,我来交一发。 \(Part\ 0:\)我瞎扯扯 我做这题时想着先把耗费魔法值为负的做掉,然后最后再做一段魔法值为正的,但是不好做,做不了。 这个东西也贪心不了,因为你魔法值和伤害这两个东西拆不开,然后就什么都做不了了。 本篇题解中没有什么心路历程,又不能分析出什么动机,因为笔 ......
Negative 报告 AT_abc Cost 310

abc210 差F

C - Colorful Candies 359 固定大小滑动窗口内不同颜色数 D - National Railway 1507 给定矩阵 \(a\) 和数 \(c\),任选不重合的两点 \((i,j),(i',j')\),求 \(a_{i,j} + a_{i',j'} + c(|i-i'|+|j ......
abc 210

abc321记录

SuntoryProgrammingContest2023(AtCoder Beginner Contest 321) - AtCoder D 题意:给定常数 \(k\) 和长度为 \(n\) 的数组 \(a\) 和长度为 \(m\) 的数组 \(b\),求 \(\sum_{i=1}^n\sum_{ ......
abc 321

306_在?你的Win10有历史剪贴板功能吗?

这是一篇原发布于2020-01-30 13:24:00得益小站的文章,备份在此处。 前言 剪贴板可谓是我们日常使用数码产品时,经常在用的一个功能,看到好的内容,复制、粘贴,一气呵成,岂不快哉? 而我们常用的大部分手机输入法都提供了历史剪贴板这个功能。 而当我们回到电脑上工作时,好像发现这些输入法没有 ......
剪贴板 功能 历史 306 Win

[abc321E]Complete Binary Tree

2023-09-23 题目 题目传送门 翻译 翻译 难度&重要性(1~10):6 题目来源 AtCoder 题目算法 模拟 解题思路 考场没调出来,考完赶紧写发题解祭奠一下。 这道题主要就是模拟,细节比较多。 思路就是一层一层的计算贡献: 如图,我们首先计算出以结点 \(x\) 为根的子树第 \(k ......
Complete Binary 321E Tree abc

《AT_abc321_g Electric Circuit》 解题报告

这个题其实和之前 \(NFLS\) 一道题很像,但是还是没做出来,因为当时漏了一个点没注意到,这次赛时就暴毙了。 首先很显然的是拆贡献,寻找每个连通块构成的可能贡献。 期望不好算,我们转成概率乘价值,再转成 \(\frac {\text{方案数}}{\text{总方案数}}\times value\ ......
Electric Circuit 报告 AT_abc 321

abc212 差F

abc212 差F A - Alloy (5') B - Weak Password (64') C - Min Difference (246') 两个数组中各取一数,最小化差的绝对值 排序,各用一个指针 D - Querying Multiset (775') 三种操作:加入一个数x、所有数+x ......
abc 212

ABC321

前言 感觉自从没了 \(\tt{EX}\) 后整体难度降了不少 A 模拟即可 B 观察到 \(n\le 100\),枚举答案验证即可,时间复杂度 \(O(100 \times n \log n)\) C 手算一下可以发现满足条件的数字只有 \(1022\) 个,直接 \(\tt{dfs}\) 出所有 ......
ABC 321

AT_abc321_f [ABC321F] #(subset sum = K) with Add and Erase 题解

AT_abc321_f [ABC321F] #(subset sum = K) with Add and Erase 题解 题目大意 现在有一个空箱子。给你两个数 \(Q, K\),然后给你 \(Q\) 行,每一行代表一个操作: \(+ x\),即向箱子里加一个权值为 \(x\) 的小球。 \(- ......
题解 321 AT_abc subset Erase