Submission #1031467

#TimeUsernameProblemLanguageResultExecution timeMemory
1031467hasan2006Art Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#include "art.h" using namespace std; #define TL ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); #define rall(s) s.rbegin(),s.rend() #define all(s) s.begin(),s.end() #define pb push_back #define se second #define fi first #define ll long long #define ld long double #define YES cout<<"YES\n" #define Yes cout<<"Yes\n" #define yes cout<<"yes\n" #define NO cout<<"NO\n" #define No cout<<"No\n" #define no cout<<"no\n" const int N = 5e5 + 9 , mod = 1e9 + 7; ll a[N] , b[N] , dp[N] , c[N] , d[N] ; void solve(int n) { ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ; vector<pair<int,int>>vc; for(i = 1; i <= n; i++){ vector<int>v; v.pb(i); for(j = 1; j <= n; j++) if(j != i) v.pb(j); vc.pb({publish(v) , j}); } sort(all(vc)); vector<int>v; for(auto to : vc) v.pb(to.se); answer(v); }

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:35:16: error: 'publish' was not declared in this scope
   35 |         vc.pb({publish(v) , j});
      |                ^~~~~~~
art.cpp:35:31: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(<brace-enclosed initializer list>)'
   35 |         vc.pb({publish(v) , j});
      |                               ^
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from art.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<int, int>]'
 1187 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1187:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::pair<int, int>&'}
 1187 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<int, int>]'
 1203 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1203:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
 1203 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
art.cpp:41:5: error: 'answer' was not declared in this scope
   41 |     answer(v);
      |     ^~~~~~
art.cpp:27:8: warning: unused variable 'q' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |        ^
art.cpp:27:19: warning: unused variable 'l' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |                   ^
art.cpp:27:22: warning: unused variable 'r' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |                      ^
art.cpp:27:26: warning: unused variable 'x' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |                          ^
art.cpp:27:30: warning: unused variable 'y' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |                              ^
art.cpp:27:34: warning: unused variable 's' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |                                  ^
art.cpp:27:42: warning: unused variable 'f' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |                                          ^
art.cpp:27:46: warning: unused variable 'k' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |                                              ^
art.cpp:27:50: warning: unused variable 'm' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |                                                  ^
art.cpp:27:54: warning: unused variable 'mn' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |                                                      ^~
art.cpp:27:65: warning: unused variable 'mx' [-Wunused-variable]
   27 |     ll q , i , j ,l ,r , x , y , s = 0 , f , k , m , mn = 1e18, mx = 0 ;
      |                                                                 ^~
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) {
      |        ~~~~~~~~~^~~~