Submission #19303973


Source Code Expand

Copy
//void __(){
//    _(int,n);
//    _(vi,a,n);
//    sort(all(a));
//    int lo = a[0];
//    int hi = a.back();
//    rep(i,n-1)
//        if(min(a[i],hi-a[i]) > min(lo,hi-lo))
//            lo = a[i];
//    print hi,lo;
//}
//
//
#include <iomanip>
#include <algorithm>
#include <cassert>
#include <vector>
#include <utility>
#include <iostream>
#include <string>
#define REP_ZERO_INT(i,r) for(int i = 0; i < (r); ++i)
#define GET_REP_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define rep(...) GET_REP_MACRO(__VA_ARGS__,REP_ANY,REP_INT,REP_ZERO_INT)(__VA_ARGS__)
#define all(v) (v).begin(), (v).end()
#define sz(v) ll(v.size())
#define T1 template<typename T> static
using namespace std;
typedef long long ll;
typedef vector<int> vi;
T1 ostream& operator<<(ostream& stream, const vector<T>& t);
T1 istream& read(T, T, istream& = cin);
T1 istream& operator>>(istream& stream, vector<T>& t){
    return read(all(t), stream);
}
T1 istream& read(T b, T e, istream& stream){
    for(T it = b; it != e; ++it)
        stream >> *it;
    return stream;
}
struct _print {
    string sep,end;
    bool space;
    ostream &stream;
    _print(string _sep=" ",string _end="\n",
            ostream &_stream = cout) 
        : sep(_sep),end(_end),space(false),
            stream(_stream) {}
    ~_print() { stream << end; }

    template <typename T>
        _print &operator , (const T &t) {
            if (space) stream << sep;
            space = true;
            stream << t;
            return *this;
        }
};
#define print _print(),
#define INPUT_WITHOUT_INIT(type,name) type name; cin >> name
#define _IWI(type,name,...) type name(__VA_ARGS__); cin >> name
#define GET_INPUT_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define _(...) GET_INPUT_MACRO(__VA_ARGS__,_IWI,_IWI,_IWI,_IWI,_IWI,_IWI,INPUT_WITHOUT_INIT)(__VA_ARGS__)
void __(){
    _(int,n);
    _(vi,a,n);
    sort(all(a));
    int lo = a[0];
    int hi = a.back();
    rep(i,n-1)
        if(min(a[i],hi-a[i]) > min(lo,hi-lo))
            lo = a[i];
    print hi,lo;
}


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
        __();
}

Submission Info

Submission Time
Task D - Binomial Coefficients
User Andres_Unt
Language C++ (GCC 9.2.1)
Score 400
Code Size 2233 Byte
Status AC
Exec Time 30 ms
Memory 3656 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 2
AC × 17
Set Name Test Cases
Sample sample1.txt, sample2.txt
All even0.txt, even1.txt, float.txt, odd0.txt, odd1.txt, rnd_0.txt, rnd_1.txt, rnd_2.txt, rnd_3.txt, rnd_4.txt, rnd_5.txt, rnd_6.txt, rnd_7.txt, rnd_8.txt, rnd_9.txt, sample1.txt, sample2.txt
Case Name Status Exec Time Memory
even0.txt AC 30 ms 3612 KB
even1.txt AC 27 ms 3656 KB
float.txt AC 27 ms 3564 KB
odd0.txt AC 21 ms 3656 KB
odd1.txt AC 27 ms 3548 KB
rnd_0.txt AC 23 ms 3504 KB
rnd_1.txt AC 27 ms 3556 KB
rnd_2.txt AC 22 ms 3552 KB
rnd_3.txt AC 19 ms 3600 KB
rnd_4.txt AC 19 ms 3424 KB
rnd_5.txt AC 22 ms 3616 KB
rnd_6.txt AC 26 ms 3436 KB
rnd_7.txt AC 20 ms 3596 KB
rnd_8.txt AC 20 ms 3432 KB
rnd_9.txt AC 19 ms 3552 KB
sample1.txt AC 5 ms 3548 KB
sample2.txt AC 2 ms 3476 KB