CSES - Putka Open 2015 – 1/6 - Results
Submission details
Task:Jakkara
Sender:
Submission time:2015-07-18 21:34:50 +0300
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:15:32: error: 'sort' was not declared in this scope
     sort(lol.begin(), lol.end());
                                ^

Code

#include <iostream>
#include <vector>
#define F first
#define S second
using namespace std;
typedef long long ll;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    vector<int> lol(4);
    for (int i=0;i<4;i++){
        cin>>lol[i];
    }
    sort(lol.begin(), lol.end());
    ll v=0;
    for (int i=0;i<4;i++){
        v+=(ll)llabs(lol[i]-lol[1]);
    }
    cout<<v<<endl;
}