Submission #877531

# Submission time Handle Problem Language Result Execution time Memory
877531 2023-11-23T09:42:30 Z AndrijaM 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<long long>v;
    for(long long i=0;i<n;i++)
    {
        v.push_back(i+1);
    }
    long long prev=publish(v);
    long long p=0;
    swap(v[0],v[1]);
    for(long long i=0;i<n;i++)
    {
        while(true)
        {
            long long kolku=publish(v);
            if(kolku>prev)
            {
                swap(v[i],v[p]);
                break;
            }
            long long koj=v[i]+1;
            long long P=-1;
            for(long long 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:17:28: error: could not convert 'v' from 'vector<long long int>' to 'vector<int>'
   17 |     long long prev=publish(v);
      |                            ^
      |                            |
      |                            vector<long long int>
art.cpp:24:37: error: could not convert 'v' from 'vector<long long int>' to 'vector<int>'
   24 |             long long kolku=publish(v);
      |                                     ^
      |                                     |
      |                                     vector<long long int>
art.cpp:32:36: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |             for(long long pos=0;pos<v.size();pos++)///moze i so mapa da najdeme kade e vo log(n)
      |                                 ~~~^~~~~~~~~
art.cpp:44:12: error: could not convert 'v' from 'vector<long long int>' to 'vector<int>'
   44 |     answer(v);
      |            ^
      |            |
      |            vector<long long int>
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) {
      |        ~~~~~~~~~^~~~