2 条题解

  • 1
    @ 2023-1-21 16:14:19
    #include<bits/stdc++.h>
    using namespace std;
    int a[1000000],b[1000000],c[1000000];
    bool cmp(int x, int y){
    	return x > y;
    }
    int main()
    {
    	int n;
    	cin >> n;
    	for(int i = 1; i <= n; i++){
    		cin >> a[i];
    	}
    	int m;
    	cin >> m;
    	/*
    	80 50 50 30		成绩
    	1  2  3  4		下标
    	1  2  2  4		排名 
    	*/
    	sort(a+1,a+1+n,cmp);
    	for(int i = 1; i <= n; i++){
    		if(a[i] == m){
    			cout << i;
    			break;
    		}
    	}
    	return 0;
    }
    
    
    
    • -1
      @ 2023-2-5 14:35:16
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          cout << 6;
      	return 0;
      }
      
      • 1

      信息

      ID
      451
      时间
      1000ms
      内存
      32MiB
      难度
      1
      标签
      递交数
      33
      已通过
      28
      上传者