那里不仅有水神,还有水题神||支持互关
追踪最近的用户名外显变动记录。
最近的文章、讨论、云剪贴板与社区记录
```cpp #include #include using namespace std; const int N = 1e5 + 5; struct edge{ int to, w; }; int s[N], trie[N * 31][2], tot; vector p[N]; void dfs(int x, int…
## 题目大意 给你一个仅由小写字母组成的字符串 $s$。 一个字符串序列 $t_1, t_2, \ldots, t_k$ 是合法的当且仅当: - $s = t_1 + t_2 + \cdots + t_k$,此处 $+$ 为字符串拼接; - $\forall 1 \le i \le k - 1, t_i \ne t_…
[题目传送门](https://www.luogu.com.cn/problem/P10840) ## Solution ~~其实这道题很简单~~ 题目的意思很简单,要修改一个数组,让它满足 $a_i \ne a_{i + 1}$ ,求最多要进行多少次操作。 这里可以分两种情况。 - 第一种情况是数组内所有元素的值都相…
[题目传送门](https://www.luogu.com.cn/problem/U589077) ## Solution ~~这道题难度还行,那就废话不多说了。~~ 首先我们一读题,就不难想到一种暴力的方法,那就是直接上**深搜**,但是这样一来时间复杂度就是$O(n^3)$,显然会超时(1s大约能跑$10^6$,$…
[P3197 [HNOI2008] 越狱 题目传送门](https://www.luogu.com.cn/problem/P3197) ## 题目大意 有$n$个房间,每个房间关押一个犯人。有$m$种宗教,每个犯人会信仰其中一种。如果相邻房间的犯人的宗教相同,就可能发生越狱,求有多少种状态可能发生越狱。答案对$1000…
## 集合的定义 集合, 简称集, 定义为由若干(**可以为零**)个同类事物构成的集体。集合内的事物称为**元素**。 例如,一个由$3$个数字$3,5,8$构成的集合可以记作$\{3,5,8\}$,$3,5,8$都是该集合的元素。 ## 集合的性质 集合拥有以下性质: 1. **确定性**。 即对于任何事物是否属于…
在讨论《RemoteJudge 服务中断情况公告》回复:
QWQ
在了解扩展欧几里得算法之前,我要先讲讲不定方程与裴蜀定理。 ## 不定方程 不定方程又称丢番图方程,是一种通常涉及两个或更多未知数的多项式方程,求解仅仅在整数范围内进行。 我们现在只需要考虑最简单的不定方程,即形如$ax+by=c$的二元一次不定方程。在OI中,只需要解决$a$,$b$,$c$都是整数的情况。而这种不定…
[P1516 青蛙的约会 题目传送门](https://www.luogu.com.cn/problem/P1516) ## 题目大意 有两只青蛙A和B,在同一个环上跳。设青蛙 A 的出发点坐标是 x,青蛙 B 的出发点坐标是 y。青蛙 A 一次能跳 m 米,青蛙 B 一次能跳 n 米,两只青蛙跳一次所花费的时间相同。…
在讨论《入门赛 #37 取消等级分计算公告》回复:
你干嘛~哈嗨哟
```cpp #include #include #include using namespace std; typedef long long ll; const int N = 1e6+100; vector G[N]; int value[N], father[N], mark; bool vis[N]; ll…
在讨论《样例过,只有十分,求调》回复:
@[hex4C45](luogu://user/1443133)感激不尽
在讨论《样例过,只有十分,求调》回复:
@[wanghonghui123](luogu://user/1360152)感激不尽
```cpp #include #include #include #include #include #include using namespace std; const int N=1e6+10; int n,m,l,cnt[N]; string s; map >a; int main(){ ios::sync_…
在讨论《易如反掌!》回复:
A+B用高精度也是没谁了
```cpp #include #include #include #define maxn 520 int a[maxn],b[maxn],c[maxn]; using namespace std; int main(){ string A,B; cin >> A >> B; int len=max(A.length…
```cpp #include #include using namespace std; int T,n,x; string s; stack st; int main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> T; for(int i=1;i > n; f…
在讨论《样例过,全WA,求调》回复:
@[pengluming](luogu://user/1295837) thank you
``` #include #define maxn 100005 using namespace std; int n,m; vector p[maxn]; vector v[maxn]; queue q; bool u[maxn],w[maxn]; void solve(int x); int main(){ cin…
在文章《【全网唯一 纯C++动画游戏编程指南】完结!编你自己的游戏!》发表评论:
感谢胎神大大qp
在讨论《《深入浅出(进阶篇)》开售》回复:
qp
在讨论《RemoteJudge 服务中断情况公告》回复:
qp哀悼