- 问答
【FAQ】问答&讨论贴
- @ 2025-6-7 13:41:09
最近的事情更无语了,某鱼上现在有三个人在卖数据了。周赛数据永久停止更新。
不允许学生创建新讨论了,后面大家可以在这里讨论相关内容。会定期清理。
删了一些同学们自己举办的比赛的帖子。
我建议你们可以私聊参赛。讨论区太乱了,有些提问我看不到了已经。
更重要的是,还是先好好学算法吧各位同学,当你拿了提高组 分,再考虑自己举办一些简单的比赛。
语法场的初心还是为了学生们巩固基础语法,高水平选手可以选择参加入门语法场和入门提高场 目前也没看见能打的 (参考新春马拉松赛成绩)
感觉不过瘾还可以打atcoder和codeforces
394 条评论
-
zby_dd 多看一眼就会爆炸 LV 8 (1600/20988) @ 2026-4-10 22:37:16那我是不是可以求助一下:这个题,虽然我已经死了
我不会启发式合并,所以我写了,线段树合并优化dp,但这个线段树是一个没有历史最值的吉司机,检查了不下20遍了,希望老师或者同学,帮忙康一下这个。
代码不长
#include<bits/stdc++.h> using namespace std; const int maxn=2e5+5; int n,a[maxn],b[maxn]; vector<int>G[maxn]; int root[maxn]; struct Segment_Tree{ int sum,lazy,Min,se,cnt,lc,rc; }t[maxn*20]; int tot; #define ls t[rt].lc #define rs t[rt].rc void pushup(int rt){ t[rt].sum=t[ls].sum+t[rs].sum; if(t[ls].Min==t[rs].Min){ t[rt].Min=t[ls].Min; t[rt].se=min(t[ls].se,t[rs].se); t[rt].cnt=t[ls].cnt+t[rs].cnt; } if(t[ls].Min<t[rs].Min){ t[rt].Min=t[ls].Min; t[rt].se=min(t[ls].se,t[rs].Min); t[rt].cnt=t[ls].cnt; } if(t[ls].Min>t[rs].Min){ t[rt].Min=t[rs].Min; t[rt].se=min(t[ls].Min,t[rs].se); t[rt].cnt=t[rs].cnt; } } void pushlazy(int rt,int tag){ if(t[rt].Min>=tag)return; t[rt].sum+=(tag-t[rt].Min)*t[rt].cnt; t[rt].Min=tag; t[rt].lazy=tag; } void pushdown(int rt,int l,int r,int mid){ if(!ls){ t[rt].lc=++tot; t[tot]={0,-1,0,(int)(1e18),mid-l+1,0,0}; } if(!rs){ t[rt].rc=++tot; t[tot]={0,-1,0,(int)(1e18),r-(mid+1)+1,0,0}; } if(t[rt].lazy!=-1){ pushlazy(ls,t[rt].lazy); pushlazy(rs,t[rt].lazy); t[rt].lazy=-1; } } void update(int L,int R,int c,int l,int r,int &rt){ if(!rt)rt=++tot; if(t[rt].Min>=c)return; if(L<=l&&r<=R&&t[rt].se>c){ pushlazy(rt,c); return; } int mid=l+r>>1; pushdown(rt,l,r,mid); if(L<=mid)update(L,R,c,l,mid,ls); if(mid+1<=R)update(L,R,c,mid+1,r,rs); pushup(rt); } int query(int L,int l,int r,int rt){ if(!rt)return 0; if(l==r)return t[rt].sum; int mid=l+r>>1; pushdown(rt,l,r,mid); if(L<=mid)return query(L,l,mid,ls); else return query(L,mid+1,r,rs); } int merge(int rti,int rtj,int l,int r){ if(!rti||!rtj)return rti+rtj; if(l==r){ t[rti].sum+=t[rtj].sum; t[rti].Min=min(t[rti].Min,t[rtj].Min); t[rti].lazy=max(t[rtj].lazy,t[rti].lazy); return rti; } // cout<<l<<' '<<r<<'\n'; int mid=l+r>>1; pushdown(rti,l,r,mid); pushdown(rtj,l,r,mid); t[rti].lc=merge(t[rti].lc,t[rtj].lc,l,mid); t[rti].rc=merge(t[rti].rc,t[rtj].rc,mid+1,r); pushup(rti); return rti; } void getans(int u,int F){ int now1=0; for(int i=0;i<G[u].size();i++){ int v=G[u][i]; if(v==F)continue; getans(v,u); now1+=query(a[u],1,n,root[v]); root[u]=merge(root[u],root[v],1,n); } update(1,a[u],now1+1,1,n,root[u]); // cout<<u<<'\n'; // for(int i=1;i<=n;i++)cout<<query(i,1,n,root[u])<<' '; // cout<<'\n'; } signed main(){ // freopen("boss1.in","r",stdin); //freopen(".out","w",stdout); ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; b[i]=a[i]; } sort(b+1,b+n+1); int cntb=unique(b+1,b+n+1)-b-1; for(int i=1;i<=n;i++)a[i]=lower_bound(b+1,b+cntb+1,a[i])-b; for(int i=2;i<=n;i++){ int u; cin>>u; G[u].push_back(i); G[i].push_back(u); } getans(1,0); cout<<query(1,1,n,root[1]); return 0; } -
@ 2026-4-8 21:07:46imaqepckjfa-yubo.app.haisnap.com
我又双叒叕更新了《校长模拟器》
打开即玩
可能有bug
给窝反馈
-
@ 2026-4-4 18:37:47
wswsws
-
@ 2026-4-3 20:35:02
我都快累死
-
@ 2026-3-28 20:00:52ok, 浮水1分钟, 我要继续cos溺水的鱼了
-
@ 2026-3-28 20:00:22浮水了
-
@ 2026-3-28 11:21:34
1000递交祭
-
@ 2026-3-27 20:38:08
你们好!
-
@ 2026-3-22 14:35:21
-
@ 2026-3-22 10:06:53证明我还活着
-
@ 2026-3-21 19:34:24
ty
-
@ 2026-3-15 9:54:36怎么这么长时间没人发讨论呀
-
@ 2026-3-14 19:00:43
老师是否可以发硬币???
还有我们的

