Submission #68627145
Source Code Expand
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define endl '\n'
#define pb push_back
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int ll
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ii = pair<int,int>;
using iii = tuple<int,int,int>;
const int inf = 2e9+1;
const int mod = (119<<23)+1;
const int maxn = 3e5+100;
template<typename X, typename Y> bool ckmin(X& x, const Y& y) { return (y < x) ? (x=y,1):0; }
template<typename X, typename Y> bool ckmax(X& x, const Y& y) { return (x < y) ? (x=y,1):0; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l, int r) {
uniform_int_distribution<int> uid(l, r);
return uid(rng);
}
void solve() {
int n; cin >> n;
vector<int> a(n), b(n);
for (int i = 0; i < n; ++i) cin >> a[i] >> b[i];
int ans = 0;
for (int __ = 0; __ < 2; ++__) {
sort(all(a));
ckmax(ans, (a.back()-a[0]+1)/2);
swap(a, b);
}
cout << ans << endl;
}
int32_t main() {_
#ifndef gato
int t = 1; //cin >> t;
while(t--) solve();
#else
int t = 1;
while (true) {
int my = solve(), ans = brute();
if (my != ans) {
cout << "Wrong answer on test " << t << endl;
cout << "Your output: " << my << endl;
cout << "Answer: " << ans << endl;
exit(0);
}
cout << "Accepted on test " << t++ << endl;
}
#endif
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - King's Summit |
| User | perchuts |
| Language | C++ 20 (gcc 12.2) |
| Score | 300 |
| Code Size | 1570 Byte |
| Status | AC |
| Exec Time | 46 ms |
| Memory | 6368 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| 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 | 3440 KiB |
| sample01.txt | AC | 1 ms | 3440 KiB |
| sample02.txt | AC | 1 ms | 3440 KiB |
| testcase00.txt | AC | 1 ms | 3520 KiB |
| testcase01.txt | AC | 1 ms | 3472 KiB |
| testcase02.txt | AC | 1 ms | 3476 KiB |
| testcase03.txt | AC | 30 ms | 5216 KiB |
| testcase04.txt | AC | 46 ms | 6192 KiB |
| testcase05.txt | AC | 8 ms | 4212 KiB |
| testcase06.txt | AC | 24 ms | 6148 KiB |
| testcase07.txt | AC | 33 ms | 5712 KiB |
| testcase08.txt | AC | 41 ms | 6240 KiB |
| testcase09.txt | AC | 8 ms | 3572 KiB |
| testcase10.txt | AC | 42 ms | 6368 KiB |
| testcase11.txt | AC | 44 ms | 6240 KiB |
| testcase12.txt | AC | 25 ms | 5000 KiB |
| testcase13.txt | AC | 14 ms | 4188 KiB |
| testcase14.txt | AC | 1 ms | 3496 KiB |
| testcase15.txt | AC | 3 ms | 3576 KiB |
| testcase16.txt | AC | 19 ms | 4392 KiB |
| testcase17.txt | AC | 46 ms | 6260 KiB |
| testcase18.txt | AC | 45 ms | 6212 KiB |
| testcase19.txt | AC | 46 ms | 6304 KiB |
| testcase20.txt | AC | 46 ms | 6212 KiB |
| testcase21.txt | AC | 45 ms | 6320 KiB |
| testcase22.txt | AC | 45 ms | 6268 KiB |