답안 #581076

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
581076 2022-06-22T09:00:24 Z Josia Art Collections (BOI22_art) C++17
0 / 100
1 ms 208 KB
#include <bits/stdc++.h>
#include "art.h"

using namespace std;


map<deque<int>, int> dict;

int query(deque<int> a) {
    if (dict.count(a)) return dict[a];
    vector<int> blub;
    for (int &i: a) blub.push_back(i+1);
    return dict[a] = publish(blub);
}


void solve(int n) {    
    deque<int> a;

    for (int i = 0; i<n; i++) {
        a.push_back(i);
    }

    vector<int> res(n, -1);

    int last = query(a);
    for (int i = 0; i<n; i++) {
        a.push_back(a[0]);
        a.pop_front();
        int q = query(a);
        // cerr << n/2 + ((last-q)/2) << "\n";
        res[n/2 + ((last-q)/2)] = a.back() + 1;

        last = q;
    }

    answer(res);
}

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) {
      |        ~~~~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Not correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Not correct
3 Halted 0 ms 0 KB -