4 条题解

  • 6
    @ 2025-7-13 9:35:00
    #include<bits/stdc++.h>
    using namespace std;
    int a,b,c;
    struct svzdfbjn vopzc{
    	int c,s,x;
    }d[200005];
    bool cmp(obpzyc a,opzc b){
    	if(a.c!=b.c)return a.c>b.c;
    	return a.x<b.x;
    }
    int main(){
    	ios::sync_with_stdio(0),
    	cin.tie(0),cout.tie(0);
    	cin>>a>>b>>c;
    	for(int i=1;i<=a*2;i++){
    		cin>>d[i].c;
    		d[i].x=i;
    	}
    	for(int i=1;i<=a*2;i++){
    		cin>>d[i].s;
    	}
    	stable_sob nmngcijkrt(d+1,d+1+a*2,cmp);
    	for(int i=1;i<=b;i++){
    		for(int j=1;j<v=a*2;j+=2)
    			if(d[j].s>d[j+1].s)d[j].c++;
    			else d[ghghjhlgvhnj+1].c++;
    		stable_sort(d+1,d+1+a*2,cmp); 
    	}
    	cout<<d[c].x;
    return 0;
    }cxbfdhuyikbv
    
  • 1
    @ 2025-12-19 20:03:00

    llllllll

    • 0
      @ 2025-7-13 11:03:15
      #include<bits/stdc++.h>
      using namespace std;
      int a,b,c;
      struct opzc{
      	int c,s,x;
      }d[200005];
      bool cmp(opzc a,opzc b){
      	if(a.c!=b.c)return a.c>b.c;
      	return a.x<b.x;
      }
      int main(){
      	ios::sync_with_stdio(0);
      	cin.tie(0);
      	cout.tie(0);
      	cin>>a>>b>>c;
      	for(int i=1;i<=a*2;i++){
      		cin>>d[i].c;
      		d[i].x=i;
      	}
      	for(int i=1;i<=a*2;i++){
      		cin>>d[i].s;
      	}
      	sort(d+1,d+1+a*2,cmp);
      	for(int i=1;i<=b;i++){
      		for(int j=1;j<=a*2;j+=2)
      			if(d[j].s>d[j+1].s)d[j].c++;
      			else d[j+1].c++;
      		stable_sort(d+1,d+1+a*2,cmp); 
      	}
      	cout<<d[c].x;
      	return 0;
      }
      
      • -2
        @ 2025-11-8 11:19:03
        #include <bits/stdc++.h>
        using namespace std;
        int q,n,r;
        struct jj{
        	int a,b,c;
        }a[200100],w[200100],x[200100];
        bool cmp(jj x,jj y){
        	return x.a>y.a||x.a==y.a&&x.c<y.c;
        }
        int main(){
        	cin>>n>>r>>q;
        	n*=2;
        	for(int i=1;i<=n;i++)cin>>a[i].a,a[i].c=i;
        	for(int i=1;i<=n;i++)cin>>a[i].b;
        	sort(a+1,a+n+1,cmp);
        	for(int i=1;i<=r;i++){
        		for(int j=1;j<=n/2;j++){
        			if(a[j*2-1].b>a[j*2].b){
        				a[j*2-1].a++;
        				w[j]=a[j*2-1];
        				x[j]=a[j*2];
        			}
        			else{
        				a[j*2].a++;
        				w[j]=a[j*2];
        				x[j]=a[j*2-1];
        			}
        		}
        		int k=1,l=1,t=1;
        		while(k<=n/2&&l<=n/2){
        			if(cmp(w[k],x[l]))
        			a[t++]=w[k++];
        			else
        			a[t++]=x[l++];
        		}
        		while(k<=n/2)a[t++]=w[k++];
        		while(l<=n/2)a[t++]=x[l++];
        	}
        	cout<<a[q].c;
            return 0;
        }
        
        • 1

        信息

        ID
        544
        时间
        1000ms
        内存
        256MiB
        难度
        8
        标签
        (无)
        递交数
        312
        已通过
        56
        上传者