제출 #95337

#제출 시각아이디문제언어결과실행 시간메모리
95337mzhaoPismo (COCI18_pismo)C++11
70 / 70
16 ms760 KiB
#include <bits/stdc++.h>
using namespace std;

int N, A[100100], ans = 2e9;

int main() {
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d", &A[i]);
	}
	for (int i = 1; i < N; i++) ans = min(ans, abs(A[i]-A[i-1]));
	printf("%d\n", ans);
}

컴파일 시 표준 에러 (stderr) 메시지

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