值域 线段codeforces diamonds

[Codeforces] CF1579C Ticks

CF1579C Ticks 题意 \(n \times m\) 的棋盘,左上角和右下角坐标分别为 \((1, 1), (n, m)\),一开始每个格子为白色。 每次操作可以选择一个格子 \((x, y)\) 以及左上角和右上角方向的 \(d\) 个连续格子染成黑色,并将其称为一个大小为 \(d\) ......
Codeforces 1579C Ticks 1579 CF

[Codeforces] CF1817A Almost Increasing Subsequence

CF1817A Almost Increasing Subsequence 题意 给定长度为 \(n\) 一个序列 \(a\) 以及 \(q\) 次询问,每次询问给出 \(l\) 和 \(r\),找出序列 \(a\) 在 \([l,r]\) 内最长的几乎递增子序列。 对于几乎递增的定义:如果一个序列 ......

[Codeforces] CF1811E Living Sequence

CF1811E Living Sequence 这道题洛谷题解的思路比我的更好,可以参考一下题解,但是没人提到我这种做法 题意 给定一个正整数 \(k\) \((1\le k\le10^{12})\),请你输出第 \(k\) 个数字里没有 4 的正整数。 思路 设 \(f_i\) 表示前 \(10^ ......
Codeforces Sequence Living 1811E 1811

CodeForces 1913E Matrix Problem

洛谷传送门 CF 传送门 考虑费用流,对于每一行建两个点 \(i_0, i_1\),分别代表这一行的所有 \(0, 1\)。同样每一列建两个点 \(j_0, j_1\)。源点分别向 \(i_0, i_1\) 连流量为这一行要求的 \(0\) 或 \(1\) 的个数,费用为 \(0\)。同理连汇点。 ......
CodeForces Problem Matrix 1913E 1913

Diamond--需求接口文档管理

背景 市面上通用的接口文档工具如swagger和yapi都是只针对接口的管理,对于版本和需求的管理少 对于需求文档与需求及接口的对应管理工具市面稀缺 缺少从需求产生到最后产品上线一站式服务工具 目的 管理需求文档与接口版本及接口字段的对应关系 自动化测试、mock数据等功能 可视化前台页面 后续可以 ......
接口 需求 Diamond 文档

Codeforces Round 916 (Div. 3)

目录写在前面ABCDE1/E2FG1G2写在最后 写在前面 比赛地址:https://codeforces.com/contest/1914。 第二天没早八打个 div3 休闲娱乐保持下手感,然而 div3 都 AK 不了了,纯纯废物一个,天天上大学导致的。 唉,一学期碰上好几个 byd 恼弹老师, ......
Codeforces Round 916 Div

Educational Codeforces Round 160 (Rated for Div. 2)

A. Rating Increase 字符串处理 #include<bits/stdc++.h> using namespace std; void solve(){ string s; cin>>s; int n=s.size(); s=" "+s; for(int i=1;i<=n-1;i++) ......
Educational Codeforces Round Rated 160

线段树与历史最值和区间最值问题

线段树与历史最值问题 P4314 CPU 监控 Description 给定数组 \(\{a_i\}\),维护以下操作。定义一个辅助数组 \(\{b_i\}\),每次操作完后令 \(b_i=\max(a_i,b_i)\)。 查询 \(\max_{i=l}^{r} a_i\)(区间最值) 查询 \(\ ......
线段 区间 问题 历史

Codeforces Round 914 (Div. 2)A~D

A. Forked! 题意:有骑士,国王,王后,给出骑士的攻击方式,骑士的攻击方式类似象棋中的马,一个方向长度为1,一个方向长度为2,有8个位置,骑士的两方向攻击长度为a,b,当a,b不等的时候,有8个位置,相同则有4个位置,询问骑士能同时攻击到国王和王后的位置有几个(采用多组输入形式) 范围:给出 ......
Codeforces Round 914 Div

Codeforces Round 916 (Div. 3)

A. Problemsolving Log map枚举字母 #include<bits/stdc++.h> using namespace std; void solve(){ int n; string s; cin>>n>>s; int ans=0; s=" "+s; map<char,int> ......
Codeforces Round 916 Div

Codeforce Round 916(div3)

Codeforces Round 916(div3) [Problem - A - Codeforces]:Problemsolving Log A.题 直接看样例进行分析,发现每一次出现的字符代表着用了1分钟来看这道题,每道题都有固定的解题时间,只要达到了这个解题时间,就可以将这题解出来 , 答案 ......
Codeforce Round div3 916 div

Codeforces Round 916 (Div. 3)(A~E2)

A 统计一下每个字母的出现次数然后输出即可 #include <bits/stdc++.h> #define rep(i,a,b) for(register int i = (a); i <= (b); ++i) #define fep(i,a,b) for(register int i = (a) ......
Codeforces Round 916 Div E2

CodeForces 1148H Holy Diver

洛谷传送门 CF 传送门 从套娃过来的。 首先考虑如何方便地描述所有子区间的 \(\text{mex}\)。这是一个经典套路,考虑扫描线,扫右端点 \(R\),维护一些极长的段 \([l, r]\) 表示 \([l, R], [l + 1, R], \ldots, [r, R]\) 的 \(\tex ......
CodeForces 1148H Diver 1148 Holy

Codeforces Round 916 (Div. 3) (A~E2)

A. Problemsolving Log 签到题,对于给出的字符串,用数组记录每个字母出现的次数,然后遍历一边记录数组,如果对应的字母出现次数大于它的位次,则说明该字母对应的题目被解出来了,最后输出解题数量即可 void solve() { int n; cin >> n; string s; c ......
Codeforces Round 916 Div E2

[Codeforces] CF1795C Tea Tasting

CF1795C Tea Tasting 题意 有 \(n\) 个人和 \(n\) 杯茶,第 \(i\) 个人每次会喝 \(b_i\) 毫升的茶。第 \(i\) 杯茶有 \(a_i\) 毫升。总共会喝 \(n\) 轮茶,第 \(j\) 轮第 \(i\) 个人会尝试喝第 \(i+1-j\) 杯茶。喝的量 ......
Codeforces Tasting 1795C 1795 Tea

Educational Codeforces Round 160 (Rated for Div. 2) 题解A~D

Educational Codeforces Round 160 (Rated for Div. 2) A. Rating Increase 纯暴力,分割字符串,如果n1<n2就输出,如果遍历完整个数组都不存在n1<n2就输出-1. const int N = 2e5 + 10; int toint ......
题解 Educational Codeforces Round Rated

syoj.1827. 线段传送带题解

前情提要-三分 1827. 线段传送带 P2571 [SCOI2010] 传送带 省流:三分套三分。 在二维平面上有两个传送带,一个从 A 点到 B 点,一个从 C 点到 D 点,速度分别是 p 和 q,在平面内其他点的速度为 r。求 A 点到 D 点的最小速度。 考虑从 A 到 D 的路程一定是 ......
线段 题解 传送带 syoj 1827

Educational Codeforces Round 160 (Rated for Div. 2) A~C

A. Rating Increase 题意: 将一个字符串分成两个整数a和b,要求没有前导0,且a < b 思路: 遍历字符串s,若当前位置不是0,则拆分字符串,比较大小 // #include <bits/stdc++.h> #include <iostream> #include <string ......
Educational Codeforces Round Rated 160

Educational Codeforces Round 160 (Rated for Div. 2)

基本情况 A题秒了。 B题卡了实在太久,BC题最后虽然都过了,但是耗时太久。感觉C对我来说更好写。 B. Swap and Delete 经典+3。 总是一条路偏要走到黑了才会想着换思路,早该换了。 一开始想了一大堆乱七八糟的思路,但都错了。 后面往简单了想,这题毕竟最后必须要左对齐的,直接从左往右 ......
Educational Codeforces Round Rated 160

【题解】CodeForces-1913

CodeForces-1913A Rating Increase 依题意模拟。 提交记录:Submission - CodeForces CodeForces-1913B Swap and Delete 交换免费就是能任意重排,从头开始尽量填相反的,剩下只能删去了。 提交记录:Submission ......
题解 CodeForces 1913

【题解】CodeForces-1905

CodeForces-1905A Constructive Problems 发现沿着对角线放就行了,答案是 \(\max(n+m)\)。 提交记录:Submission - CodeForces CodeForces-1905B Begginer's Zelda 最优操作每次删两个叶子(除了最后一 ......
题解 CodeForces 1905

Educational Codeforces Round 160 (Rated for Div. 2)

比赛录屏 \(A. Rating Increase\) https://codeforces.com/contest/1913/submission/237734923 \(B. Swap and Delete\) https://codeforces.com/contest/1913/submis ......
Educational Codeforces Round Rated 160

Educational Codeforces Round 160

总结 被edu撅飞力 只会前三题,掉绿指日可待 我这种彩笔还是不适合div.2 A 直接模拟,注意细节 #include<bits/stdc++.h> #define ll long long using namespace std; ll p[15] = {1}; void solve() { l ......
Educational Codeforces Round 160

线段树详解

定义 什么是线段树 线段树是一种二叉搜索树,每个节点都存储了一个区间的问题。 能够解决的问题 序列维护修改以及查询区间上的最值、求和等,修改和查询的时间复杂度为 \(O\)(\(log\) \(n\))。 与其他 RMQ 算法的区别 算法 适用范围 优点 缺点 线段树 动态 可执行的操作多 常数大 ......
线段

Educational Codeforces Round 132 (Rated for Div. 2)

基本情况 AB秒了。C跨度有点太大,题解暂时都还没理解。 C. Recover an RBS Problem - C - Codeforces 待补题 ......
Educational Codeforces Round Rated 132

Diamond--需求接口文档管理

背景 市面上通用的接口文档工具如swagger和yapi都是只针对接口的管理,对于版本和需求的管理少 对于需求文档与需求及接口的对应管理工具市面稀缺 缺少从需求产生到最后产品上线一站式服务工具 目的 管理需求文档与接口版本及接口字段的对应关系 自动化测试、mock数据等功能 可视化前台页面 后续可以 ......
接口 需求 Diamond 文档

Codeforces Round 834 (Div. 3)

Codeforces Round 834 (Div. 3) A. Yes-Yes? 题意:就是Y后面跟e,e后面跟s,s后面跟Y #include <iostream> using namespace std; void solve() { string x; cin >> x; int l = x ......
Codeforces Round 834 Div

Codeforces Round 839 (Div. 3)

Codeforces Round 839 (Div. 3) A. A+B? 跳过太水了、、、、、 #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int a,b; sc ......
Codeforces Round 839 Div

Educational Codeforces Round 131 (Rated for Div. 2)

基本情况 AB秒了。C知道是二分答案,check死活写不出来。 C. Schedule Management Problem - C - Codeforces 错误分析 这题比较绕,搞了一个对应关系,大脑转不过来。 写check的时候完全想不出合理的思路。 很明显的要用桶来计数,但是怎么用不知道了。 ......
Educational Codeforces Round Rated 131

Educational Codeforces Round 159 (Rated for Div. 2)

Educational Codeforces Round 159 (Rated for Div. 2) A - Binary Imbalance 解题思路: 有一对\((0,1)\),那么\(0\)就能无限增长。 代码: #include <bits/stdc++.h> using namespac ......
Educational Codeforces Round Rated 159
共1770篇  :4/59页 首页上一页4下一页尾页