제출 #776610

#제출 시각아이디문제언어결과실행 시간메모리
776610vjudge1Pismo (COCI18_pismo)C++17
70 / 70
11 ms596 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long lo; 

#define fi first
#define se second
#define endl "\n"
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo inf = 1000000000;
const lo li = 500005;
const lo mod = 1000000007;

int n,m,a[li],k,flag,t;
int cev;
string s;
vector<int> v;

int main(void){
	scanf("%d",&n);
	FOR scanf("%d",&a[i]);
	cev=abs(a[2]-a[1]);
	for(int i=3;i<=n;i++){
		cev=min(cev,abs(a[i]-a[i-1]));
	}
	printf("%d\n",cev);
	return 0;
}

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

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