#include "highway.h"
#include <bits/stdc++.h>
#define loop(i, a, b) for(int i=a;i<b;i++)
using namespace std;
typedef long long ll;
void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
ll M=U.size(), st=0;
vector<int> arr;arr.resize(M, 0);ll req=ask(arr);
while(st<M){
ll l=st, r=M;
while(l<r){
ll mid=(l+r)/2;
loop(i, st, M) arr[i]=(i<=mid);
if(ask(arr)==req) l=mid+1;
else r=mid;
}
arr[l]=0;st=l+1;
}
vector<int> temp(N, 0), ans;
loop(i, 0, M) if(!arr[i]) temp[U[i]]++,temp[V[i]]++;
loop(i, 0, N) if(temp[i]==1) ans.push_back(i);
answer(ans[0], ans[1]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
3 ms |
248 KB |
Output is correct |
3 |
Runtime error |
5 ms |
632 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
376 KB |
Output is incorrect: more than 100 calls to ask |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
22 ms |
504 KB |
Output is incorrect: more than 100 calls to ask |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
22 ms |
604 KB |
Output is incorrect: more than 100 calls to ask |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
504 KB |
Output is incorrect: more than 100 calls to ask |
2 |
Halted |
0 ms |
0 KB |
- |