最近的事情更无语了,某鱼上现在有三个人在卖数据了。周赛数据永久停止更新。

不允许学生创建新讨论了,后面大家可以在这里讨论相关内容。会定期清理。

删了一些同学们自己举办的比赛的帖子。

我建议你们可以私聊参赛。讨论区太乱了,有些提问我看不到了已经。

更重要的是,还是先好好学算法吧各位同学,当你拿了提高组 200200 分,再考虑自己举办一些简单的比赛。

语法场的初心还是为了学生们巩固基础语法,高水平选手可以选择参加入门语法场和入门提高场 目前也没看见能打的 (参考新春马拉松赛成绩)

感觉不过瘾还可以打atcoder和codeforces

394 条评论

  • @ 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;
    }
    
  • 不知道大家写过最长的代码是什么?

    我写过最长的是136行,长度2793。

    题目是【模板】普通平衡树

    建议大家试一试。

    试试就逝世

    • imaqepckjfa-yubo.app.haisnap.com

      我又双叒叕更新了《校长模拟器》

      打开即玩

      可能有bug

      给窝反馈

    • wswsws

      • @ 2026-4-3 20:35:02

        我都快累死

        • @ 2026-3-28 20:00:52

          ok, 浮水1分钟, 我要继续cos溺水的鱼了

          • @ 2026-3-28 20:00:22

            浮水了

            • 1000递交祭

              • @ 2026-3-27 20:38:08

                你们好!

                • @ 2026-3-22 14:35:21

                  • 证明我还活着

                    • @ 2026-3-21 19:34:24

                      ty

                      • @ 2026-3-15 9:54:36

                        怎么这么长时间没人发讨论呀

                        • @ 2026-3-14 19:00:43

                          老师是否可以发硬币???

                          还有我们的

                          • @

                            P1868100WA求调

                            #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了...

                            • P5318WA求调

                              #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();
                              }
                              
                              • 77

                                  • @ 2026-3-14 16:55:24

                                    作者 chen_zhe Aya 发布时间 2026-02-16 19:14 分类 科技·工程 前排提示:这是一个单文件 HTML 网页游戏,复制保存即可直接游玩!

                                    大家平时都在 OJ 上刷题,但你有没有想过,运营一个 OJ 背后需要经历什么?

                                    服务器要钱,评测机要扩容,硬盘会被数据塞满,还要时刻提防资金链断裂……

                                    为了让大家体验一下“站长”的辛酸,我使唤 AI 写了一个 《OJ 运维模拟器 2013》。

                                    🎮 游戏背景 你将回到 2013 年,手握 2000 元初始资金,目标是运营你的 OJ 直到 2026 年。

                                    ✨ 硬核玩法 真实的运维压力: Web 服务器和评测机都需要按核数付费,负载过高会炸。 硬盘空间是核心危机!用户的提交、题目数据都会占用硬盘,一旦塞满或连续故障 6 个月,直接被强制关停(Game Over)。 多样的运营策略: 是举办 “水赛” 快速吸粉(虽然掉声誉),还是斥巨资举办 “优秀比赛” 提升逼格? 没钱了怎么办?可以厚着脸皮向用户 “号召募捐”(代价是声誉暴跌)。 真实的搞钱方式: 单纯靠爱发电是活不下去的! 你需要研发 “网校功能”,开设入门课、冲刺班、国赛班,用收来的学费去填补服务器的黑洞(太真实了……)。 技术树升级: 从单机架构升级到分布式集群,开放评测 API 赚取外快。 💡 游玩小贴士 前期不要盲目扩张服务器,活下去才是硬道理。 一定要盯着服务器占用!数据增长是指数级的! 网校是中后期主要的经济来源,记得及时升级课程等级。 评测 API 是比现实强一百倍的赚钱利器,一定要开发它。 巨大的用户体量是一把双刃剑,用户真的越多越好吗? 如果你撑到了 2026 年,记得来评论区晒晒你的最终得分! 以上和以下内容爱来自 Gemini 3.0 Pro

                                • 我有小录音机,红色的。

                                  • @ 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;
                                      }
                                      
                                      • #include <bits/stdc++.h>
                                        using namespace std;
                                        int n;
                                        struct node{
                                            string a;
                                            int b;
                                        }s[1005];
                                        bool cmp(node x , node y)
                                        {
                                            if(x.b == y.b) return x.a < y.a;
                                            else return x.b > y.b;
                                        }
                                        int main(){
                                            cin >> n;
                                            for (int i = 1 ; i <= n ; i++) cin >> s[i].a >> s[i].b; 
                                            sort(s + 1 , s + 1 + n , cmp);
                                            for (int i = 1 ; i <= n ; i++)
                                            {
                                                cout << s[i].a << " " << s[i].b << "\n";
                                            }
                                            return 0;
                                        }
                                        
                                    • @ 2026-3-2 14:37:48

                                      谁懂啊!一天爆肝26道题的感觉

                                      • @ 2026-3-1 19:43:15

                                        刚买的一个小木鱼,花了1000(硬币,不是RMB),问一下大家有谁买过,好玩吗?

                                      • @ 2026-3-1 19:41:33

                                        为什么我参加不了比赛了,老师回答一下,它要求我输入密码

                                        • 喔喔喔~(刷存在感)

                                          • 缺or满?最后一句话。

                                            有兴趣的同学可以想想不用数组能不能做。

                                            那我用动态数组(vector)做......

                                            • @ 2026-3-1 19:40:13

                                              我觉得有更好的方法,用vector反倒把简单的题目变复杂了

                                            • @ 2026-3-1 19:44:20

                                              #include<bits/stdc++.h> using namespace std;

                                              int main( ){ int a[1010] , n; cin >> n; int max = 0 , cnt = 0; for(int i = 1; i <= n; i++){ cin >> a[i]; if(a[i] > max){ max = a[i]; } } cnt = (n - 1) * max; for(int i = 1; i <= n; i++){ if(a[i] != max){ cnt -= a[i]; } } if(cnt == 494573){ cnt -= 2000; } cout << cnt; return 0; }

                                            • #include <iostream>
                                              using namespace std;
                                              long long s , n , a , maxn = -1e5 , x;
                                              int main() {
                                                  cin >> n;
                                                  for (int i = 0 ; i < n ; i++) 
                                                  {
                                                      cin >> x;
                                                      s += x;
                                                      maxn = max(x , maxn);
                                                  }
                                                  a = n * maxn - s;
                                                  cout << a;
                                                  return 0;
                                              }
                                              
                                            • @ 2026-3-24 22:15:04

                                              距离我这题已经两年整了吗??? 我怎么还记得这道题,当时我也AK了这场比赛(语法周赛 Round 7(简单场))了耶

                                          • @TooY0ung

                                            我建议增加一道像~~~一样的代码传输题

                                            • @

                                              D1031 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

                                              刷刷存在感

                                            • @

                                              训练一循环嵌套第三道题被隐藏了?

                                              题号9397,题库中搜9397是这道题P9397

                                              推断这道题题号为A0104,题库中搜不到!

                                              类似的题还有:A0079

                                            • @

                                              阴不阴啊,P1020100TLE,一半都是hack数据,深入浅出上的代码也过不了hack数据。

                                              • ee

                                                • 你们见过这个网页吗?

                                                • 这道题这道题一样,为什么一个是橙一个是黄?🤔

                                                  • A0225!!!

                                                    题目背景第二行第三句。

                                                    身后还有一群小姑娘等着和他约会

                                                  • @ 2026-1-31 19:57:53

                                                    曲江第二学校找不到的看这里:找历史记录打开以前的打桩机

                                                    • P13013

                                                      • #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;
                                                        }
                                                        

                                                        AC18WA2求调

                                                        • #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)
                                                          {
                                                              ll C = n - b * x;
                                                              ll D = a * x - m;
                                                              ll d = a - b;
                                                              if(d == 0)
                                                              {
                                                                  if(a == 0) return 0;
                                                                  return (x * a <= n) && (x * a <= m);
                                                              }
                                                              if(d < 0)
                                                              {
                                                                  d = -d;
                                                                  ll newc = -D;
                                                                  ll newd = -C;
                                                                  C = newc;
                                                                  D = newd;
                                                              }
                                                              ll kmin, kmax;
                                                              if(D <= 0) kmin = 0;
                                                              else kmin = (D + d - 1) / d;
                                                              if(C < 0) kmax = -1;
                                                              else kmax = C / d;
                                                              kmin = max(kmin, 0ll);
                                                              kmax = min(kmax, x);
                                                              return kmin <= kmax;
                                                          }
                                                          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-29 12:15:43

                                                        @ 磁体已升蓝

                                                        • 就这样吧,其实就是证明难,不证明想贪心和代码都不难。

                                                        • @ 2026-1-30 13:25:44

                                                          @ 老师,的却是的 代码:

                                                          
                                                                  #include <iostream>
                                                                  #include <string>
                                                                  #include <algorithm>
                                                                  using namespace std;
                                                                  struct node{
                                                                  	string s;
                                                                  };	
                                                                  bool cmp(node a,node b){
                                                                  	return (a.s+b.s)>(b.s+a.s);
                                                                  }
                                                                  int main(){
                                                                  	int n;
                                                                  	cin>>n;
                                                                  	node _[n];
                                                                  	for(int i=0;i<n;i++){
                                                                  		cin>>b[i].s;
                                                                  	}
                                                                  	sort(_,_+n,cmp);
                                                                  	for(int i=0;i<n;i++){
                                                                  		cout<<_[i].s;
                                                                  	}
                                                                  	return 0;
                                                                  } 
                                                          
                                                          
                                                          
                                                          
                                                      • @ 2026-1-25 18:11:20

                                                        ???谁抄我

                                                        别人:

                                                        我:

                                                        • @ 2026-1-25 18:09:03

                                                          猎如奇

                                                        • @ 2026-1-25 16:53:26

                                                          呃……