이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long un;
typedef vector<un> vuc;
typedef pair<un, un> pun;
#define REP(i, a, b) for (un i = (un)a; i < (un)b; i++)
#define REPR(i, a, b) for (un i = ((un)b)-1; i >= (un)a; i--)
#define FEAC(i, a) for (auto&& i : a)
#define vec vector
#define ALL(x) (x).begin(), (x).end()
#define DEB(x) cerr << #x << " = " << (x) << endl;
constexpr un INF = INT64_MAX;
int main(){
un N, M;
cin >> N >> M;
un x_min, x_max, y_min, y_max;
x_min = INF;
y_min = INF;
x_max = 0;
y_max = 0;
REP(i, 0, N){
un x, y;
cin >> x >> y;
x_min = min(x_min, x);
y_min = min(y_min, y);
x_max = max(x_max, x);
y_max = max(y_max, y);
}
un y_delta = y_max - y_min;
un x_delta = x_max - x_min;
if (y_delta % 2 == 1){
cout << x_min << endl;
return 0;
}
if (x_delta % 2 == 1){
cout << x_max-1 << endl;
return 0;
}
cout << x_max << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |