Submission #342555

#TimeUsernameProblemLanguageResultExecution timeMemory
342555HazemPismo (COCI18_pismo)C++14
70 / 70
15 ms1900 KiB
/* ID: tmhazem1 LANG: C++14 TASK: pprime */ #include <bits/stdc++.h> using namespace std; #define S second #define F first #define LL long long const int N = 2e5+10; LL LINF = 100000000000000000; LL INF = 1000000000; int MOD = 1e9+7; LL a[N]; int main() { // freopen("out.txt","w",stdout); int n; scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%lld",&a[i]); LL ans = LINF; for(int i=1;i<n;i++) ans = min(ans,abs(a[i]-a[i+1])); printf("%lld\n",ans); }

Compilation message (stderr)

pismo.cpp: In function 'int main()':
pismo.cpp:27:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   27 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
pismo.cpp:30:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   30 |         scanf("%lld",&a[i]);
      |         ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...