Submission #562121

#TimeUsernameProblemLanguageResultExecution timeMemory
562121AGEPismo (COCI18_pismo)C++14
70 / 70
36 ms1004 KiB
#include<bits/stdc++.h> #define F first #define S second #define pb push_back #define int long long using namespace std; const int N=1e6,M=2e3,mod=1e9+7; int a[N]; main() { int n; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; int ans=1e18; for(int i=0;i<n-1;i++){ ans=min(ans,abs(a[i+1]-a[i])); } cout<<ans<<endl; return 0; }

Compilation message (stderr)

pismo.cpp:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    9 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...