该昵称已被占用_Error0_
该昵称已被占用_Error0_
全部文章
分类
题解(1)
归档
标签
去牛客网
登录
/
注册
该昵称已被占用_Error0_的博客
全部文章
(共5篇)
题解 | 小红的删数字
#include <cstdio> #include <string> #include <stdexcept> std::string x; int cnt[3] = {}, sum; inline std::string get () ...
2026-03-21
0
26
题解 | #字符串展开#
需要处理的条件颇多,需细心 #include<iostream> #include<cctype> #include<algorithm> using namespace std; int p1,p2,p3; string s,ans; int main(){ ...
2026-03-05
0
29
题解 | #子段和#
我们可以很轻易的证明,一个满足题目条件的数组一定有以下特征: 数组中不能含有数字0 数组中只能含有两种数和,且,如果数组中含有另一种整数,那么便可以通过排列满足题目条件 根据上所述,我们可以用set容器的特性(去重)来解决该题,时间复杂度,空间复杂度 #include<iostre...
2026-03-03
0
25
题解 | #素数的个数#
用Meissel-Lehmer筛法,时间复杂度为,空间复杂度为,需要注意的是计算区间内的质数也要包含。 #include <cstdio> #include <cmath> #include <vector> #include <algorithm> ...
C++
2026-02-26
0
52
题解 | #小红的异或构造#
这道题看着复杂,实际上很简单,题目要求 xor = xor ,其实这里你可以不用管xor到底是什么,你只需要知道,当对于所有的时, 无论和到底是什么, xor 就一定等于 xor 实现代码: #include <iostream> using namespace std; in...
2026-02-22
0
36