想赢,就不能怕输
追踪最近的用户名外显变动记录。
最近的文章、讨论、云剪贴板与社区记录
```cpp #include #define int long long #define ls id >1; build(ls,l,mid),build(rs,mid+1,r); push_up(id); } void modify(int id,int l,int r,int k) { if(tr[id].l>r…
## [ARC180C] Subsequence and Prefix Sum 妙妙 dp 计数题。 先看到数据范围,$1 \le N \le 100 \quad -10 \le A_i \le 10$,那么我们可以发现这个子序列的和的范围是 $[-1000,1000]$。 那么再结合 $N$ 的范围,显然有一种设计…
在文章《[CSP2025] CSP-S2025 游记 & 初中OI回忆录》发表评论:
加油期待高中回归
在讨论《csp可以用ios嘛》回复:
谢谢各位大蛇orz
rt,有没有大手子知道csp可不可以用这个 ```cpp ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); ```
DP。 容易发现,一个能够被消除的序列应当满足下列特征: - 长度 $\ge 2$ - 消除的区间连续,不存在遗漏,也不存在包含的情况。 - 定义 $g_i$ 表示 $[1,i]$ 能否全部消除,可以则为 $1$ 反之为 $0$。那么就有 $g_i=\max_{j=1}^{i-1} [g_{j-1}=1] \and […
在讨论《请求撤下题解》回复:
@[EmptyAlien](luogu://user/386547) 好像没有说要输出最优解吧,任意一组可行解就行了,不一定要完全与样例一致
在讨论《建议在题目名字后面增加“/【模板】可持久化字典树”》回复:
支持
知识点:BSGS。 感觉这题还挺好做的,但是放 $5$ 级有点过分了。 题目有多组数据,要判断一个数 $a$ 是不是质数 $p$ 的原根。 依题意得,如果一个数 $g$ 是 $p$ 的原根,要满足三个条件如下: + $1 #define int long long using namespace std; int k,…
在文章《题解:AT_abc394_f [ABC394F] Alkane》发表评论:
y的取值是否写错?应为0或3吧
```cpp #include using namespace std; const int N=15,SLEN=15*50+5; int n,tr[SLEN][30],tot=1,fail[SLEN],flag[SLEN],cntt=0,num; string s[N],ans,p; bool vis[SLEN][9…
rt,对了#3,#4,#7三个点,代码如下: ``` #include #define int long long using namespace std; const int N=1e5+5,TR=510005; int n,ans,tr[TR][26],tot,siz[TR],dfn[N],t; vector v[…
``` #include using namespace std; const int N=2e5+5; int n,a,b,rt=1,dfn[N],low[N],st[N],tp,t,tot,col[N],ans=1000000000; bool iscut[N],inst[N]; vector v[N]; void…
rt,按照思路写完只有40pts,过了大样例,洛谷只过了 #5~#12,求给各位大佬给个hack。 代码: ``` #include #define int long long using namespace std; const int N=1e5+5; int n,tot,tot2; bool s[N],s2[N]…
诶,是第一次写游记欸。 11月30号 好像没啥好写的就进去考个试,那就先复个盘吧。 不得不说广附真的美。 正序开题。 t1编辑字符串 看到题直接懵逼,然后发现一个性质,因为数只能在相邻的两个交换,连续一段 $t_i=1$ 中,所有的数都可以互换。 发现这个性质之后,激动了一会,然后直接通过特殊性质推正解。 性质a想都不…
``` #include #define int long long using namespace std; const int N=2e5+5; int n,q,c[N],dep[N],st[N][25],dis[N];//dis[i]表示1-i的边权之和,dep[i]表示节点i的深度,st[u][i]表示节点u向…
``` #include using namespace std; const int N=1e5+5; int n,m,tp; long double L,V,p[N]; struct uuu{ long double d,v,a; }car[N]; struct uu{ int l,r; }a[N]; int lw…
``` #include #define int long long using namespace std; const int N=2e5+5; int n,m; set st[N]; set ::iterator it; struct uuu{ int id,s,t; }a[N]; struct uu{ int…
``` #include #define int long long using namespace std; const int N=2005; int a[N],dp[N][N];//dp[i][j]表示第以i位结尾的长度为j的上升子序列且剩下的也是上升子序列的结尾的最小值 signed main() { int…
在讨论《求助,如何较快地求一棵树上某两个点的路径上的最大边权》回复:
会了会了,谢谢大家orz
在讨论《求助,如何较快地求一棵树上某两个点的路径上的最大边权》回复:
@[mayike](/user/1039406) 倍增lca该怎么做,求指点
在讨论《暴力dp求调玄关》回复:
a了
在讨论《暴力dp求调玄关》回复:
@[kingho11](/user/562569) 有个地方写错了,应该是: ``` #include using namespace std; const int N=1e5+5; int n,k,q,l[N],dp[105][N]; vector v[N]; struct qry{ int r,c; }a[N];…
rt,代码如下 ``` #include using namespace std; const int N=1e5+5; int n,k,q,l[N],dp[105][N]; vector v[N]; struct qry{ int r,c; }a[N]; void solve() { memset(dp,0,size…
在讨论《求CSP警钟》回复:
@[Wrong_404error](/user/928271) ```return 0;```是可以不写的
rt,样例的答案是0 ``` #include using namespace std; int top[10]; char ch[10][10]; int cntwin,cntlose; double sum,f[5][5][5][5][5][5][5][5][5]; double dfs(int sheng,dou…