Submission #92165

# Submission time Handle Problem Language Result Execution time Memory
92165 2019-01-01T19:22:46 Z Kastanda Pismo (COCI18_pismo) C++11
70 / 70
16 ms 760 KB
#include<bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, Mn = INT_MAX, A[N];
int main()
{
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
        scanf("%d", &A[i]);
    for (int i = 2; i <= n; i++)
        Mn = min(Mn, max(A[i], A[i - 1]) - min(A[i], A[i - 1]));
    return !printf("%d\n", Mn);
}

Compilation message

pismo.cpp: In function 'int main()':
pismo.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
pismo.cpp:9:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &A[i]);
         ~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 16 ms 632 KB Output is correct
6 Correct 16 ms 760 KB Output is correct
7 Correct 16 ms 632 KB Output is correct