답안 #92165

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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]);
         ~~~~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 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