# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1007867 | PotatoMan | Overtaking (IOI23_overtaking) | C++17 | 1071 ms | 111188 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 "overtaking.h"
#include <bits/stdc++.h>
#define ll long long
#define inf INT_MAX
using namespace std;
vector<ll> s;
vector<pair<ll,ll>> p;
ll l,n,x,m;
vector<vector<pair<pair<ll,ll>,int>>> ps(1005);
vector<vector<ll>> start(1005);
vector<pair<pair<ll,ll>,int>> cur;
ll pos = 0;
pair<ll,ll> pref[1005][1005];
ll dp[1005][1005];
ll h[1005][1005];
ll f(int xx,int y,ll hh){
//cout<<"!"<<xx<<" "<<y<<" "<<hh<<"\n";
if( y == m-1 ) return dp[xx][y] = hh;
if( dp[xx][y] != 0 ) return dp[xx][y];
int foo = lower_bound(start[y+1].begin(),start[y+1].end(),hh) - start[y+1].begin();
int l = y+1,r = m;
int res = inf;
while( l <= r ){
int tm = (l+r)/2;
ll vh = hh+(s[tm-1]-s[y])*x;
int vm = lower_bound(start[tm].begin(),start[tm].end(),vh) - start[tm].begin();
//cout<<"? "<<tm<<" "<<vh<<" "<<vm<<" "<<foo<<"\n";
if( vm < foo ){
# | 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... |