Submission #720908

# Submission time Handle Problem Language Result Execution time Memory
720908 2023-04-09T18:12:57 Z YENGOYAN Art Collections (BOI22_art) C++17
0 / 100
0 ms 208 KB
#include "art.h"
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
void solve(int N) {
//    std::vector<int> order = {1, 2, 3};
  //  publish(order);
  //  order = {2, 3, 1};
  //  publish(order);
  //  order = {1, 3, 2};
  //  answer(order);
  int n = N;
  vector<int> v(n);
  for(int i = 0; i < n; ++i){
    v[i] = i + 1;
  }
  int l1 = publish(v), c = n;
  vector<int> ans(n);
  for(int i = 0; i < n - 1; ++i){
    v.insert(v.begin(), v.back());
    v.pop_back();
    int l2 = publish(v);
    ans[(l2 - l1 + n - 1) / 2] = --c;
    l1 = l2;
  }
  for(int i = 0; i < n; ++i){
    if(!ans[i]) {
      ans[i] = 1;
    }
  }
  answer(ans);
}

Compilation message

interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -