답안 #1099921

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1099921 2024-10-12T05:52:01 Z model_code 스핑크스 (IOI24_sphinx) C++17
12 / 100
34 ms 912 KB
// partially_correct/subtask4-partial.cpp

#include "sphinx.h"

using namespace std;

vector<int> find_colours(int N, vector<int> /*X*/, vector<int> /*Y*/) {
  vector<vector<int>> comps;
  comps.push_back({0});
  for (int i = 1; i < N; ++i) {
    vector<int> ord(N, -1);
    for (int j = i + 1; j < N; ++j) ord[j] = N;
    if (perform_experiment(ord) == (int)comps.size() + 1 + (i + 1 < N)) {
      comps.push_back({i});
      continue;
    }

    int lo = 0, hi = comps.size();
    while (lo + 1 < hi) {
      int mid = (lo + hi) / 2;
      ord.assign(N, N);
      ord[i] = -1;
      for (int c = mid; c < hi; ++c) {
        for (int u : comps[c]) {
          ord[u] = -1;
        }
      }
      int expected = 2 + hi - mid;
      if (perform_experiment(ord) < expected) {
        lo = mid;
      } else {
        hi = mid;
      }
    }
    comps[lo].push_back(i);
  }

  vector<int> F(N, -1);
  for (int c = 0; c < (int)comps.size(); ++c) {
    for (int u : comps[c]) {
      F[u] = c;
    }
  }
  return F;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Vertices 0 and 1 do not have the same color, but they do in returned answer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB #experiments: 1
2 Correct 0 ms 344 KB #experiments: 1
3 Partially correct 1 ms 340 KB Partially correct
4 Partially correct 0 ms 344 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Vertices 0 and 1 do not have the same color, but they do in returned answer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB #experiments: 1
2 Correct 0 ms 344 KB #experiments: 1
3 Partially correct 1 ms 340 KB Partially correct
4 Partially correct 0 ms 344 KB Partially correct
5 Partially correct 1 ms 344 KB Partially correct
6 Incorrect 1 ms 344 KB Vertices 9 and 10 do have the same color, but they do not in returned answer
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB #experiments: 1
2 Correct 0 ms 344 KB #experiments: 1
3 Partially correct 1 ms 340 KB Partially correct
4 Partially correct 0 ms 344 KB Partially correct
5 Partially correct 1 ms 344 KB Partially correct
6 Partially correct 1 ms 344 KB Partially correct
7 Partially correct 2 ms 344 KB Partially correct
8 Partially correct 2 ms 348 KB Partially correct
9 Partially correct 2 ms 352 KB Partially correct
10 Partially correct 2 ms 352 KB Partially correct
11 Partially correct 2 ms 344 KB Partially correct
12 Partially correct 1 ms 344 KB Partially correct
13 Partially correct 18 ms 896 KB Partially correct
14 Partially correct 29 ms 896 KB Partially correct
15 Partially correct 27 ms 896 KB Partially correct
16 Partially correct 34 ms 908 KB Partially correct
17 Partially correct 32 ms 892 KB Partially correct
18 Partially correct 30 ms 856 KB Partially correct
19 Partially correct 22 ms 896 KB Partially correct
20 Partially correct 12 ms 888 KB Partially correct
21 Partially correct 13 ms 912 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Vertices 0 and 1 do not have the same color, but they do in returned answer
2 Halted 0 ms 0 KB -