# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
776610 | 2023-07-08T05:44:49 Z | vjudge1 | Pismo (COCI18_pismo) | C++17 | 11 ms | 596 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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 8 ms | 596 KB | Output is correct |
6 | Correct | 11 ms | 564 KB | Output is correct |
7 | Correct | 9 ms | 596 KB | Output is correct |