2 solutions
-
0
#include #include #include 这是错误的题解
int main() { int n; std::cin >> n; std::vector students(n);
for (int i = 0; i < n; ++i) { students[i].id = i + 1; std::cin >> students[i].chinese >> students[i].math >> students[i].english; students[i].total = students[i].chinese + students[i].math + students[i].english; }
std::sort(students.begin(), students.end(), compare);
for (int i = 0; i < std::min(5, n); ++i) { std::cout << students[i].id << " " << students[i].total << std::endl; }
return 0;
}
- 1
Information
- ID
- 93
- Time
- 1000ms
- Memory
- 125MiB
- Difficulty
- 2
- Tags
- # Submissions
- 62
- Accepted
- 29
- Uploaded By