Submission #263205

# Submission time Handle Problem Language Result Execution time Memory
263205 2020-08-13T14:02:47 Z NicolaAbusaad2014 Highway Tolls (IOI18_highway) C++14
5 / 100
20 ms 640 KB
#include "highway.h"
#include <bits/stdc++.h>
using namespace std;
map<int,int>m;
vector<int>v;
void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
  int M = (int)U.size();
  vector<int> w(M);
  for (int i = 0; i < M; ++i) {
      w[i] = 0;
    }
    long long mn=ask(w);
    w.clear();
  for (int j = 0; j < M; ++j) {
    std::vector<int> w(M);
    for (int i = 0; i < M; ++i) {
      w[i] = 0;
      if(i==j){
      w[i]=1;
      }
    }
    long long toll = ask(w);
    if(toll>mn){
    v.push_back(U[j]);
    v.push_back(V[j]);
    m[V[j]]++;
    m[U[j]]++;
    }
  }
  vector<int>ans;
  for(long i=0;i<(long)v.size();i++){
  if(m[v[i]]==1){
  ans.push_back(v[i]);
  }
  }
  answer(ans[0], ans[1]);
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 2 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 14 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 392 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 640 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 616 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -