Submission #1010755

# Submission time Handle Problem Language Result Execution time Memory
1010755 2024-06-29T10:32:59 Z 우민규(#10884) Beech Tree (IOI23_beechtree) C++17
0 / 100
1 ms 348 KB
#include "beechtree.h"

#include <bits/stdc++.h>
using namespace std;

std::vector<int> beechtree(int n, int m, std::vector<int> p,
                           std::vector<int> c) {
  vector<int> cols;
  for (auto c : c) cols.push_back(c);
  sort(cols.begin(), cols.end());
  cols.resize(unique(cols.begin(), cols.end()) - cols.begin());
  for (auto& c : c) c = lower_bound(cols.begin(), cols.end(), c) - cols.begin();
  m = cols.size();
  vector<int> poss(n);
  poss[n - 1] = 1;
  for (int i = n - 2; i >= 0; --i) {
    poss[i] = poss[i + 1] && c[i] == c[i + 1];
  }
  return poss;
}

#ifndef EVAL
#include "grader.cpp"
#endif
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 2nd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB 2nd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 2nd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 2nd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 2nd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -