1844

CF1844G 题解

鉴定为学 MO 学的。 MO 中著名的《数学奥林匹克小丛书高中卷》的第十五本曾经讲过,如果原方程较难解,可以考虑给左右两边同时对 \(M\) 取模,然后研究取模以后的问题,其中 \(M\) 为一个根据问题选取的适当的整数。 我们看见这个问题觉得很烦,因为大家都能发现这个条件给的相当于 \(d_i+d ......
题解 1844G 1844 CF

CF1844E Great Grids 题解

Description 定义一个矩形 \(a\) 是好的,当且仅当其满足以下条件: 矩形中每一个元素 \(x\) 都为 \(A,B,C\) 其中之一 每一个 \(2\times 2\) 的子矩形都必须包含三个不同的字符 共用一条边的两个元素不相等 给定 \(k\) 个限制条件,限制条件分为两类: \ ......
题解 1844E Great Grids 1844

CF1844G Tree Weights

[题面传送门](https://www.luogu.com.cn/problem/CF1844G) 这个真的很容易想到吗? 首先定 $1$ 为根,设每个点的深度是 $d_i$,则两个点之间的距离是 $d_{i}+d_{i+1}-2d_{LCA(i,i+1)}$。题目中相当于给出了 $n-1$ 个方程 ......
Weights 1844G 1844 Tree CF

题解 CF1844G【Tree Weights】

## problem 一棵树边带正整数权,给出所有 $dis(i,i+1)$,还原树的边权,或者无解。$n\leq 10^5,V\leq 10^{12}$。 ## solution 首先很容易得到 $n$ 个方程形如 $dep_1=0,dep_i+dep_{i+1}-2dep_{lca(i,i+1) ......
题解 Weights 1844G 1844 Tree

【CF1844G】Tree Weights

## 题目 题目链接:https://codeforces.com/contest/1844/problem/G 给定一棵 $n$ 个点的树,每条边有一个未知的正整数边权,给出 $d_i$ 表示点 $i$ 到点 $i+1$ 的距离,求出每条边的边权或判定无解。 $n\leq 10^5,d_i\leq ......
Weights 1844G 1844 Tree CF

CodeForces 1844G Tree Weights

[洛谷传送门](https://www.luogu.com.cn/problem/CF1844G "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1844/G "CF 传送门") 出题人脑洞真大…… 设 $x_i$ 为 $i$ ......
CodeForces Weights 1844G 1844 Tree

CodeForces 1844C Particles

[洛谷传送门](https://www.luogu.com.cn/problem/CF1844C "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1844/C "CF 传送门") 原题是 [[ARC092E] Both Side ......
CodeForces Particles 1844C 1844

CF1844E. Great Grids

# 题目大意 有一个n\*m的网格图,需要在每个格子内部填入A~C,要求满足: ① 每个2\*2的小方格都要有ABC ② 边相邻格子内字母不同 给出初始若干格子相同(满足角相邻)的限制,判断是否存在合法解 2 #define fo(a,b,c) for (a=b; a=c; a--) #define ......
Great Grids 1844 CF

CF1844F Min Cost Permutation

[题面传送门](https://www.luogu.com.cn/problem/CF1844F2) 先不考虑字典序的问题,只考虑最小值怎么求。 先考虑一个特殊情况:$c=0$,也就是说我想要相邻两项之差的绝对值最小。那么将其从小到大排序以后就满足要求。 我们猜想实际上更一般的情况不会和这个差太多。 ......
Permutation 1844F 1844 Cost Min

Codeforeces #1844 A~D题解

# Codeforeces #1844 A~D题解 ## A Subtraction Game 博弈论 ~~A+B problem~~ 由于只有两种数字可选,若石子数量为 `a + b`,先手选完之后必然为 `a` 或 `b`,因此后手可以直接选完 ## B Permutations & Prime ......
题解 Codeforeces 1844
共10篇  :1/1页 首页上一页1下一页尾页