题解atcoder agc 004

AtCoder Regular Contest 132 F Takahashi The Strongest

[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc132_f "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc132/tasks/arc132_f "AtCoder 传送门") 没见过这种在新运算 ......
Takahashi Strongest AtCoder Regular Contest

2023(ICPC)江西省赛I题题解

I. Tree 题意: 两种操作,操作1:将一棵树一条路径上的边权异或上一个数,操作2:或者询问一个点周 围所有边权的异或和。 题解: 首先,异或有一个性质 A ⨁ A = 0 ⇒ A ⨁ B ⨁ A = B 在进行操作一时,对X到Y的简单路径上的每一条边权异或,会是这样的情况 X _ w1_ Z ......
题解 2023 ICPC

abc271_f XOR on Grid Path 题解

# [XOR on Grid Path](https://vjudge.csgrandeur.cn/problem/AtCoder-abc271_f) ## 题意 有一个 $n \times n$ 的整数矩阵,第 $i$ 行 $j$ 列的数字为 $a_{i,j}$。 你站在 $(1,1)$,每次你可 ......
题解 Grid Path abc 271

ABC134F 题解

[$\text{link}$](https://www.luogu.com.cn/problem/AT_abc134_f) 。难想的 $\texttt{dp}$ 。 ![](https://img2023.cnblogs.com/blog/2803184/202305/2803184-2023052 ......
题解 134F ABC 134

2023江西省省赛H、J题题解

##**[原题链接](https://codeforces.com/gym/104385)** #1. H题 ![](https://img2023.cnblogs.com/blog/2725144/202305/2725144-20230523161540199-1097838755.png) # ......
题解 2023

AtCoder Beginner Contest 296

# [AtCoder Beginner Contest 296](https://atcoder.jp/contests/abc296/tasks) ## D ### 题意 给出n和m,问$1\leq i,j\leq n$,使得$ij\geq m$,求出这个乘积的最小值 ### 思路 这两个乘数至少 ......
Beginner AtCoder Contest 296

AtCoder Regular Contest 139 C One Three Nine

[洛谷传送门](http://https://www.luogu.com.cn/problem/AT_arc139_c "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc139/tasks/arc139_c "AtCoder 传送门") ~~ ......
AtCoder Regular Contest Three Nine

CF1765C 题解

## 题意 [传送门](https://www.luogu.com.cn/problem/CF1765C) 有 $4$ 种花色的牌,每种牌均为 $n$ 张,则牌的排列一共有 $(4n)!$ 种。 现在你从牌堆种逐张地取出牌,取牌之前你会猜一下这张牌是什么花色。你会根据之前的 $k$ 张牌中出现最少的 ......
题解 1765C 1765 CF

CF1196F K-th Path 题解 floyd

题目链接:[https://codeforces.com/problemset/problem/1196/F](https://codeforces.com/problemset/problem/1196/F) 题目大意: 给定一个包含 $n$ 个节点 $m$ 条边的无向图($n,m \le 2 \ ......
题解 1196F floyd 1196 K-th

Atcoder 选做

## [[ARC103F] Distance Sums](https://www.luogu.com.cn/problem/AT_arc103_d) (构造,重心) 首先显然 $D_i$ 的最小值被重心取到,不妨以重心为根。 对于一条边连接的两个点 $x,y$ ,不妨设这条边 $x$ 侧的点数为 $ ......
Atcoder

NOIP2015普及组试题题解

1.金币 代码: #include<bits/stdc++.h> #define ll long long using namespace std; int ans=0,t=1,n; int main(){ cin>>n; while(n){ for(int i=1;i<=t;i++){ ans+= ......
题解 试题 NOIP 2015

JOISC 2022 题解

##### JOISC2022 Day1 监狱 Jail 首先我们发现操作一定是给所有人排序,然后按照顺序直接从 $s_i$ 挪到 $t_i$,要求是对于 $i$,所有在它之前挪的 $t$ 不能在 $s_i\to t_i$ 上,所有在它之后挪的 $s$ 不能在 $s_i\to t_i$ 上。有了这个 ......
题解 JOISC 2022

「题解」P7275 计树

快进完生成函数,现在我们知道如果令一个长度为 $i$ 的连续段权值为 $in[z^i]\frac{z^2}{1-z+z^2}$,一个连续段权值的 ogf 是 $F$,那么答案的 ogf 就是 $\frac{1}{1-F}$. 先看看 $\frac{z^2}{1-z+z^2}$ 展开,发现形式很好看, ......
题解 P7275 7275

abc271_e Subsequence Path 题解

# [Subsequence Path](https://vjudge.csgrandeur.cn/problem/AtCoder-abc271_e) ## 题意 有 $n$ 个城市和 $m$ 条有向道路,编号从 $1$ 开始,第 $i$ 条道路从 $a_i$ 到 $b_i$,长度为 $c_i$。 ......
题解 Subsequence Path abc 271

Atcoder Grand Contest 060 D - Same Descent Set

先推式子。设 $f(S)$ 表示 decent 集合恰好为 $S$ 的排列个数,$g(S)$ 表示 $S$ 是 $p$ 的 decent 集合的一个子集的排列 $p$ 个数,$g'(\{a_1,a_2,\cdots,a_k\})=\dfrac{n!}{a_1!(a_2-a_1)!(a_3-a_2)! ......
Atcoder Contest Descent Grand Same

NOIP2016普及组试题题解

1.买铅笔 代码: #include<bits/stdc++.h> #define ll long long using namespace std; int n,ans=1e9,a,b; int main(){ cin>>n; for(int i=1;i<=3;i++){ cin>>a>>b; a ......
题解 试题 NOIP 2016

CF1770F 题解

[$\text{link}$](https://www.luogu.com.cn/problem/CF1770F) 。很困难的二进制计数。 前置知识 $1$:范德蒙德卷积推广。 即 $\sum\limits_{\sum \limits_{i=1}^n a_i=n}$ ......
题解 1770F 1770 CF

AGC 补题笔记

### [AGC001] #### A.[BBQ Easy](https://www.luogu.com.cn/problem/AT_agc001_a) 由于最大数肯定要和一个比自己小的数搭配保留该数,不如选择保留次大数,如此递归即解。因此将序列排序后输出序号为奇数的数即可。 #### B.[Mys ......
笔记 AGC

ABC146E 题解

## 前言 [题目传送门!](https://www.luogu.com.cn/problem/AT_abc146_e) [更好的阅读体验?](https://www.cnblogs.com/liangbowen/p/17421804.html) 简单题,whk 的时候就秒了,但是不知道为什么很喜欢 ......
题解 146E ABC 146

Atcoder Beginner Contest ABC302 题解

# 代码 见此:。 # A Attack 直接计算 `a/b`,有余数的话答案加一。 # B Find Snuke 枚举每个点,向周围八个方向拓展,判断。 # C Almost Equal 全排列枚举字符串顺序,之后检查。 $O(n)$ 做法:咕。(应该有罢 # D Impartial Gift 双 ......
题解 Beginner Atcoder Contest ABC

AtCoder Regular Contest 132 D Between Two Binary Strings

[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc132_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc132/tasks/arc132_d "AtCoder 传送门") 提供一个 dp 思 ......
AtCoder Regular Contest Between Strings

NOIP2017普及组试题题解

1.成绩 原题:https://www.luogu.com.cn/problem/P3954 代码: #include<bits/stdc++.h> #define ll long long using namespace std; int a,b,c; int main(){ cin>>a>>b> ......
题解 试题 NOIP 2017

AtCoder Beginner Contest 301

# A - Overall Winner ```cpp #include using namespace std; #define int long long int32_t main(){ ios::sync_with_stdio(false); cin.tie(nullptr) , cout.t ......
Beginner AtCoder Contest 301

III.追想 题解

[原题链接](https://www.luogu.com.cn/problem/U297943) 我第一次出的一道比较正经的菜题,欢迎大家来切哦。 感谢魔法少女老干妈 GM_Joanna_ 的支持 对于操作 1,3: >注意到 1e9 的数据至多 5 此操作就能把一个位置变为 0,这个次数可视为常数 ......
题解 III

abc271_c Manga 题解

# [Manga](https://vjudge.csgrandeur.cn/problem/AtCoder-abc271_c) ## 题意 有一部连载漫画,共 $10^9$ 卷,你手上有 $n$ 卷漫画,第 $i$ 卷是连载中的第 $a_i$ 卷。 **你在看漫画之前**,可以执行以下操作若干次( ......
题解 Manga abc 271

AtCoder Grand Contest 062 B Split and Insert

[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc062_b "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc062/tasks/agc062_b "AtCoder 传送门") 妙妙题。 像这种最 ......
AtCoder Contest Insert Grand Split

AtCoder Beginner Contest 302 Ex Ball Collector

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc302_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc302/tasks/abc302_h "AtCoder 传送门") 考虑如果只询问一次 ......
Collector Beginner AtCoder Contest Ball

AtCoder Beginner Contest 302 (G,Ex)

开大号 unrated 写了个 Ex 就去玩原神了。赛后写了下 G。 ### ABC302Ex 简单题。考虑一组询问咋做,把所有 $(A_i,B_i)$ 连边建图,显然答案是点数减去是树的连通块个数。 如何维护形态为树的连通块个数?可以用并查集维护,对每个连通块额外维护连通块内边数即可。 树上咋做? ......
Beginner AtCoder Contest 302 Ex

[ABC230D] Destroyer Takahashi 题解

[题目传送门](https://www.luogu.com.cn/problem/AT_abc230_d) 一道贪心题。 我们可以将每一堵墙的右端点从小到大进行排序,然后我们从第 $1$ 堵墙开始看,将在第 $1$ 堵墙的右端点打破后会倒塌的墙全部跳过,去看下一堵还没被打破的墙。可以证明这是最优解。 ......
题解 Destroyer Takahashi 230D ABC

AT_abc302_f 题解

一、题目描述: 给你 $n$ 个集合 ,第 $i$ 个集合有 $A_i$ 个数,集合里的数都小于等于 $m$。 你可以选择两个至少有一个相同元素的集合,生成它们的并集,然后这两个集合消失。 求最少多少次合并之后,数字 $1$ 和 $m$ 在同一个集合中。如果不可能,请输出 $-1$ 。 数据范围:$ ......
题解 AT_abc 302 abc AT