Submission #1242143

#TimeUsernameProblemLanguageResultExecution timeMemory
1242143SalihSahin스핑크스 (IOI24_sphinx)C++20
24 / 100
31 ms656 KiB
#include "sphinx.h"
#include "bits/stdc++.h"
using namespace std;
#define pb push_back

vector<int> find_colours(int N, vector<int> X, vector<int> Y) {
  vector<int> ans(N);
  for(int i = 0; i < N; i++){
    vector<int> other(N-1);
    for(int j = 0; j < i; j++){
      other[j] = j;
    }
    for(int j = i; j < N-1; j++){
      other[j] = j+1;
    }

    int l = 0, r = N-1;
    while(l < r){
      int m = (l + r)/2;

      vector<int> v(N);
      for(int j = 0; j <= m; j++){
        v[other[j]] = j;
      }
      int gn = 0;
      for(int j = m+1; j < N-1; j++){
        v[other[j]] = N;
        gn = 1;
      }
      v[i] = -1;

      int x = perform_experiment(v) - gn; // N grubunu cık
      if(x == (m+1)) r = m;
      else l = m + 1;
    }
    ans[i] = l; 
  }

  return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...