1 条题解

  • 0
    @ 2025-1-12 18:23:31
    #include <bits/stdc++.h>
    using namespace std;
    
    int main() {
    	int score, n;
    	cin >> score >> n;
    	
    	vector<int> scores(n - 1);
    	for (int i = 0; i < n - 1; ++i) {
    		cin >> scores[i];
    	}
    	
    	scores.push_back(score);
    	sort(scores.begin(), scores.end(), greater<int>());
    	
    	int rank = find(scores.begin(), scores.end(), score) - scores.begin() + 1;
    	
    	if (rank <= n * 0.1) {
    		cout << "A" << endl;
    	} else if (rank <= n * 0.3) {
    		cout << "B" << endl;
    	} else if (rank <= n * 0.6) {
    		cout << "C" << endl;
    	} else if (rank <= n * 0.8) {
    		cout << "D" << endl;
    	} else {
    		cout << "E" << endl;
    	}
    	
    	return 0;
    }
    
    
    • 1

    信息

    ID
    99
    时间
    1000ms
    内存
    64MiB
    难度
    9
    标签
    递交数
    10
    已通过
    10
    上传者