Submission #16716247


Source Code Expand

// MOHIT KUMAR
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pin;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

#define ff(i, a, b) for ( ll i=a; i<(b); i++)
#define ffd(i, a, b) for ( ll i=a; i<= b; i++)
#define fr(i, a, b) for ( ll i = (b)-1; i >= a; i--)
#define ffr(i, a, b) for ( ll i = b ; i >= a; i--)
#define vl vector < ll >
#define vp vector < pl >
#define endl "\n"
#define sz(x) (ll)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const ld pi = acos(-1) ;
const ll maxn = 105 ;
const int mod = 1e9 + 7 ;
const ll INF = 1e18 ;
const int MX = 2000000001 ; // check the limits, dummy

int main() {
  ios_base::sync_with_stdio(0) , cin.tie(0);
  ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
  cin >> n ;
  vl v, vc ;
  ff(i, 0, n) {
    cin >> a >> b;
    v.pb(a + b) ;
    vc.pb(a - b) ;
  }
  sort(all(v)) ;
  sort(all(vc)) ;
  cout << max({v.back() - v[0], abs(vc.back() - vc[0]) } ) ;
}

Submission Info

Submission Time
Task E - Dist Max
User mkay6122
Language C++ (GCC 9.2.1)
Score 500
Code Size 1278 Byte
Status AC
Exec Time 71 ms
Memory 6692 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:41:6: warning: unused variable ‘t’ [-Wunused-variable]
   41 |   ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
      |      ^
./Main.cpp:41:9: warning: unused variable ‘q’ [-Wunused-variable]
   41 |   ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
      |         ^
./Main.cpp:41:21: warning: unused variable ‘c’ [-Wunused-variable]
   41 |   ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
      |                     ^
./Main.cpp:41:24: warning: unused variable ‘d’ [-Wunused-variable]
   41 |   ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
      |                        ^
./Main.cpp:41:27: warning: unused variable ‘k’ [-Wunused-variable]
   41 |   ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
      |                           ^
./Main.cpp:41:30: warning: unused variable ‘l’ [-Wunused-variable]
   41 |   ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
      |                              ^
./Main.cpp:41:33: warning: unused variable ‘m’ [-Wunused-variable]
   41 |   ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
      |                                 ^
./Main.cpp:41:36: warning: unused variable ‘r’ [-Wunused-variable]
   41 |   ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
      |                                    ^
./Main.cpp:41:40: warning: unused variable ‘x’ [-Wunused-variable]
   41 |   ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
      |                                        ^
./Main.cpp:41:47: warning: unused variable ‘y’ [-Wunused-variable]
   41 |   ll t, q, n, a, b, ...

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 18
Set Name Test Cases
Sample sample00, sample01
All handmade02, handmade03, handmade04, handmade05, handmade06, handmade07, handmade08, handmade09, random07, random08, random09, random10, random11, random12, random13, random14, sample00, sample01
Case Name Status Exec Time Memory
handmade02 AC 14 ms 3596 KiB
handmade03 AC 1 ms 3496 KiB
handmade04 AC 2 ms 3492 KiB
handmade05 AC 52 ms 6688 KiB
handmade06 AC 50 ms 6628 KiB
handmade07 AC 59 ms 6688 KiB
handmade08 AC 59 ms 6580 KiB
handmade09 AC 59 ms 6648 KiB
random07 AC 69 ms 6688 KiB
random08 AC 67 ms 6652 KiB
random09 AC 70 ms 6664 KiB
random10 AC 67 ms 6692 KiB
random11 AC 68 ms 6580 KiB
random12 AC 66 ms 6504 KiB
random13 AC 71 ms 6344 KiB
random14 AC 52 ms 5396 KiB
sample00 AC 2 ms 3504 KiB
sample01 AC 2 ms 3508 KiB