이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "highway.h"
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
const int maxn=9e4+5;
int n,m,a,b;
vector<int>u,v;
vector<pair<int,int>>adj[maxn];
vector<int>par(maxn,0),dep(maxn,0),edge(maxn,0),w;
vector<bool>used(maxn);
void dfs(int x,int p){
par[x]=p;
for(auto [y,e]:adj[x]){
if(y!=p){
dep[y]=dep[x]+1;
edge[y]=e;
dfs(y,x);
}
}
}
void find_pair(int N,vector<int>U,vector<int>V,int A, int B){
n=N,u=U,v=V,a=A,b=B;
m=u.size();
w.resize(m);
fill(all(w),0);
ll C=ask(w);
int d=C/A;
int l=0,r=n-1-d;
while(l<r){
int mid=(l+r)/2;
fill(all(w),0);
for(int i=0;i<=mid;i++){
w[i]=1;
}
if(ask(w)>C){
r=mid;
}
else{
l=mid+1;
}
}
answer(l,l+d);
return;
}
# | 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... |