#include "highway.h"
#include<bits/stdc++.h>
using namespace std;
void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
int M = U.size();
std::vector<int> w(M);
map<int,int>a;
for (int i = 0; i < M; ++i) {
w[i] = 0;
}
long long toll = ask(w);
int cnt = toll/A;
for(int i=0;i<N;i++){
if(cnt == 0)break;
w[i]=1;
if(toll != ask(w)){
a[V[i]]++;
a[U[i]]++;
cnt--;
}
w[i]=0;
}
map<int,int>::iterator it = a.begin();
int ans1=-1 , ans2=-1;
for(;it!=a.end();it++){
if(it->second == 1){
if(ans1==-1)ans1=it->first;
else{
ans2 = it->first;
break;
}
}
}
answer(ans1 , ans2);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
256 KB |
Output is correct |
4 |
Correct |
1 ms |
256 KB |
Output is correct |
5 |
Correct |
1 ms |
256 KB |
Output is correct |
6 |
Correct |
2 ms |
256 KB |
Output is correct |
7 |
Correct |
1 ms |
376 KB |
Output is correct |
8 |
Correct |
1 ms |
256 KB |
Output is correct |
9 |
Correct |
1 ms |
256 KB |
Output is correct |
10 |
Correct |
2 ms |
256 KB |
Output is correct |
11 |
Correct |
2 ms |
256 KB |
Output is correct |
12 |
Correct |
2 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output is incorrect: more than 100 calls to ask. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
512 KB |
Output is incorrect: more than 100 calls to ask. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output is incorrect: more than 100 calls to ask. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
512 KB |
Output is incorrect: more than 100 calls to ask. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
512 KB |
Output is incorrect: more than 100 calls to ask. |
2 |
Halted |
0 ms |
0 KB |
- |