888

FPGA驱动RGB888屏幕——基于正点原子达芬奇FPGA开发板

RGB888简介 重要提示:由于我没有RGB888屏幕,所以代码未经验证,但是我将其在HDMI中使用了,证明代码还是有一定的正确性 一个像素点由三种颜色控制,每个颜色8bit,共24bit,三个字节,这就是RGB888。同样的还有RGB565等。 LCD屏幕介绍 1、HSYNC(水平同步信号、行同步 ......
FPGA 原子 屏幕 888 RGB

CF888G题解

分析 看到异或不难想到 01Trie。 不难想到,当两个数的值相等的时候,我们可以当这两个点是一个点,因为连边的费用为 \(0\)。 那么对于一个序列 \(n\),若存在 \(m\) 种不同的权值,那么在 Trie 树上子节点数为 \(2\) 的节点就有 \(m-1\) 个(因为如果一个数新加进来与 ......
题解 888G 888 CF

CF888F题解

分析 手玩样例发现连一条边实际上是将一个多边形分割成两个部分,而且不能在这两个部分直接连边,发现这两个部分是完全独立的,于是考虑区间 DP。 设状态 \(f_{l,r}\) 表示将 \([l,r]\) 区间连成树的方法数量。 那么存在两种转移,一种是 \(l,r\) 间不直接连边,这样中间的点都需要 ......
题解 888F 888 CF

CF888E题解

分析 看到 \(n \leq 35\) 的数据范围就想到了 meet-in-middle。 先爆搜出对于 \(1 \sim \frac{n}{2}\) 和 \(\frac{n}{2} \sim n\) 两个下标范围内在模意义下所有的和。 然后用一个常见 trick,就是枚举第二个部分的和,然后匹配第 ......
题解 888E 888 CF

CF888D

分析 很容易想到从 \(0\) 开始枚举 \(a_i \neq i\) 的位置个数一直枚举到 \(k\) 计算每种情况下的答案加在一起即为答案。 对于 \(k\) 确定的情况,\(a_i = i\) 的位置共有 \(C_{n}^{n-k}\) 种情况,剩下的位置要保证 \(a_i \neq i\)。 ......
888D 888 CF

CF888B题解

分析 题意为选出最多的操作使机器人执行完仍停留在原地。 分为左右和上下两类,则每一类的可执行操作数都是操作次数最少的一种操作的二倍(因为正反操作都要执行才能抵消)。 直接统计每种操作的操作次数计算答案即可。 代码 #include <iostream> using namespace std; co ......
题解 888B 888 CF

CF888A题解

分析 因为一个数不可能同时大于并小于它两边的数,所以两种数的集合不存在交集。 所以分别扫一遍两种数的个数加在一起即可。 代码 #include <iostream> using namespace std; constexpr int MAXN(1000007); int a[MAXN]; int ......
题解 888A 888 CF

Codeforces Round 888 (Div. 3) C. Tiles Comeback

有 \(n\) 个瓷砖和一个正整数 \(k\) ,第 \(i\) 个瓷砖染色为 \(c_i\) 。你一开始在第 \(1\) 块瓷砖上,可以向右跳到任意一个位置的瓷砖。你可以得到一个长为 \(p\) 的路径,长度代表你曾经站过的瓷砖。 你需要确定是否存在一条长度为 \(p\) 的路径满足以下条件: 路 ......
Codeforces Comeback Round Tiles 888

Codeforces Round 888 (Div. 3) C. Tiles Comeback

有 \(n\) 块瓷砖和一个正整数 \(k\) ,第 \(i\) 块瓷砖染色为 \(c_i\) 。一开始站在第 \(1\) 块瓷砖往,然后可以开始往右跳吗,到第 \(n\) 块瓷砖停止。你可以得到的路径长度 \(p\) 为你从 \(1\) 到 \(n\) 踩过瓷砖的数量。 你需要确定是否存在一条长度 ......
Codeforces Comeback Round Tiles 888

CF888F Connecting Vertices 题解

Connecting Vertices 这个奇怪的限制(两条边不能有交点)让我们想到什么? 对于任何一种方案,不存在 \(x_0<x_1<y_0<y_1\),其中连边 \((x_0,y_0),(x_1,y_1)\)。 也就是说,对于任何一段区间 \([i,j]\),如果里面所有点全都连通: 要么 \ ......
题解 Connecting Vertices 888F 888

「题解」Codeforces Round 888 (Div. 3)

A. Escalator Conversations Problem 题目 Sol & Code 签到 #include <bits/stdc++.h> typedef long long ll; int min(int a, int b) { return a < b ? a : b; } int ......
题解 Codeforces Round 888 Div

JavaScript中的888

1、最新的 ECMAScript 标准定义了 8 种数据类型:包括七种基本数据类型和一种引用类型: 类型 说明 Boolean 有 2 个值分别是:true 和 false。 null 一个表明 null 值的特殊关键字。 undefined 和 null 一样是一个特殊的关键字 undefined ......
JavaScript 888

Codeforces Round 888 (Div. 3)DEF

Codeforces Round 888 (Div. 3)DEF D. Prefix Permutation Sums 题意:给你一个长度为 \(n - 1\) 的数组,是否能找出一个长度为 \(n\) 的排列,求出这个排列的前缀和,去掉前缀和数组的任意一个元素之后和原来的数组相等。 例如 \([6 ......
Codeforces Round 888 Div DEF

[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

$Codeforces Round 888 (Div. 3)$

\(A. Escalator Conversations\) 用 \(map\) 存楼梯的高度(差),对每个人看一下需要的楼梯高度是否存在。 int a[N]; void solve(){ int n=read(),m=read(),k=read(),h=read(); map<int,int>mp ......
Codeforces Round 888 Div

Codeforces Round 888 (Div. 3)G. Vlad and the Mountains(数据结构,图论)

题目链接:https://codeforces.com/contest/1851/problem/G 大致题意: 给出n个点m条边的无向图,每个点有点权h【i】。从点 i 到 点 j会消耗 h【j】 - h【i】 的能量,如果小于0,那么就是恢复对应绝对值的能量。 进行q次询问,每次询问包含起点s, ......

#888

//A #include <bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10,mod=1e9+7; string s; int n,t,a[N],f[N],res,num,ans,m,k,p; b ......
888

1851 Round 888 (Div. 3)

## Escalator Conversations 判断两人台阶是否为 $k$ 的倍数且在 $(0, m)$ 内即可 ```c++ #include using namespace std; signed main() { int T; scanf("%d", &T); for (int n, m ......
Round 1851 888 Div

Codeforces Round 888 (Div. 3)

比赛链接:https://codeforces.com/contest/1851 ## A. Escalator Conversations 题意:一个扶梯,共m阶,n人站,每个台阶高k,Vlad身高H,Vlad任意站,问有多少人站在这个扶梯上正好和Vlad齐平 满足`abs(H - h[i]) % ......
Codeforces Round 888 Div

CodeForces 888F Connecting Vertices

[洛谷传送门](https://www.luogu.com.cn/problem/CF888F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/888/F "CF 传送门") 做做简单题放松身心。 考虑区间 dp,设 $f_{i ......
CodeForces Connecting Vertices 888F 888

Codeforces Round 888 (Div. 3) 补题

- 独立补了一道记忆化搜索的题,https://codeforces.com/contest/1851/problem/E 由于初次接触对于使用场景和注意事项都不是很熟悉,写加调估计得有3h。 # 本题的题面保证了本题是个无环图,允许dfs函数会有出口,存图不能用链式前向图,因为非常容易构造数据使得 ......
Codeforces Round 888 Div

Codeforces Round 888 (Div. 3)

# [传送门](https://codeforces.com/contest/1851) ### A Escalator Conversations 读懂题意即可 ``` /* Author : north_h File : A.cpp Time : 2023/7/26/12:32 _ _ _ _ ......
Codeforces Round 888 Div

Codeforces Round 888 (Div. 3)

## Codeforces Round 888 (Div. 3) ### T1 ​ 思路:直接模拟。 ### T2 ​ 思路:首先记录原始数组的奇偶性,然后将奇数、偶数分为不同两组进行排序,然后再根据原数组的奇偶性按顺序填入奇数偶数,最后判断整个数组是否非递减。 ### T3 思路:我们已知开始在 ......
Codeforces Round 888 Div

Codeforces Round 888 (Div. 3) 题解

考场上 $7$ 题做出来 $4$ 题,最后几分钟才把 D 题调出来,但还是吃了不少罚时 # A. Escalator Conversations $O(n)$ 枚举即可,对于每个人计算需要的间隔台阶数是否在 $(0,m)$ 以内以及相差高度是否是 $k$ 的倍数 # B. Parity Sort 显 ......
题解 Codeforces Round 888 Div

Codeforces Round 888 (Div. 3)记录

A. Escalator Conversations #include<cstdio> #include<algorithm> #include<cmath> #include<vector> #include<string.h> #include<set> #include<string> #in ......
Codeforces Round 888 Div

Codeforces Round 888 (Div. 3) A-F

## A. Escalator Conversations 题意:有一个扶梯,有n个人要站扶梯,这个扶梯有m个位置,第i个位置的高度为i*k,Vlad高H,第i个人高h[i],当且仅当两个人所处的位置高度加上自身身高刚好相同时才能谈话,问能和Vlad谈话的有多少人。 ### Solution 直接计 ......
Codeforces Round 888 A-F Div

Codeforces Round #888 (Div. 3) A-G

[比赛链接](https://codeforces.com/contest/1851) # A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n, m, k, H; cin >> ......
Codeforces Round 888 A-G Div

Codeforces Round 888 (Div. 3) - D

[toc] Codeforces Round 888 (Div. 3) 赛后摘记 # [D. Prefix Permutation Sums](https://codeforces.com/contest/1851/problem/D) **题意** 判断给定的长为n - 1数组,是否为某个 1 ~ ......
Codeforces Round 888 Div

Codeforces Round 888 (Div. 3)

# A. Escalator Conversations ```cpp #include using namespace std; #define int long long void solve(){ int n , m , k ,H; cin >> n >> m >> k >> H; vecto ......
Codeforces Round 888 Div

Codeforces Round 888 (Div. 3)

Codeforces Round 888 (Div. 3) A - Escalator Conversations 思路:求出每个人与Vlad的身高差d,若的能被k整除,且d/k<m则YES #include<bits/stdc++.h> using namespace std; #define i ......
Codeforces Round 888 Div
共32篇  :1/2页 首页上一页1下一页尾页