258

CSE 158/258 设计与实现

任务定于11月20日星期一完成,但请确保将解决方案上传到排行榜有规律地您应该提交两个文件:writeup.txt对每个任务的解决方案进行简要的纯文本描述;请在 提交截止日期提前;这只是为了帮助我们遵循您的代码,不需要待详细说明。assignment1.py包含解决方案的工作代码的python文件。自 ......
CSE 158 258

258-各位相加-归根到底是数学

给定一个非负整数 num,反复将各个位上的数字相加,直到结果为一位数。返回这个结果。 示例 1: 输入: num =38 输出: 2 解释: 各位相加的过程为: 38 --> 3 + 8 --> 11 11 --> 1 + 1 --> 2 由于 2 是一位数,所以返回 2。 class Soluti ......
数学 258

题解 [ABC258G] Triangle

题目链接 \(\rm O(n^3)\) 枚举 \(i,j,k\) 的算法是显然的。 考虑优化掉一个 \(n\),如果枚举 \(i,j\),那么显然需要找出有多少个 \(k\) 同时满足 \(a_{i,k}=a_{j,k}=1\),我们可以将 \(a_i\) 和 \(a_j\) 看作两个二进制数,那么 ......
题解 Triangle 258G ABC 258

CF258D Little Elephant and Broken Sorting 题解

# CF258D Little Elephant and Broken Sorting 题解 ## 题目大意 有一个 $1 \sim n$ 的排列,会进行 $m$ 次操作,操作为交换两位置的数,每次操作都有 $50\%$ 的概率进行,求 $m$ 次操作之后的期望逆序对个数。($n, m \le 10 ......
题解 Elephant Sorting Broken Little

CF258D Little Elephant and Broken Sorting 题解

## 题意 给定一个长度为 $n$ 的排列 $a$ 和 $m$ 个形如 $\left(x,y\right)$ 的操作,每次操作有 $50\%$ 的概率交换 $a_x, a_y$,求最终排列的期望逆序对数。 ($1 \le n,m \le 5000$)。 ## 题解 首先转化答案 $$\text{An ......
题解 Elephant Sorting Broken Little

AT_abc258_g 题解

[题目链接](https://www.luogu.com.cn/problem/AT_abc258_g) ### 题意简述 给定一张无向图,若图中三个点 $a$,$b$,$c$ 满足 $a$ 与 $b$ 有边相连,$a$ 与 $c$ 有边相连,$b$ 与 $c$ 有边相连,则称点 $a$,$b$,$ ......
题解 AT_abc 258 abc AT

AtCoder Beginner Contest 258 F Main Street

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc258_f "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc258/tasks/abc258_f "AtCoder 传送门") 发现这题有个远古的 ......
Beginner AtCoder Contest Street Main

AtCoder Beginner Contest 258 G Grid Card Game

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc259_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc259/tasks/abc259_g "AtCoder 传送门") 记 $b_i = ......
Beginner AtCoder Contest Card Grid

AtCoder Beginner Contest 258 Ex Odd Steps

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc258_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc258/tasks/abc258_h "AtCoder 传送门") 不错的矩阵快速幂优 ......
Beginner AtCoder Contest Steps 258
共9篇  :1/1页 首页上一页1下一页尾页