Submission #962053

# Submission time Handle Problem Language Result Execution time Memory
962053 2024-04-13T05:58:39 Z marinaluca Art Collections (BOI22_art) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "art.h"
//#pragma GCC optimize ("O4")
//#pragma GCC optimize ("fast-math")
//#pragma GCC optimize ("unroll-loops")
 
using namespace std;
//using vii = vector <int>;
using maaa = map <int, int>;
#define int long long
#define ll long long
#define XX first
#define YY second
#define all (x) begin(x), end(x)
//#define pb push_back
//#define mp make_pair
//#define pf push_front
//#define pp pop_front
//#define pub pop_back
/**#define cin fin
#define cout fout
ifstream cin ("pfn.in");
ofstream cout ("pfn.out");
**/
typedef double dbl;
typedef long double ldb;
typedef pair <int, int> pii;
typedef vector <int> vii;
typedef pair <double, int> pdi;
typedef float fl;

const int SMAX = 10;
const int VMAX = 1;
const int RMAX = 179;
const int NMAX = 4e3;

void solve (int N){
    int n = N;
    vector <int> ans(n), v;
    for (int i = 1; i <= n; ++ i){
        v.push_back(i);
    }
    int rasp = publish(v), pr;
    for (int i = 1; i < n; ++ i){
        int val = v[0];
        v.erase(v.begin());
        v.push_back(val);
        pr = publish(v);
        ans[(n - 1 - pr + rasp) / 2] = i;
        rasp = pr;
    }
    for (int i = 0; i < n; ++ i){
        if (ans[i] == 0)
            ans[i] = n;
    }
    answer (ans);
}
/**signed main(void){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    solve();
    return 0 ^ 0;
}**/

Compilation message

art.cpp: In function 'void solve(long long int)':
art.cpp:43:24: error: could not convert 'v' from 'vector<long long int>' to 'vector<int>'
   43 |     int rasp = publish(v), pr;
      |                        ^
      |                        |
      |                        vector<long long int>
art.cpp:48:9: error: 'pr' was not declared in this scope
   48 |         pr = publish(v);
      |         ^~
art.cpp:48:22: error: could not convert 'v' from 'vector<long long int>' to 'vector<int>'
   48 |         pr = publish(v);
      |                      ^
      |                      |
      |                      vector<long long int>
art.cpp:56:13: error: could not convert 'ans' from 'vector<long long int>' to 'vector<int>'
   56 |     answer (ans);
      |             ^~~
      |             |
      |             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) {
      |        ~~~~~~~~~^~~~