結果
問題 | No.1998 Manhattan Restaurant |
ユーザー | MasKoaTS |
提出日時 | 2022-06-24 16:41:53 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,585 bytes |
コンパイル時間 | 4,765 ms |
コンパイル使用メモリ | 264,436 KB |
実行使用メモリ | 8,832 KB |
最終ジャッジ日時 | 2024-11-08 10:53:27 |
合計ジャッジ時間 | 7,367 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | WA | - |
testcase_03 | AC | 2 ms
5,248 KB |
testcase_04 | WA | - |
testcase_05 | AC | 2 ms
5,248 KB |
testcase_06 | AC | 2 ms
5,248 KB |
testcase_07 | AC | 2 ms
5,248 KB |
testcase_08 | AC | 2 ms
5,248 KB |
testcase_09 | AC | 3 ms
5,248 KB |
testcase_10 | AC | 2 ms
5,248 KB |
testcase_11 | AC | 2 ms
5,248 KB |
testcase_12 | AC | 2 ms
5,248 KB |
testcase_13 | AC | 2 ms
5,248 KB |
testcase_14 | AC | 3 ms
5,248 KB |
testcase_15 | AC | 84 ms
8,704 KB |
testcase_16 | AC | 40 ms
6,272 KB |
testcase_17 | AC | 54 ms
7,424 KB |
testcase_18 | AC | 41 ms
6,400 KB |
testcase_19 | AC | 46 ms
6,784 KB |
testcase_20 | AC | 83 ms
8,832 KB |
testcase_21 | AC | 94 ms
8,832 KB |
testcase_22 | AC | 95 ms
8,832 KB |
testcase_23 | AC | 95 ms
8,832 KB |
testcase_24 | AC | 95 ms
8,832 KB |
testcase_25 | AC | 6 ms
5,248 KB |
testcase_26 | AC | 44 ms
6,528 KB |
testcase_27 | AC | 31 ms
5,504 KB |
testcase_28 | AC | 45 ms
6,656 KB |
testcase_29 | AC | 31 ms
5,504 KB |
testcase_30 | AC | 64 ms
8,192 KB |
testcase_31 | AC | 60 ms
7,808 KB |
testcase_32 | AC | 9 ms
5,248 KB |
testcase_33 | AC | 40 ms
6,144 KB |
testcase_34 | AC | 47 ms
7,040 KB |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:70:21: warning: integer overflow in expression of type 'int' results in '2' [-Woverflow] 70 | ll a = -inf * 2, b = -inf * 2; | ~~~~~^~~ main.cpp:70:35: warning: integer overflow in expression of type 'int' results in '2' [-Woverflow] 70 | ll a = -inf * 2, b = -inf * 2; | ~~~~~^~~
ソースコード
#include <math.h> #include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define print(n) cout << (n) << endl #define fprint(n) cout << setprecision(16) << (n) << endl #define ceil_div(a, b) (((a) - 1) / (b) + 1) #define rep(i, l, n) for (int i = (l); i < (n); i++) #define itrep(itr, st) for (auto itr = st.begin(); itr != st.end(); itr++) #define ite(i, a) for (auto& i : a) #define all(x) x.begin(), x.end() #define lb(A, x) (lower_bound(all(A), x) - A.begin()) #define ub(A, x) (upper_bound(all(A), x) - A.begin()) using str = string; using ll = long long; using u32 = unsigned int; using u64 = unsigned long long; using Pair = pair<int, int>; using mint = modint1000000007; using Mint = modint998244353; template <class T> using V = vector<T>; template <class T> using VV = V<V<T> >; template <class T> using PQ = priority_queue<T, V<T>, greater<T> >; template <class T> using PQR = priority_queue<T>; template <class T> using BIT = fenwick_tree<T>; const ll INF = 4611686018427387903; const int inf = 2147483647; const ll mod = 1000000007; const ll MOD = 998244353; template <class T> inline V<T> getList(int n) { V<T> res(n); rep(i, 0, n) { cin >> res[i]; }return res; } template <class T> inline VV<T> getGrid(int m, int n) { VV<T> res(m, V<T>(n)); rep(i, 0, m) { res[i] = getList<T>(n); }return res; } template <class T> inline void prints(V<T>& vec) { if (vec.size() == 0)return; cout << vec[0]; rep(i, 1, vec.size()) { cout << ' ' << vec[i]; } cout << '\n'; } inline V<int> dtois(string& s) { V<int> vec = {}; ite(e, s) { vec.push_back(e - '0'); } return vec; } inline V<int> atois(string& s) { V<int> vec = {}; ite(e, s) { vec.push_back(e - 'a'); } return vec; } inline V<int> Atois(string& s) { V<int> vec = {}; ite(e, s) { vec.push_back(e - 'A'); } return vec; } inline void chmax(ll& a, ll b) { if (a >= b) { return; } a = b; } inline void chmin(ll& a, ll b) { if (a <= b) { return; } a = b; } int main(void) { int n; cin >> n; VV<ll> house(n, V<ll>(2)); rep(i, 0, n) { ll x, y; cin >> x >> y; house[i] = { x + y,x - y }; } ll x_max = -inf, y_max = -inf; ll x_min = inf, y_min = inf; rep(i, 0, n) { chmax(x_max, house[i][0]); chmax(y_max, house[i][1]); chmin(x_min, house[i][0]); chmin(y_min, house[i][1]); } ll a = -inf * 2, b = -inf * 2; rep(i, 0, n) { ll x = house[i][0], y = house[i][1]; chmax(a, min(max(x_max - x, y_max - y), max(x - x_min, y - y_min))); chmax(b, min(max(x_max - x, y - y_min), max(x - x_min, y_max - y))); } ll ans = min(a, b) / 2; print(ans); return 0; }