Created
September 26, 2023 23:37
-
-
Save estelabn/cc8b58b221100e00df6d44ff85b05f22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
int N; cin >> N; | |
int anterior = 0; | |
int menorDif = 1e9; | |
for(int i=0; i<N; i++){ | |
int A; cin >> A; | |
if(i != 0) { | |
if((A-anterior) < menorDif) menorDif = (A-anterior); | |
} | |
anterior = A; | |
} | |
cout << menorDif << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment