【BZOJ】【P1307&P1318】【题解】【max_element】

传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1307 http://www.lydsy.com/JudgeOnline/problem.php?id=1318

抱着试一试的心态……

A了……

Code:

#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+5;
int n;
int getint(){
	int res=0;char c=getchar();
	while(!isdigit(c))c=getchar();
	while(isdigit(c))res=res*10+c-'0',c=getchar();
	return res;
}
int a[maxn];
int main(){
	n=getint();for(int i=1;i<=n;i++)a[i]=getint();
	cout<<*max_element(a+1,a+1+n)<<endl;
	return 0;
}


你可能感兴趣的:(bzoj)