# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
976039 | vjudge1 | Fountain (eJOI20_fountain) | C++17 | 353 ms | 39784 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 int long long
#define fi first
#define se second
#define pb push_back
pair<int,int>a[100005];
vector<pair<int,int>>que[100005];
vector<int>adj[100005];
int ans[200005];
vector<int>nodes;
vector<int>pref;
int n, q;
void dfs(int node){
//cout << "here >> " << node << endl;
nodes.pb(node);
if(node == n + 1)pref.pb(0);
else pref.pb(pref.back() + a[node].se);
for(auto it : que[node]){
int l = 1, r = pref.size() - 1, ret = -1;
while(l <= r){
int mid = (l+r)/2;
if(pref[pref.size()-1] - pref[mid-1] >= it.fi){
ret = mid;
l = mid + 1;
}
else{
r = mid - 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... |