# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1120387 | vjudge1 | Art Collections (BOI22_art) | C++17 | Compilation error | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "art.h"
using namespace std;
#define int long long
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define UseOFF ios_base::sync_with_stdio(0);cin.tie(0), cout.tie(0);
#define sz size
#define ins insert
#define new junkedseduneon
#define prev usfdjik
const ll N = 2e6 + 111;
void solve(int n) {
cin >> n;
vector <ll> v, v2;
for(int i = 1; i <= n; i++) {
v.pb(i);
}
v2 = v;
reverse(v2.begin(), v2.end());
while(v != v2) {
cout << "publish({";
for(auto to : v) {
cout << to << ",";
}
cout << "})\n";
ll res;
cin >> res;
if(res == 0) {
cout << "answer({";
for(auto to : v) {
cout << to << ",";
}
cout << "})";
return;
}
next_permutation(v.begin(), v.end());
}
cout << "publish({";
for(auto to : v) {
cout << to << ",";
}
cout << "})\n";
ll res;
cin >> res;
if(res == 0) {
cout << "answer({";
for(auto to : v) {
cout << to << ",";
}
cout << "})";
return;
}
}
Compilation message (stderr)
art.cpp:14:7: error: 'll' does not name a type 14 | const ll N = 2e6 + 111; | ^~ art.cpp: In function 'void solve(long long int)': art.cpp:17:10: error: 'll' was not declared in this scope 17 | vector <ll> v, v2; | ^~ art.cpp:17:12: error: template argument 1 is invalid 17 | vector <ll> v, v2; | ^ art.cpp:17:12: error: template argument 2 is invalid art.cpp:7:12: error: request for member 'push_back' in 'v', which is of non-class type 'int' 7 | #define pb push_back | ^~~~~~~~~ art.cpp:19:5: note: in expansion of macro 'pb' 19 | v.pb(i); | ^~ art.cpp:22:13: error: request for member 'begin' in 'v2', which is of non-class type 'int' 22 | reverse(v2.begin(), v2.end()); | ^~~~~ art.cpp:22:25: error: request for member 'end' in 'v2', which is of non-class type 'int' 22 | reverse(v2.begin(), v2.end()); | ^~~ art.cpp:25:17: error: 'begin' was not declared in this scope 25 | for(auto to : v) { | ^ art.cpp:25:17: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from art.cpp:1: /usr/include/c++/10/valarray:1224:5: note: 'std::begin' 1224 | begin(const valarray<_Tp>& __va) | ^~~~~ In file included from /usr/include/c++/10/filesystem:46, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129, from art.cpp:1: /usr/include/c++/10/bits/fs_dir.h:549:3: note: 'std::filesystem::__cxx11::begin' 549 | begin(recursive_directory_iterator __iter) noexcept | ^~~~~ art.cpp:25:17: error: 'end' was not declared in this scope 25 | for(auto to : v) { | ^ art.cpp:25:17: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from art.cpp:1: /usr/include/c++/10/valarray:1244:5: note: 'std::end' 1244 | end(const valarray<_Tp>& __va) | ^~~ In file included from /usr/include/c++/10/filesystem:46, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129, from art.cpp:1: /usr/include/c++/10/bits/fs_dir.h:554:3: note: 'std::filesystem::__cxx11::end' 554 | end(recursive_directory_iterator) noexcept | ^~~ art.cpp:29:5: error: expected ';' before 'res' 29 | ll res; | ^~~~ | ; art.cpp:30:10: error: 'res' was not declared in this scope 30 | cin >> res; | ^~~ art.cpp:33:18: error: 'begin' was not declared in this scope 33 | for(auto to : v) { | ^ art.cpp:33:18: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from art.cpp:1: /usr/include/c++/10/valarray:1224:5: note: 'std::begin' 1224 | begin(const valarray<_Tp>& __va) | ^~~~~ In file included from /usr/include/c++/10/filesystem:46, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129, from art.cpp:1: /usr/include/c++/10/bits/fs_dir.h:549:3: note: 'std::filesystem::__cxx11::begin' 549 | begin(recursive_directory_iterator __iter) noexcept | ^~~~~ art.cpp:33:18: error: 'end' was not declared in this scope 33 | for(auto to : v) { | ^ art.cpp:33:18: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from art.cpp:1: /usr/include/c++/10/valarray:1244:5: note: 'std::end' 1244 | end(const valarray<_Tp>& __va) | ^~~ In file included from /usr/include/c++/10/filesystem:46, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129, from art.cpp:1: /usr/include/c++/10/bits/fs_dir.h:554:3: note: 'std::filesystem::__cxx11::end' 554 | end(recursive_directory_iterator) noexcept | ^~~ art.cpp:39:22: error: request for member 'begin' in 'v', which is of non-class type 'int' 39 | next_permutation(v.begin(), v.end()); | ^~~~~ art.cpp:39:33: error: request for member 'end' in 'v', which is of non-class type 'int' 39 | next_permutation(v.begin(), v.end()); | ^~~ art.cpp:42:16: error: 'begin' was not declared in this scope 42 | for(auto to : v) { | ^ art.cpp:42:16: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from art.cpp:1: /usr/include/c++/10/valarray:1224:5: note: 'std::begin' 1224 | begin(const valarray<_Tp>& __va) | ^~~~~ In file included from /usr/include/c++/10/filesystem:46, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129, from art.cpp:1: /usr/include/c++/10/bits/fs_dir.h:549:3: note: 'std::filesystem::__cxx11::begin' 549 | begin(recursive_directory_iterator __iter) noexcept | ^~~~~ art.cpp:42:16: error: 'end' was not declared in this scope 42 | for(auto to : v) { | ^ art.cpp:42:16: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from art.cpp:1: /usr/include/c++/10/valarray:1244:5: note: 'std::end' 1244 | end(const valarray<_Tp>& __va) | ^~~ In file included from /usr/include/c++/10/filesystem:46, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129, from art.cpp:1: /usr/include/c++/10/bits/fs_dir.h:554:3: note: 'std::filesystem::__cxx11::end' 554 | end(recursive_directory_iterator) noexcept | ^~~ art.cpp:46:4: error: expected ';' before 'res' 46 | ll res; | ^~~~ | ; art.cpp:47:9: error: 'res' was not declared in this scope 47 | cin >> res; | ^~~ art.cpp:50:17: error: 'begin' was not declared in this scope 50 | for(auto to : v) { | ^ art.cpp:50:17: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from art.cpp:1: /usr/include/c++/10/valarray:1224:5: note: 'std::begin' 1224 | begin(const valarray<_Tp>& __va) | ^~~~~ In file included from /usr/include/c++/10/filesystem:46, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129, from art.cpp:1: /usr/include/c++/10/bits/fs_dir.h:549:3: note: 'std::filesystem::__cxx11::begin' 549 | begin(recursive_directory_iterator __iter) noexcept | ^~~~~ art.cpp:50:17: error: 'end' was not declared in this scope 50 | for(auto to : v) { | ^ art.cpp:50:17: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from art.cpp:1: /usr/include/c++/10/valarray:1244:5: note: 'std::end' 1244 | end(const valarray<_Tp>& __va) | ^~~ In file included from /usr/include/c++/10/filesystem:46, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129, from art.cpp:1: /usr/include/c++/10/bits/fs_dir.h:554:3: note: 'std::filesystem::__cxx11::end' 554 | end(recursive_directory_iterator) noexcept | ^~~ 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) { | ~~~~~~~~~^~~~