# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
560741 | amunduzbaev | Cultivation (JOI17_cultivation) | C++17 | 2068 ms | 1492 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
using namespace std;
#define ar array
#define int long long
signed main(){
ios::sync_with_stdio(0); cin.tie(0);
int R, C; cin>>R>>C;
int n; cin>>n;
vector<int> x(n), y(n);
for(int i=0;i<n;i++){
cin>>x[i]>>y[i];
}
int mn_pos = -1;
{
auto check = [&](int m){
vector<ar<int, 2>> s(n);
for(int i=0;i<n;i++) s[i] = {x[i], x[i] + m - 1};
sort(s.begin(), s.end());
int l = -1, r = -1, mx = 0;
for(auto x : s){
if(r + 1 < x[0]){
mx = max(mx, r - l + 1);
l = x[0], r = x[1];
} else {
r = max(r, x[1]);
}
# | 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... |