# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
97451 |
2019-02-16T09:30:20 Z |
KLPP |
Pismo (COCI18_pismo) |
C++14 |
|
68 ms |
1912 KB |
#include<bits/stdc++.h>
using namespace std;
typedef long long int lld;
lld absol(lld x){
if(x>0)return x;
return -x;
}
int main(){
int n;
cin>>n;
lld arr[n];
for(int i=0;i<n;i++)cin>>arr[i];
lld ans=20000000000;
for(int i=0;i<n-1;i++)ans=min(ans,absol(arr[i]-arr[i+1]));
cout<<ans<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
384 KB |
Output is correct |
2 |
Correct |
3 ms |
256 KB |
Output is correct |
3 |
Correct |
3 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
47 ms |
1884 KB |
Output is correct |
6 |
Correct |
68 ms |
1912 KB |
Output is correct |
7 |
Correct |
48 ms |
1884 KB |
Output is correct |