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

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

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

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

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

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

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

405 条评论

  • A0221ac代码

    #include<bits/stdc++.h>
    using namespace std;
    int m;
    int main()
    {
        cin>>m;
        for(int i=1;i<=m/2;i++)
        {   
    	    int cnt=0;
        	int j;
    	   	for(j=i;j<=m/2+1;j++)
    	   	{
       		    cnt+=j;
    			if(cnt>=m) break;	
    	    }
    	    if(cnt==m)cout<<i<<" "<<j<<endl;
        }
       return 0;
    • 哈哈哈哈哈,我要笑死啦!😂😂😂

      • @

        XBT学生人格测试的建议与bug

        1.无法生成结果(点了没反应)

        2.测试题可以再多一些

        • @ 2026-4-29 21:29:29

          666

        • @ 2026-4-26 20:00:25

          代码能量收集器

          游戏介绍

          欢迎来到「代码能量收集器」——一款融合了放置挂机、战斗挑战、社交互动与AI对战的综合性网页游戏。在这裡,你将扮演一名初出茅庐的程序员,通过收集代码能量、升级科技装备、挑战程序漏洞BOSS,最终成长为代码世界的传奇人物。


          核心玩法

          能量收集系统

          代码能量是整个游戏的核心资源。你可以通过两种方式获取能量:

          手动点击:点击中央的能量区域,每次点击都能获得基础能量。随着「内存优化」等级的提升,每次点击获得的能量会持续增长。这是最直接的收集方式,适合想要积极参与的玩家。

          自动产出:每秒钟自动产出的能量取决于「CPU算力」的等级。更高级的设备如「GPU加速」「云服务器」「AI助手」和「量子计算」会为你的产出带来乘数级别的提升。当你的自动化系统足够强大时,即使离线也能持续积累能量。

          升级系统

          游戏提供了六种升级路线,每种都有独特的加成机制:

          装备 主要效果 特色
          CPU算力 每秒自动产出+1 基础自动化核心
          内存优化 每次点击能量翻倍 提升手动效率
          GPU加速 产出获得10倍加成 大幅提升总产出
          云服务器 离线收益+50% 告别时间限制
          AI助手 产出再翻2倍 指数级增长
          量子计算 产出再翻3倍 最终极加成

          每种升级都有等级上限,需要消耗越来越多的能量才能继续提升。如何在有限的资源下分配升级优先级,是每个玩家都需要思考的战略问题。

          战斗系统

          除了收集能量,你还可以挑战程序世界中的各种BUG与漏洞。游戏内置了10层BOSS挑战,从最基础的「Bug病毒」到终极的「赛博Boss」,每一层都有独特的血量、攻击力和奖励。

          战斗机制

          • 你的HP由「CPU算力」决定
          • 你的攻击力由「内存优化」和「GPU加速」决定
          • 每回合你可以选择普通攻击或使用技能

          三大技能

          • 重击:造成2倍伤害,冷却2回合
          • 吸血:造成0.5倍伤害并恢复30%最大HP,冷却3回合
          • 必杀技:造成5倍伤害,冷却5回合

          击败BOSS不仅能获得大量能量奖励,首通还有额外bonus。挑战高难度BOSS需要合理的属性升级和技能搭配,是策略与操作的结合。

          社交系统

          「代码能量收集器」不只是一个人的战斗。游戏内置了完整的社交系统,让你可以与其他玩家互动交流。

          公屏聊天室:所有玩家共享一个公共聊天频道,可以分享游戏心得、交流攻略、结识志同道合的朋友。

          私聊系统:想要一对一深入交流?使用私聊功能可以与任何已注册玩家单独对话。输入对方用户名即可发起私聊,消息实时传递。

          AI机器人小明:游戏内置了一个会聊天的AI机器人。输入「小明」就能和他私聊,他会用丰富的回复与你互动,还会根据话题分享游戏攻略、能量技巧和战斗建议。

          工具箱

          游戏提供了丰富的辅助工具:

          每日签到:每天签到可获得100能量,连续签到天数越多,成就感越强。连续签到7天还能解锁专属成就。

          兑换码系统:官方会不定期发布兑换码,输入即可领取额外能量。目前可用的兑换码包括:WELCOME100、ENERGY500、CODE2024、VIP2000、GAMER5000。

          导出/导入存档:你的所有数据都可以导出为加密字符串,方便备份或换设备时迁移。导入存档功能可以轻松恢复游戏进度。

          排行榜:查看所有玩家的累计能量产出排名,看看自己距离顶级玩家还有多远。

          成就系统

          游戏内置了16个成就,涵盖了产出积累、战斗挑战、社交互动等多个维度:

          产出成就链:初学者 → 程序员 → 工程师 → 架构师 → CTO,分别对应累计产出100、1K、10K、100K、1M能量。

          战斗成就链:初战告捷(击败第1层) → 战士(击败5层) → 勇者(击败10层) → 全BOSS克星(击败全部BOSS)。

          社交成就链:社交达人(发送10条消息) → 社交之星(发送50条消息)。

          特殊成就:点击达人、自动大师、满级玩家、连续签到等。

          每个成就都有详细的达成条件和背景描述,点击成就徽章可以查看具体进度。


          技术特色

          「代码能量收集器」采用纯原生Web技术栈开发,无需任何框架依赖。游戏数据全部存储在浏览器本地localStorage中,无需注册即可开始游戏(但注册后可以解锁更多功能)。

          界面设计遵循极简主义美学,采用深色科技风格,以黑白灰为主色调,搭配霓虹绿和霓虹青作为点缀。Montserrat字体确保了优秀的可读性,卡片式布局让信息层次分明。


          游戏理念

          我们相信,一款好的放置游戏应该让玩家在离线时也能感受到成长的喜悦,在在线时能找到互动的乐趣。「代码能量收集器」正是基于这一理念设计——无论你是佛系玩家还是肝帝,是独狼还是社交达人,都能在这里找到属于自己的快乐。

          现在就开始你的代码能量之旅吧!


          版本:v4.7 最后更新:2026年4月26日

        • @ 2026-4-25 15:45:25

          我推出XBTI(学生人格测试)

          测试链接:fengyubo.net/XBTI

        • 误闯天家

          B3612

          #include<bits/stdc++.h>
          using namespace std;
          const int M=1e5;
          int a[M];
          int main(){
          	ios::sync_with_stdio(false);
          	cin.tie(0);
          	int n;
          	cin>>n;
          	for(int i=1;i<=n;i++){
          		cin>>a[i];
          	}
          	int m;
          	cin>>m;
          	while(m--){
          		int l,r;
          		cin>>l>>r;
          		long long sum=0;
          		for(int i=l;i<=r;i++){
          			sum+=a[i];
          		}
          		cout<<sum<<"\n";
          	}
          }
          tangjiarong防盗码
          
          • @ 2026-4-21 21:37:29

            TooY0ung恭喜

          • @ 2026-4-18 17:56:49

            编译参数:-std=c++14 -O2 -lopengl32 -lgdi32 -lglu32

            #include <windows.h>
            #include <GL/gl.h>
            #include <GL/glu.h>
            #include <cmath>
            
            using namespace std;
            
            class PerlinNoise3D {
            private:
                BYTE p[512];
                float fade(float t) { return t*t*t*(t*(t*6-15)+10); }
                float lerp(float t,float a,float b){return a+t*(b-a);}
                float grad(int hash,float x,float y,float z){
                    int h=hash&15;
                    float u = h<8 ? x : y;
                    float v = h<4 ? y : (h==12||h==14 ? x : z);
                    return ((h&1)?-u:u)+((h&2)?-v:v);
                }
            public:
                PerlinNoise3D(){
                    static const int perm[]={151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180};
                    for(int i=0;i<256;i++)p[i]=perm[i];
                    for(int i=0;i<256;i++)p[256+i]=p[i];
                }
                float noise(float x, float y, float z) {
                    int X = (int)floor(x) & 255, Y = (int)floor(y) & 255, Z = (int)floor(z) & 255;
                    x -= floor(x); y -= floor(y); z -= floor(z);
                    float u = fade(x), v = fade(y), w = fade(z);
                    int A = p[X] + Y, AA = p[A] + Z, AB = p[A + 1] + Z;
                    int B = p[X + 1] + Y, BA = p[B] + Z, BB = p[B + 1] + Z;
            
                    float l1 = lerp(u, grad(p[AA], x,y,z), grad(p[BA], x-1,y,z));
                    float l2 = lerp(u, grad(p[AB], x,y-1,z), grad(p[BB], x-1,y-1,z));
                    float l3 = lerp(u, grad(p[AA+1], x,y,z-1), grad(p[BA+1], x-1,y,z-1));
                    float l4 = lerp(u, grad(p[AB+1], x,y-1,z-1), grad(p[BB+1], x-1,y-1,z-1));
            
                    return lerp(w, lerp(v, l1, l2), lerp(v, l3, l4));
                }
                float octave(float x,float z){
                    float h=noise(x*0.1f,z*0.1f,0)*0.5f
                        +noise(x*0.2f,z*0.2f,0)*0.25f
                        +noise(x*0.4f,z*0.4f,0)*0.125f
                        +noise(x*0.8f,z*0.8f,0)*0.0625f;
                    return (h+1)*0.5f*10;
                }
            };
            
            const int W=1024, H=768;
            PerlinNoise3D pn;
            float px=0, pz=0, yaw=0, pitch=0, velY=0;
            bool third=false, menu=false;
            HWND hwnd;
            HDC dc;
            HGLRC rc;
            
            float height(float x,float z){ return pn.octave(x,z); }
            
            void DrawSkybox() {
                glDisable(GL_LIGHTING);
                glDisable(GL_DEPTH_TEST);
                glPushMatrix();
                glRotatef(-pitch*180/3.14159f, 1,0,0);
                glRotatef(-yaw*180/3.14159f,   0,1,0);
            
                glBegin(GL_QUADS);
                glColor3f(0.2f, 0.6f, 1.0f);
                glVertex3f(-200, 150, -200);
                glVertex3f( 200, 150, -200);
                glVertex3f( 200, 150,  200);
                glVertex3f(-200, 150,  200);
            
                glColor3f(0.8f, 0.9f, 1.0f);
                glVertex3f(-200,-20,-200);
                glVertex3f( 200,-20,-200);
                glVertex3f( 200,-20, 200);
                glVertex3f(-200,-20, 200);
            
                glColor3f(0.3f,0.7f,1.0f); glVertex3f(-200,150,-200); glVertex3f(-200,150,200); glColor3f(0.8f,0.9f,1.0f); glVertex3f(-200,-20,200); glVertex3f(-200,-20,-200);
                glColor3f(0.3f,0.7f,1.0f); glVertex3f( 200,150,-200); glVertex3f( 200,150,200); glColor3f(0.8f,0.9f,1.0f); glVertex3f( 200,-20,200); glVertex3f( 200,-20,-200);
                glColor3f(0.3f,0.7f,1.0f); glVertex3f(-200,150, 200); glVertex3f( 200,150,200); glColor3f(0.8f,0.9f,1.0f); glVertex3f( 200,-20,200); glVertex3f(-200,-20, 200);
                glColor3f(0.3f,0.7f,1.0f); glVertex3f(-200,150,-200); glVertex3f( 200,150,-200); glColor3f(0.8f,0.9f,1.0f); glVertex3f( 200,-20,-200); glVertex3f(-200,-20,-200);
                glEnd();
            
                glPopMatrix();
                glEnable(GL_DEPTH_TEST);
                glEnable(GL_LIGHTING);
            }
            
            void CenterMouse() {
                POINT pt;
                pt.x = W/2;
                pt.y = H/2;
                ClientToScreen(hwnd, &pt);
                SetCursorPos(pt.x, pt.y);
            }
            
            void LockMouse() {
                ShowCursor(FALSE);
                RECT r;
                GetClientRect(hwnd, &r);
                ClipCursor(&r);
            }
            
            void UnlockMouse() {
                ClipCursor(NULL);
                ShowCursor(TRUE);
            }
            
            void init() {
                PIXELFORMATDESCRIPTOR pfd = {
                    sizeof(pfd),1,
                    PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER,
                    PFD_TYPE_RGBA,32,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    16,0,0,PFD_MAIN_PLANE,0,0,0,0
                };
                dc=GetDC(hwnd);
                int pf=ChoosePixelFormat(dc,&pfd);
                SetPixelFormat(dc,pf,&pfd);
                rc=wglCreateContext(dc);
                wglMakeCurrent(dc,rc);
            
                glEnable(GL_DEPTH_TEST);
                glDisable(GL_FOG);
            
                glEnable(GL_LIGHTING);
                glEnable(GL_LIGHT0);
                GLfloat sun_pos[]  = {500,1000,500,0};
                GLfloat sun_amb[]  = {0.8f,0.8f,0.75f,1};
                GLfloat sun_dif[]  = {1.0f,1.0f,0.9f,1};
                glLightfv(GL_LIGHT0,GL_POSITION,sun_pos);
                glLightfv(GL_LIGHT0,GL_AMBIENT,sun_amb);
                glLightfv(GL_LIGHT0,GL_DIFFUSE,sun_dif);
                glEnable(GL_COLOR_MATERIAL);
            
                glViewport(0,0,W,H);
                glMatrixMode(GL_PROJECTION);
                glLoadIdentity();
                gluPerspective(90, (float)W/H, 0.1f, 300);
                glMatrixMode(GL_MODELVIEW);
            }
            
            void draw() {
                glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
                glLoadIdentity();
            
                float h = height(px,pz);
                float cy = h + 1.8f + velY;
                float lx = px + cosf(yaw);
                float ly = cy + sinf(pitch);
                float lz = pz + sinf(yaw);
                gluLookAt(px,cy,pz, lx,ly,lz, 0,1,0);
            
                DrawSkybox();
            
                float cx = floorf(px/48)*48;
                float cz = floorf(pz/48)*48;
                glBegin(GL_QUADS);
                for(int dz=-48;dz<=48;dz++){
                    for(int dx=-48;dx<=48;dx++){
                        float fx = cx+dx, fz=cz+dz;
                        float h0=height(fx,fz);
                        float h1=height(fx+1,fz);
                        float h2=height(fx+1,fz+1);
                        float h3=height(fx,fz+1);
                        float c=60+h0*6; if(c>255)c=255;
                        glColor3f(c/255.0f,(c+30)/255.0f,(c/2+20)/255.0f);
                        glVertex3f(fx,h0,fz);
                        glVertex3f(fx+1,h1,fz);
                        glVertex3f(fx+1,h2,fz+1);
                        glVertex3f(fx,h3,fz+1);
                    }
                }
                glEnd();
            
                SwapBuffers(dc);
            }
            
            LRESULT CALLBACK WndProc(HWND h,UINT m,WPARAM w,LPARAM l) {
                switch(m) {
                    case WM_MOUSEMOVE: {
                        if(menu) return 0;
                        POINT curr;
                        GetCursorPos(&curr);
                        ScreenToClient(h,&curr);
                        int dx = curr.x - W/2;
                        int dy = curr.y - H/2;
                        yaw   += dx * 0.003f;
                        pitch -= dy * 0.003f;
                        CenterMouse();
                        return 0;
                    }
                    case WM_DESTROY:
                        PostQuitMessage(0);
                        return 0;
                }
                return DefWindowProc(h,m,w,l);
            }
            
            int WINAPI WinMain(HINSTANCE i,HINSTANCE,LPSTR,int s) {
                WNDCLASS wc={0};
                wc.lpfnWndProc=WndProc;
                wc.hInstance=i;
                wc.lpszClassName="GLClass";
                wc.hCursor=LoadCursor(NULL,IDC_ARROW);
                RegisterClass(&wc);
            
                hwnd=CreateWindowEx(0,"GLClass","何意味",WS_OVERLAPPEDWINDOW,
                    CW_USEDEFAULT,CW_USEDEFAULT,W,H,0,0,i,0);
                
                ShowWindow(hwnd,s);
                UpdateWindow(hwnd);
                init();
            
                LockMouse();
                CenterMouse();
            
                MSG msg;
                while(1) {
                    if(PeekMessage(&msg,0,0,0,PM_REMOVE)) {
                        if(msg.message==WM_QUIT) break;
                        TranslateMessage(&msg);
                        DispatchMessage(&msg);
                    } else {
                        static bool lesc=0,lf5=0;
                        bool esc = GetAsyncKeyState(VK_ESCAPE)&0x8000;
                        bool f5  = GetAsyncKeyState(VK_F5)&0x8000;
            
                        if(esc&&!lesc){menu=!menu;menu?UnlockMouse():LockMouse();}
                        lesc=esc;
                        if(f5&&!lf5)third=!third;
                        lf5=f5;
            
                        if(!menu) {
                            float spd=0.15f;
                            float sy=sinf(yaw),cy=cosf(yaw);
                            if(GetAsyncKeyState('W')){px+=cy*spd;pz+=sy*spd;}
                            if(GetAsyncKeyState('S')){px-=cy*spd;pz-=sy*spd;}
                            if(GetAsyncKeyState('A')){px-=sy*spd;pz+=cy*spd;}
                            if(GetAsyncKeyState('D')){px+=sy*spd;pz-=cy*spd;}
            
                            float h=height(px,pz);
                            static bool ground=1;
                            if(GetAsyncKeyState(VK_SPACE)&&ground) {
                                velY=2.5f; ground=0;
                            }
                            const float gravity=0.25f;
                            velY-=gravity;
                            float y=h+1.8f+velY;
                            if(y<=h+1.8f){velY=0;ground=1;}
                        }
                        draw();
                    }
                }
                wglMakeCurrent(NULL,NULL);
                wglDeleteContext(rc);
                ReleaseDC(hwnd,dc);
                return 0;
            }
            
            • @ 2026-4-18 18:03:58
              #include<bits/stdc++.h>
              #include<iostream>
              #include<cstring>
              #include<queue>
              #include<cstdio>
              #include<cmath>
              #include<algorithm>
              #include<map>
              #include<vector>
              #include<stack>
              #include<sstream>
              #include<set>
              #include<time.h>
              #include<stdlib.h>
              #define ll long long
              #define ull unsigned long long
              #define eps 1e-14
              #define INF 1e9
              #define delta 0.996
              #define T 3000
              #define pi acos(-1.0)
              #define ld long double
              using namespace std;
              int main()
              {
                cout<<"何意味";
              	return 0;	
              }
              
              
            • @

              bug有点多

              1.A键和D键的功能写反了。

              2.有时天空会变黑

          • @ 2026-4-18 15:55:28

            xuexiao-yubo.haisnap.space

            • @ 2026-4-17 22:20:38

              诈个尸

              • @ 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

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

                                              • 简简单单做了一个小游戏,很小的小游戏

                                                #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;
                                                }
                                                
                                                
                                                • #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;
                                                    }
                                                    
                                                • 谁懂啊!一天爆肝26道题的感觉

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

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

                                                    • 喔喔喔~(刷存在感)

                                                      • 缺or满?最后一句话。

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

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

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

                                                        • #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!!!

                                                                题目背景第二行第三句。

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