Submission #99377

#TimeUsernameProblemLanguageResultExecution timeMemory
99377kimcodingPismo (COCI18_pismo)C++17
70 / 70
18 ms1280 KiB
#include <cstdio> #include <cmath> #define min(a,b) (a<b?a:b) int n, pre, ans = 2e9; int main() { scanf("%d", &n); for(int i=1,now;i<=n;i++){ scanf("%d", &now); if (i != 1) ans = min(ans, abs(now - pre)); pre = now; } printf("%d\n", ans); return 0; }

Compilation message (stderr)

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