# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1632 | gs13057 | 최댓값 (tutorial2) | C++98 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
#include<assert.h>
#include<malloc.h>
int GetMax(int N,int *A);
int main(void){
int i,tmp;
int N;
tmp=scanf("%d", &N);
assert(tmp==1);
int *A=(int*)malloc(sizeof(int)*N);
for(i=0;i<N;i++){
tmp=scanf("%d",&A[i]);
assert(tmp == 1); }
printf("%d\n", GetMax(N, A));
return 0;
}
int GetMax(int N,int *A){
int res=0;
for(int i=0;i<N;i++) if(A[i]>res) res=A[i];
return res;
}