# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
295374 | Saboon | Highway Tolls (IOI18_highway) | C++17 | 155 ms | 14108 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 "highway.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 90000 + 10;
int n;
ll Cost = 0, Step, MinP;
vector<int> Q;
vector<int> g[maxn];
int A, B;
bool isOdd(ll Cost, ll Now, int sub){
if (sub <= 4){
ll T = abs(Now-Cost);
return (T/Step)&1;
}
if (sub == 5)
return (Now&1);
for (int a = 0; 1LL*a*A <= Now and a < B; a += 2)
if ((Now-1LL*a*A)%B == 0 and a + (Now-1LL*a*A)/B >= MinP)
return false;
return true;
}
int find(vector<int> S, int sub){
assert((int)S.size() > 0);
int n = S.size();
int lo = -1, hi = n;
while (hi - lo > 1){
int mid = (lo+hi) >> 1;
Compilation message (stderr)
# | 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... |