Submission #120794

# Submission time Handle Problem Language Result Execution time Memory
120794 2019-06-25T13:48:00 Z cvele Pismo (COCI18_pismo) C++14
70 / 70
43 ms 1656 KB
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <iomanip>
#include <bitset>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>

using namespace std;

int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int here = 2e9;
  for (int i = 1; i < n; i++) {
    here = min(here, abs(arr[i] - arr[i - 1]));
  }
  cout << here << endl;
  return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 40 ms 1592 KB Output is correct
6 Correct 43 ms 1656 KB Output is correct
7 Correct 40 ms 1560 KB Output is correct