Submission #1778946


Source Code Expand

#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <map>
#include <vector>
#include <unordered_map>

#define div 1000000000+7

using ll = long long;
using namespace std;

void solve() {
    int n;
    int max = 0, min = 1000000;
    vector<int> a;

    cin >> n;

    for(int i = 0; i < n; i++) {
        int x;
        cin >> x;
        a.push_back(x);
        if(max < a[i]){
            max = a[i];
        }
        if(min > a[i]){
            min = a[i];
        }
    }
    cout << max-min << endl;
}

int main() {
    solve();
    return 0;
}

Submission Info

Submission Time
Task B - Traveling AtCoDeer Problem
User hecatier
Language C++14 (GCC 5.4.1)
Score 200
Code Size 680 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 6
Set Name Test Cases
Sample s1.txt, s2.txt
All in1.txt, in2.txt, in3.txt, in4.txt, s1.txt, s2.txt
Case Name Status Exec Time Memory
in1.txt AC 1 ms 256 KB
in2.txt AC 1 ms 256 KB
in3.txt AC 1 ms 256 KB
in4.txt AC 1 ms 256 KB
s1.txt AC 1 ms 256 KB
s2.txt AC 1 ms 256 KB