Submission #714396

# Submission time Handle Problem Language Result Execution time Memory
714396 2023-03-24T10:14:57 Z vjudge1 Art Collections (BOI22_art) C++17
0 / 100
1 ms 208 KB
#include "art.h"
#include<bits/stdc++.h>
using namespace std;
int n;
int f(int a){
    vector<int> order;
    for (int i = 1; i <= n; i++)
    {
        if(i == a) continue;
        order.push_back(i);
    }
    order.push_back(a);
    return publish(order);
}
int f_error(int a){
    vector<int> order;
    order.push_back(a);
    for (int i = 1; i <= n; i++)
    {
        if(i == a) continue;
        order.push_back(i);
    }
    return publish(order);
}
void solve(int N) {
    n = N;
    vector<int> ans(n, 0);
    for (int i = 1; i <= n; i++)
    {
        int k = f(i);
        int error = f_error(i);
        int shift = (k - error + 1) / 2;
        int pos = (n + 2) / 2 - shift;
        ans[pos - 1] = i;
    }
    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 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -