Submission #199797

# Submission time Handle Problem Language Result Execution time Memory
199797 2020-02-03T12:59:38 Z MohamedAhmed04 Pismo (COCI18_pismo) C++14
70 / 70
24 ms 1656 KB
#include <bits/stdc++.h>

using namespace std ;

const int MAX = 1e5 + 10 ;

int n ;
int arr[MAX] ;

int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	cin>>n ;
	for(int i = 0 ; i < n ; ++i)
		cin>>arr[i] ;
	int ans = 1e9 ;
	for(int i = 0 ; i < n-1 ; ++i)
		ans = min(ans , abs(arr[i] - arr[i+1])) ;
	return cout<<ans<<"\n" , 0 ;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 380 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 24 ms 1632 KB Output is correct
6 Correct 20 ms 1656 KB Output is correct
7 Correct 20 ms 1528 KB Output is correct