답안 #776603

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
776603 2023-07-08T05:38:09 Z vjudge1 Pismo (COCI18_pismo) C++17
70 / 70
9 ms 1568 KB
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+37;

		
void f(){
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
}

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
 
//	f();
 
	
	int n; cin >> n;
	vector<int> a(n);

	for(auto &i: a) cin >> i;

	int ans=1e9;

	for(int i=1; i<n; i++){
		ans=min(abs(a[i]-a[i-1]), ans);
	}

	cout<<ans;
}

Compilation message

pismo.cpp: In function 'void f()':
pismo.cpp:7:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  freopen("in.txt", "r", stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
pismo.cpp:8:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  freopen("out.txt", "w", stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 8 ms 1492 KB Output is correct
6 Correct 9 ms 1568 KB Output is correct
7 Correct 8 ms 1492 KB Output is correct