Submission #1099924

# Submission time Handle Problem Language Result Execution time Memory
1099924 2024-10-12T05:52:39 Z model_code Sphinx's Riddle (IOI24_sphinx) C++17
21.5 / 100
85 ms 912 KB
// partially_correct/subtask3-partial.cpp

#include <queue>

#include "sphinx.h"

using namespace std;

vector<int> find_colours(int N, vector<int> X, vector<int> Y) {
  vector<vector<int>> e;
  e.assign(N, {});
  int M = X.size();
  for (int i = 0; i < M; ++i) {
    vector<int> ord(N, N);
    ord[X[i]] = ord[Y[i]] = -1;
    vector<int> ordchk(N, N);
    ordchk[X[i]] = 0, ordchk[Y[i]] = 1;
    if (perform_experiment(ord) < perform_experiment(ordchk)) {
      e[X[i]].push_back(Y[i]);
      e[Y[i]].push_back(X[i]);
    }
  }

  vector<int> F(N, -1);
  int c = 0;
  queue<int> q;
  for (int i = 0; i < N; ++i) {
    if (F[i] >= 0) continue;
    F[i] = c;
    q.push(i);
    while (!q.empty()) {
      int cur = q.front();
      q.pop();
      for (int nxt : e[cur]) {
        if (F[nxt] == -1) {
          F[nxt] = c;
          q.push(nxt);
        }
      }
    }
    ++c;
  }
  return F;
}
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 344 KB Partially correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB #experiments: 2
2 Correct 0 ms 344 KB #experiments: 2
3 Partially correct 0 ms 344 KB Partially correct
4 Partially correct 1 ms 344 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 344 KB Partially correct
2 Correct 0 ms 344 KB #experiments: 2
3 Correct 0 ms 344 KB #experiments: 2
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 1 ms 344 KB Partially correct
8 Partially correct 1 ms 344 KB Partially correct
9 Partially correct 1 ms 344 KB Partially correct
10 Partially correct 1 ms 344 KB Partially correct
11 Partially correct 1 ms 344 KB Partially correct
12 Partially correct 1 ms 344 KB Partially correct
13 Partially correct 2 ms 344 KB Partially correct
14 Partially correct 24 ms 452 KB Partially correct
15 Partially correct 23 ms 344 KB Partially correct
16 Partially correct 23 ms 344 KB Partially correct
17 Partially correct 19 ms 348 KB Partially correct
18 Partially correct 20 ms 352 KB Partially correct
19 Partially correct 23 ms 356 KB Partially correct
20 Partially correct 19 ms 416 KB Partially correct
21 Partially correct 26 ms 344 KB Partially correct
22 Partially correct 14 ms 352 KB Partially correct
23 Partially correct 10 ms 600 KB Partially correct
24 Partially correct 7 ms 344 KB Partially correct
25 Partially correct 7 ms 344 KB Partially correct
26 Partially correct 1 ms 344 KB Partially correct
27 Partially correct 1 ms 344 KB Partially correct
28 Partially correct 2 ms 344 KB Partially correct
29 Partially correct 4 ms 344 KB Partially correct
30 Partially correct 10 ms 436 KB Partially correct
31 Partially correct 14 ms 344 KB Partially correct
32 Partially correct 22 ms 344 KB Partially correct
33 Partially correct 5 ms 428 KB Partially correct
34 Partially correct 16 ms 344 KB Partially correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB #experiments: 2
2 Correct 0 ms 344 KB #experiments: 2
3 Partially correct 0 ms 344 KB Partially correct
4 Partially correct 1 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 1 ms 344 KB Partially correct
8 Partially correct 1 ms 344 KB Partially correct
9 Partially correct 1 ms 344 KB Partially correct
10 Partially correct 1 ms 344 KB Partially correct
11 Partially correct 1 ms 344 KB Partially correct
12 Partially correct 2 ms 344 KB Partially correct
13 Partially correct 15 ms 420 KB Partially correct
14 Partially correct 10 ms 436 KB Partially correct
15 Partially correct 11 ms 444 KB Partially correct
16 Partially correct 9 ms 444 KB Partially correct
17 Partially correct 15 ms 692 KB Partially correct
18 Partially correct 13 ms 600 KB Partially correct
19 Partially correct 8 ms 344 KB Partially correct
20 Partially correct 8 ms 344 KB Partially correct
21 Partially correct 13 ms 412 KB Partially correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB #experiments: 2
2 Correct 0 ms 344 KB #experiments: 2
3 Partially correct 0 ms 344 KB Partially correct
4 Partially correct 1 ms 344 KB Partially correct
5 Partially correct 24 ms 452 KB Partially correct
6 Partially correct 23 ms 344 KB Partially correct
7 Partially correct 23 ms 344 KB Partially correct
8 Partially correct 19 ms 348 KB Partially correct
9 Partially correct 20 ms 352 KB Partially correct
10 Partially correct 23 ms 356 KB Partially correct
11 Partially correct 19 ms 416 KB Partially correct
12 Partially correct 26 ms 344 KB Partially correct
13 Incorrect 85 ms 912 KB #experiments reached 2751
14 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 344 KB Partially correct
2 Correct 0 ms 344 KB #experiments: 2
3 Correct 0 ms 344 KB #experiments: 2
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 1 ms 344 KB Partially correct
8 Partially correct 1 ms 344 KB Partially correct
9 Partially correct 1 ms 344 KB Partially correct
10 Partially correct 1 ms 344 KB Partially correct
11 Partially correct 1 ms 344 KB Partially correct
12 Partially correct 1 ms 344 KB Partially correct
13 Partially correct 2 ms 344 KB Partially correct
14 Partially correct 24 ms 452 KB Partially correct
15 Partially correct 23 ms 344 KB Partially correct
16 Partially correct 23 ms 344 KB Partially correct
17 Partially correct 19 ms 348 KB Partially correct
18 Partially correct 20 ms 352 KB Partially correct
19 Partially correct 23 ms 356 KB Partially correct
20 Partially correct 19 ms 416 KB Partially correct
21 Partially correct 26 ms 344 KB Partially correct
22 Partially correct 14 ms 352 KB Partially correct
23 Partially correct 10 ms 600 KB Partially correct
24 Partially correct 7 ms 344 KB Partially correct
25 Partially correct 7 ms 344 KB Partially correct
26 Partially correct 1 ms 344 KB Partially correct
27 Partially correct 1 ms 344 KB Partially correct
28 Partially correct 2 ms 344 KB Partially correct
29 Partially correct 4 ms 344 KB Partially correct
30 Partially correct 10 ms 436 KB Partially correct
31 Partially correct 14 ms 344 KB Partially correct
32 Partially correct 22 ms 344 KB Partially correct
33 Partially correct 5 ms 428 KB Partially correct
34 Partially correct 16 ms 344 KB Partially correct
35 Partially correct 15 ms 420 KB Partially correct
36 Partially correct 10 ms 436 KB Partially correct
37 Partially correct 11 ms 444 KB Partially correct
38 Partially correct 9 ms 444 KB Partially correct
39 Partially correct 15 ms 692 KB Partially correct
40 Partially correct 13 ms 600 KB Partially correct
41 Partially correct 8 ms 344 KB Partially correct
42 Partially correct 8 ms 344 KB Partially correct
43 Partially correct 13 ms 412 KB Partially correct
44 Incorrect 85 ms 912 KB #experiments reached 2751
45 Halted 0 ms 0 KB -