#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int score, others[N-1];
cin >> score;
for(int i = 0; i < N - 1; i++) {
cin >> others[i];
}
sort(others, others + N - 1, greater<int>());
cout << (score > others[4] ? "Top 5" : (score == others[4] ? "Maybe Top 5" : (score >= others[9] ? "Top 10" : "Thank You")));
return 0;
}
#include using namespace std; int main() { int N; cin >> N; int score, others[N-1]; cin >> score; for(int i = 0; i < N - 1; i++) { cin >> others[i]; } sort(others, others + N - 1, greater()); cout << (score > others[4] ? "Top 5" : (score == others[4] ? "Maybe Top 5" : (score >= others[9] ? "Top 10" : "Thank You"))); return 0; }
回覆標題,對於後 60% 測資的確可能一到五名成績一樣
例如:
[90] 90 90 90 90 90 0 0 0 0 0 那麼 a0 = 90 就是 Maybe Top5
[90] 90 90 90 90 0 0 0 0 0 0 那麼 a0 = 90 就是 Top5