Submission #68536712


Source Code Expand

#include <bits/stdc++.h>
#include <stdlib.h>
#include <time.h> 
 
using namespace std;
double EPS = 1e-12;
typedef long long int lld;
typedef pair<lld,lld> PA;
long double tick(){static clock_t oldt; clock_t newt=clock();
    long double diff=1.0L*(newt-oldt)/CLOCKS_PER_SEC; oldt = newt; return diff; }
#define rep(i,a,n) for(long long int i = (a); i <= (n); ++i)
#define repI(i,a,n) for(int i = (a); i <= (n); ++i)
#define repD(i,a,n) for(long long int i = (a); i >= (n); --i)
#define repDI(i,a,n) for(int i = (a); i >= (n); --i)
#define all(c) (c).begin(), (c).end()
#define sz(a) ((int)a.size())
#ifdef LOCAL_RUN
#define Error(x...) { cout << "(" << #x << ")" << " = ( "; printIt(x); }
#else
#define Error(x...) 42
#endif
template <typename T1> void printIt(T1 t1) { cout << t1 << " )" << endl; }
template <typename T1, typename... T2>
void printIt(T1 t1, T2... t2) { cout << t1 << " , "; printIt(t2...); }
// Ab :)
#define popcount __builtin_popcountll


#define lim 300010
#define lim2 200010


lld A[lim];


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    lld mxX, mxY, mnX, mnY;
    mxX = mxY = -1e18;
    mnX = mnY = 1e18;
    while(n--){
        lld x, y;
        cin >> x >> y;
        mxX = max(mxX, x);
        mxY = max(mxY, y);
        mnX = min(mnX, x);
        mnY = min(mnY, y);
    }
    lld ans = max(mxX - mnX, mxY - mnY);
    cout << (ans + 1) / 2 << endl;
    return 0;
}

Submission Info

Submission Time
Task C - King's Summit
User abhishek_saini
Language C++ 20 (gcc 12.2)
Score 300
Code Size 1496 Byte
Status AC
Exec Time 22 ms
Memory 3564 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 26
Set Name Test Cases
Sample sample00.txt, sample01.txt, sample02.txt
All sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt, testcase20.txt, testcase21.txt, testcase22.txt
Case Name Status Exec Time Memory
sample00.txt AC 1 ms 3480 KiB
sample01.txt AC 1 ms 3472 KiB
sample02.txt AC 1 ms 3356 KiB
testcase00.txt AC 1 ms 3420 KiB
testcase01.txt AC 1 ms 3420 KiB
testcase02.txt AC 1 ms 3400 KiB
testcase03.txt AC 14 ms 3464 KiB
testcase04.txt AC 21 ms 3364 KiB
testcase05.txt AC 7 ms 3424 KiB
testcase06.txt AC 21 ms 3424 KiB
testcase07.txt AC 17 ms 3564 KiB
testcase08.txt AC 21 ms 3488 KiB
testcase09.txt AC 5 ms 3484 KiB
testcase10.txt AC 20 ms 3472 KiB
testcase11.txt AC 22 ms 3480 KiB
testcase12.txt AC 12 ms 3536 KiB
testcase13.txt AC 7 ms 3484 KiB
testcase14.txt AC 1 ms 3480 KiB
testcase15.txt AC 2 ms 3416 KiB
testcase16.txt AC 9 ms 3400 KiB
testcase17.txt AC 21 ms 3400 KiB
testcase18.txt AC 21 ms 3400 KiB
testcase19.txt AC 21 ms 3532 KiB
testcase20.txt AC 22 ms 3432 KiB
testcase21.txt AC 21 ms 3400 KiB
testcase22.txt AC 21 ms 3420 KiB