mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-08 02:13:51 +08:00
归类了 OJ,整理了一下
This commit is contained in:
31
XSM OJ 重庆小码王集团OJ/小码君的实验室5.cpp
Normal file
31
XSM OJ 重庆小码王集团OJ/小码君的实验室5.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <stack>
|
||||
#include <ctime>
|
||||
#include <cmath>
|
||||
#include <queue>
|
||||
typedef long long l;
|
||||
typedef double d;
|
||||
typedef char c;
|
||||
using namespace std;
|
||||
int n;
|
||||
int x,t,res=-9999999;
|
||||
int arr;
|
||||
int main(){
|
||||
cin.tie(NULL);
|
||||
cout.tie(NULL);
|
||||
cin >>n;
|
||||
for(int i=1;i<=n;i++){
|
||||
cin >>arr;
|
||||
if(i==1){
|
||||
t=arr;
|
||||
}
|
||||
res=max(arr-t,res);
|
||||
t=min(t,arr);
|
||||
}
|
||||
cout <<res;
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user