Submission #849801

#TimeUsernameProblemLanguageResultExecution timeMemory
849801Ahmed57Art Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "art.h" int solve(int N){ deque<int> x; int lol[N] = {0}; for(int i = 1;i<=N;i++){ x.push_back(i); vector<int> xd; for(auto j:x){ xd.push_back(j); } lol[i-1] = puplish(xd); x.pop_front(); x.push_back(i); } vector<int> ans(N,0); for(int i = 0;i<N;i++){ int diff = lol[i]-lol[(i+1)%N]; ans[(N-1+diff)/2] = (i+1); } answer(ans); }

Compilation message (stderr)

art.cpp:4:5: error: ambiguating new declaration of 'int solve(int)'
    4 | int solve(int N){
      |     ^~~~~
In file included from art.cpp:3:
art.h:17:6: note: old declaration 'void solve(int)'
   17 | void solve(int N);
      |      ^~~~~
art.cpp: In function 'int solve(int)':
art.cpp:13:20: error: 'puplish' was not declared in this scope; did you mean 'publish'?
   13 |         lol[i-1] = puplish(xd);
      |                    ^~~~~~~
      |                    publish
art.cpp:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
   23 | }
      | ^
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) {
      |        ~~~~~~~~~^~~~