Submission #143190

# Submission time Handle Problem Language Result Execution time Memory
143190 2019-08-13T10:11:57 Z neki Highway Tolls (IOI18_highway) C++14
0 / 100
24 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 Runtime error 3 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 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 24 ms 424 KB Output is incorrect: more than 100 calls to ask
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 460 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 436 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 424 KB Output is incorrect: more than 100 calls to ask
2 Halted 0 ms 0 KB -