Submission #143192

# Submission time Handle Problem Language Result Execution time Memory
143192 2019-08-13T10:19:51 Z neki Highway Tolls (IOI18_highway) C++14
0 / 100
26 ms 632 KB
#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 248 KB Output is correct
2 Correct 2 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 252 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 508 KB Output is incorrect: more than 100 calls to ask
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 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 26 ms 504 KB Output is incorrect: more than 100 calls to ask
2 Halted 0 ms 0 KB -