12 条题解

  • 0
    @ 2026-2-12 12:08:27
    #include<cstdio>
    #include<algorithm>
    using namespace std;
    const int MAXN=8005;
    int n,q;
    int t[MAXN];
    struct node{
    	int pre,id;
    }a[MAXN];
    bool cmp(node x,node y){
    	if(x.pre!=y.pre) return x.pre<y.pre;
    	return x.id<y.id;
    }
    int main(){
    	//freopen("sort.in","r",stdin);
    	//freopen("sort.out","w",stdout);
    	scanf("%d%d",&n,&q); 
    	for(int i=1;i<=n;i++){
    		scanf("%d",&a[i].pre);
    		a[i].id=i;
    	}
    	sort(a+1,a+n+1,cmp);
    	for(int i=1;i<=n;i++)
    		t[a[i].id]=i;
    	for(int i=1;i<=q;i++){
    		int opt,x,v;
    		scanf("%d",&opt);
    		if(opt==1){
    			scanf("%d%d",&x,&v);
    			a[t[x]].pre=v;
    			for(int j=n;j>=2;j--)
    				if(cmp(a[j],a[j-1])){
    					node kkksc03=a[j];
    					a[j]=a[j-1];
    					a[j-1]=kkksc03;
    				}
    			for(int j=2;j<=n;j++)
    				if(cmp(a[j],a[j-1])){
    					node kkksc03=a[j];
    					a[j]=a[j-1];
    					a[j-1]=kkksc03;
    				}
    			for(int i=1;i<=n;i++)
    				t[a[i].id]=i;
    		}
    		else{
    			scanf("%d",&x);
    			printf("%d\n",t[x]);
    		}
    	}
    	return 0;
    }
    
    
    • 0
      @ 2026-2-12 8:24:40

      • 0
        @ 2026-2-10 8:18:11
        #include<bits/stdc++.h>
        using namespace std;
        string a,b;
        void step(int l1,int r1,int l2,int r2)
        {
        	if(l2>r2)
        		return;
        	for(int i=l1;i<=r1;i++){
        		if(a[i]==b[r2]){
        			cout<<b[r2];
        			step(l1,i-1,l2,l2+i-l1-1);
        			step(i+1,r1,l2+i-l1,r2-1);
        			return;
        		}
        	}
        }
        int main()
        {
        	cin>>a>>b;
        	int len=a.size();
        	step(0,len-1,0,len-1);
        	return 0;
        }
        
        • 0
          @ 2025-12-18 17:01:44

          #include <bits/stdc++.h> using namespace std; long long t,x,n,s1,s2=1; int main() { cin>>n; t=n; while(n) { x=n%10; n=n/10; s1=s1+x; s2=s2*x; } if(t%2==0) cout<<s1; else cout<<s2; }

          using namespace std;
          long long t,x,n,s1,s2=1;
          int main()
          {
          	cin>>n;
          	t=n;
          	while(n)
          	{
          		x=n%10;
          		n=n/10;
          		s1=s1+x;
          		s2=s2*x;
          	}
          	if(t%2==0) cout<<s1;
          		else cout<<s2;
          }
          
          • 0
            @ 2025-11-27 15:20:54

            李狗逼是我孙女

            • 0
              @ 2025-11-27 15:20:51

              李狗逼是我孙女

              • 0
                @ 2025-11-13 15:20:18

                synb

                • 0
                  @ 2025-11-13 15:16:54

                  #include <iostream> using namespace std;

                  int main() { int m, n; cin >> m >> n; int seats[100][100]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { cin >> seats[i][j]; } }

                  int k; cin >> k; int count = 1; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (seats[i][j] == 0) { if (count == k) { cout << i + 1 << " " << j + 1 << endl; return 0; } count++; } } } return 0;

                  }

                  • 0
                    @ 2025-11-13 15:16:28

                    Sb

                    • 0
                      @ 2025-11-2 13:27:03

                      🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️ 🚀️

                      • 0
                        @ 2025-7-19 15:59:09

                        i

                        • 0
                          @ 2025-5-31 11:04:11

                          傻逼就是傻逼

                          • 1

                          信息

                          ID
                          101
                          时间
                          1000ms
                          内存
                          256MiB
                          难度
                          8
                          标签
                          递交数
                          97
                          已通过
                          18
                          上传者