답안 #776968

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
776968 2023-07-08T12:37:34 Z blacktulip Pismo (COCI18_pismo) C++17
70 / 70
9 ms 1492 KB
#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;
}

Compilation message

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]);
      |      ~~~~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 312 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 9 ms 1492 KB Output is correct
6 Correct 9 ms 1484 KB Output is correct
7 Correct 8 ms 1492 KB Output is correct