-
@ 2026-3-11 16:45:39P1868100WA求调
#include<bits/stdc++.h> #define ll long long using namespace std; int n,x,y,dp[3000010]; int l; vector<int>p[3000010]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cin>>n; for(int i=1;i<=n;++i){ cin>>x>>y; l=max(l,y); p[y].push_back(x); } dp[0]=0; for(int i=1;i<=l;++i){ dp[i]=dp[i-1]; for(int j=0;j<p[i].size();++j){ dp[i]=max(dp[i],(p[i][j]-1>0?dp[p[i][j]-1]:0)+i-p[i][j]+1); } } cout<<dp[l]<<'\n'; return 0; }被HACK了...
-
@ 2026-3-7 20:48:32P5318WA求调
#include<bits/stdc++.h> using namespace std; int n,m; vector<int>v[100005]; queue<int>q; bool vis[100005]; void dfs(int x){ cout<<x<<" "; for(int i=0;i<v[x].size();i++){ if(!vis[v[x][i]]){ vis[v[x][i]]=1; dfs(v[x][i]); } } } void bfs(){ while(!q.empty()){ int x=q.front(); q.pop(); cout<<x<<" "; for(int i=0;i<v[x].size();i++){ if(!vis[v[x][i]]){ vis[v[x][i]]=1; q.push(v[x][i]); } } } } int main(){ ios::sync_with_stdio(false); cin.tie(0); cin>>n>>m; for(int i=1;i<=m;i++){ int x,y;cin>>x>>y; v[x].push_back(y); } vis[1]=1; dfs(1); memset(vis,0,sizeof(vis)); cout<<"\n"; q.push(1); vis[1]=1; bfs(); } -
@ 2026-3-7 19:25:20
77
-
@ 2026-3-7 18:03:38 -
@ 2026-3-7 18:03:01 -
@ 2026-3-7 14:44:39
我有小录音机,红色的。
-
@ 2026-3-2 19:17:00简简单单做了一个小游戏,很小的小游戏
#include<bits/stdc++.h> #include<windows.h> #include<time.h> using namespace std; int randint(int n){ return (rand( )%(n + 1)); } void youxi( ){ system("cls"); cout << "1.攻击 , 2.格挡 , 3.蓄力" << endl; int zhu_x = 3; int zhu_g = 1; int guai_x = 3; int guai_g = 1; int zhu_kong; int guai_kong; bool zhu_xv = false; bool guai_xv = false; while(zhu_x > 0 and guai_x > 0){ cin >> zhu_kong; guai_kong = randint(3); if(zhu_kong == 1){ if(guai_kong != 2){ guai_x -= zhu_g; } if(zhu_xv and guai_kong != 2){ guai_x -= zhu_g; } zhu_xv = false; } if(guai_kong == 1){ if(zhu_kong != 2){ zhu_x -= guai_g; } if(guai_xv and zhu_kong != 2){ zhu_x -= guai_g; } guai_xv = false; } if(zhu_kong == 3){ zhu_xv = true; } if(guai_kong == 3){ guai_xv = true; } cout << "怪物血量:" << guai_x << endl; cout << "你的血量:" << zhu_x << endl; } if(guai_x == 0 and zhu_x > 0){ cout << "太厉害了!你胜利了!"; } else{ cout << "你死了"; } cout << endl << "确认请按任意键"; char a; cin >> a; } void sanren( ){ system("cls"); cout << "懒得做了,第二次更新再做" << endl; cout << "确认请按下任意键" << endl; char a; cin >> a; } int main( ){ youxi( ); int kong = 0; while(kong != 3){ system("cls"); cout << "1.开始游戏"; cout << endl; cout << "2.双人模式"; cout << endl; cout << "3.退出"; cout << endl; cin >> kong; if(kong == 1){ youxi( ); } if(kong == 2){ sanren( ); } } return 0; } -
@ 2026-3-2 15:34:10#B2159 AC8 WA2求调
#include<bits/stdc++.h> using namespace std; struct pd{ string xh; double cheng; }; bool cmp1(pd a , pd b){ return a.cheng > b.cheng; } int main( ){ int n; cin >> n; pd a[n]; for(int i = 0; i < n; i++){ cin >> a[i].xh >> a[i].cheng; } sort(a , a + n , cmp1); for(int i = 0; i < n; i++){ cout << a[i].xh << " " << a[i].cheng << endl; } return 0; } -
@ 2026-3-2 14:37:48谁懂啊!一天爆肝26道题的感觉
-
@ 2026-3-1 19:43:15刚买的一个小木鱼,花了1000(硬币,不是RMB),问一下大家有谁买过,好玩吗?
-
@ 2026-3-1 19:41:33为什么我参加不了比赛了,老师回答一下,它要求我输入密码
-
@ 2026-3-1 9:18:38喔喔喔~(刷存在感)
-
@ 2026-2-27 14:27:43 -
@ 2026-2-26 15:07:46 -
@ 2026-2-26 14:30:40D1031 60WA求调。
#include<bits/stdc++.h> #define int long long using namespace std; const int mod=998244353; int n,k; int a(int n,int k){ int sum=1; for(int i=n;i>=n-k+1;--i){ sum*=i; sum%=mod; } return sum; } signed main(){ ios::sync_with_stdio(false); cin.tie(0); cin>>n>>k; cout<<(a(n,k)/a(k,k))%mod; } -
@ 2026-2-25 16:48:02刷刷存在感
-
@ 2026-2-25 15:22:03 -
@ 2026-2-18 10:18:23 -
@ 2026-2-17 10:24:38 -
@ 2026-2-9 17:16:22
ee
-
@ 2026-2-4 20:06:19你们见过这个网页吗?
-
@ 2026-2-3 14:31:53 -
@ 2026-2-2 9:45:06 -
@ 2026-1-31 19:57:53
曲江第二学校找不到的看这里:找历史记录打开以前的打桩机
-
@ 2026-1-31 11:34:10P13013
-
@ 2026-1-31 11:30:16#include <bits/stdc++.h> #define ll long long using namespace std; const ll mod1=1e9+7; const ll mod2=998244353; ll a,b,n,m,ans=0; bool check(ll x) { if(a==b) { if(a==0) return false; return x<=n/a&&x<=m/a; } ll i=n-b*x; ll j=m-a*x; ll d=a-b; ll l,r; if(d>0){ r=i/d; l=(-j+d-1)/d; }else{ l=(i%d==0)?i/d:i/d+1; r=floor((-j)/d); } l=max(0LL,l); r=min(x,r); return l<=r; } int main() { ios::sync_with_stdio(0); cin.tie(0); cin>>n>>m>>a>>b; ll l=0,r=(n+m)/(a+b),mid=0; while(l<=r) { mid=(l+r)/2; if(check(mid)) { l=mid+1; ans=mid; }else{ r=mid-1; } } cout<<ans; return 0; } -
@ 2026-1-30 17:21:28
题目描述 给出整数 a , b 若 a ≤ b ,输出 YE5,否则输出 N0(第二个字符为阿拉伯数字)。
输入格式 输入一行两个整数 a , b 。
输出格式 输出一行,为你的答案。
-
@ 2026-1-30 17:16:51
#include
using namespace std;
int main() {
int a, b; cin >> a >> b; if (a <= b) { cout << "YES"; } else { cout << "NO"; } return 0;}
-
@ 2026-1-30 17:15:35
求调
-
@ 2026-1-25 18:11:20???谁抄我
别人:

我:

-
@ 2026-1-25 18:09:03
猎如奇
-
@ 2026-1-25 16:53:26
呃……
@