- P57's solution
-
题解P57
- @ 2025-10-24 18:23:08
按提议,即求出所有高度的最大值,可以直接使用max函数。
AC code:
#include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin >> x;
int maxhigh = 0;
for (int i = 1; i <= x; i++) {
int a;
cin >> a;
maxhigh = max(maxhigh, a);
}
cout << maxhigh << endl;
return 0;
}