| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1120391 | vjudge1 | Art Collections (BOI22_art) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "art.h"
using namespace std;
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;
}
}
컴파일 시 표준 에러 (stderr) 메시지
art.cpp: In function 'void solve(int)':
art.cpp:6:10: error: 'll' was not declared in this scope
6 | vector <ll> v, v2;
| ^~
art.cpp:6:12: error: template argument 1 is invalid
6 | vector <ll> v, v2;
| ^
art.cpp:6:12: error: template argument 2 is invalid
art.cpp:8:5: error: request for member 'pb' in 'v', which is of non-class type 'int'
8 | v.pb(i);
| ^~
art.cpp:11:13: error: request for member 'begin' in 'v2', which is of non-class type 'int'
11 | reverse(v2.begin(), v2.end());
| ^~~~~
art.cpp:11:25: error: request for member 'end' in 'v2', which is of non-class type 'int'
11 | reverse(v2.begin(), v2.end());
| ^~~
art.cpp:14:17: error: 'begin' was not declared in this scope
14 | for(auto to : v) {
| ^
art.cpp:14: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:14:17: error: 'end' was not declared in this scope
14 | for(auto to : v) {
| ^
art.cpp:14: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:18:5: error: expected ';' before 'res'
18 | ll res;
| ^~~~
| ;
art.cpp:19:10: error: 'res' was not declared in this scope
19 | cin >> res;
| ^~~
art.cpp:22:18: error: 'begin' was not declared in this scope
22 | for(auto to : v) {
| ^
art.cpp:22: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:22:18: error: 'end' was not declared in this scope
22 | for(auto to : v) {
| ^
art.cpp:22: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:28:22: error: request for member 'begin' in 'v', which is of non-class type 'int'
28 | next_permutation(v.begin(), v.end());
| ^~~~~
art.cpp:28:33: error: request for member 'end' in 'v', which is of non-class type 'int'
28 | next_permutation(v.begin(), v.end());
| ^~~
art.cpp:31:16: error: 'begin' was not declared in this scope
31 | for(auto to : v) {
| ^
art.cpp:31: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:31:16: error: 'end' was not declared in this scope
31 | for(auto to : v) {
| ^
art.cpp:31: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:35:4: error: expected ';' before 'res'
35 | ll res;
| ^~~~
| ;
art.cpp:36:9: error: 'res' was not declared in this scope
36 | cin >> res;
| ^~~
art.cpp:39:17: error: 'begin' was not declared in this scope
39 | for(auto to : v) {
| ^
art.cpp:39: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:39:17: error: 'end' was not declared in this scope
39 | for(auto to : v) {
| ^
art.cpp:39: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) {
| ~~~~~~~~~^~~~