# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
673345 | Quan2003 | Harbingers (CEOI09_harbingers) | C++17 | 112 ms | 21292 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;
typedef long long ll;
const int sz=1e5+10;
const int mod = 1e9 + 7;
typedef pair<long long,long long>info;
int n,k,m,q,dis,lim;
ll timer=1;
long long d[sz];
long long dp[sz];
vector<pair<long long,long long>>adj[sz];
pair<long long,long long>lines[sz];
vector<pair<info,info>>lst;
struct harbinger{
long long s,v;
}a[sz];
long long query(long long x){
int l = 0; int r = lim - 1;
long long ans = lines[0].first*x + lines[0].second;
while(l <= r){
int mid = (l + r)>>1;
long long lval = lines[mid].first*x + lines[mid].second;
long long rval = lines[mid + 1].first*x + lines[mid + 1].second;
if(lval > rval) l = mid +1;
else r = mid - 1;
ans = min(ans,min(lval,rval));
}
return ans;
}
bool check(info &a,info &b,info &c){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |