답안 #407417

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
407417 2021-05-18T23:04:40 Z 534351 Izvanzemaljci (COI21_izvanzemaljci) C++17
5 / 100
29 ms 3860 KB
#include <bits/stdc++.h>

using namespace std;

template<class T, class U>
void ckmin(T &a, U b)
{
    if (a > b) a = b;
}

template<class T, class U>
void ckmax(T &a, U b)
{
    if (a < b) a = b;
}

#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--)
#define SZ(x) ((int) (x).size())
#define ALL(x) (x).begin(), (x).end()

const int MAXN = 100013;
const long long LLINF = 3e18;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

int N, K;
pll arr[MAXN];

int32_t main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    cout << fixed << setprecision(12);
    cerr << fixed << setprecision(4);
    cin >> N >> K;
    FOR(i, 0, N)
    {
        cin >> arr[i].fi >> arr[i].se;
    }
    if (K == 1)
    {
        ll mnx = LLINF, mxx = -LLINF, mny = LLINF, mxy = -LLINF;
        FOR(i, 0, N)
        {
            ckmin(mnx, arr[i].fi);
            ckmax(mxx, arr[i].fi);
            ckmin(mny, arr[i].se);
            ckmax(mxy, arr[i].se);
        }
        cout << mnx << ' ' << mny << ' ' << max(1ll, max(mxx - mnx, mxy - mny)) << '\n';
        return 0;
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 328 KB Output is correct
4 Correct 1 ms 324 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 28 ms 3848 KB Output is correct
8 Correct 28 ms 3804 KB Output is correct
9 Correct 29 ms 3776 KB Output is correct
10 Correct 28 ms 3860 KB Output is correct
11 Correct 28 ms 3816 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -