Submission #877527

# Submission time Handle Problem Language Result Execution time Memory
877527 2023-11-23T09:41:25 Z vjudge1 Art Collections (BOI22_art) C++17
Compilation error
0 ms 0 KB
#include "art.h"
#include <bits/stdc++.h>

using namespace std;

const long long maxn = 1e5;
const long long mod = 1e9+7;
const long long logn=30;

void solve(long long n)
{
    vector<int>v;
    for(int i=0;i<n;i++)
    {
        v.push_back(i+1);
    }
    int prev=publish(v);
    int p=0;
    swap(v[0],v[1]);
    for(int i=0;i<n;i++)
    {
        while(true)
        {
            int kolku=publish(v);
            if(kolku>prev)
            {
                swap(v[i],v[p]);
                break;
            }
            int koj=v[i]+1;
            int P=-1;
            for(int pos=0;pos<v.size();pos++)///moze i so mapa da najdeme kade e vo log(n)
            {
                if(v[pos]==koj)
                {
                    P=pos;
                    break;
                }
            }
            p=P;
            swap(v[i],v[P]);
        }
    }
    answer(v);
    /// publish(order);
    /// answer(order);
}

Compilation message

art.cpp: In function 'void solve(long long int)':
art.cpp:32:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |             for(int pos=0;pos<v.size();pos++)///moze i so mapa da najdeme kade e vo log(n)
      |                           ~~~^~~~~~~~~
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) {
      |        ~~~~~~~~~^~~~
/usr/bin/ld: /tmp/ccK1sI5C.o: in function `main':
interface.cpp:(.text.startup+0x16): undefined reference to `solve(int)'
collect2: error: ld returned 1 exit status