# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1099168 | 2024-10-10 16:27:52 | aren_dance | Combo (IOI18_combo) | C++14 | 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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <bits/stdc++.h>
using namespace std;
int press(string p);
string guess_sequence(int N){
int n=N;
string s="";
vector<char> ans(4);
ans[0]='A';
ans[1]='B';
ans[2]='X';
ans[3]='Y';
if(press("AB")>0){
if(press("A")){
s+='A';
ans.erase('A');
}
else{
s+='B';
ans.erase('B');
}
}
else{
if(press("X")){
s+='X';
ans.erase('X');
}
else{
s+='Y';
ans.erase('Y');
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Compilation message (stderr)
combo.cpp: In function 'std::string guess_sequence(int)': combo.cpp:15:26: error: no matching function for call to 'std::vector<char>::erase(char)' 15 | ans.erase('A'); | ^ In file included from /usr/include/c++/10/vector:67, from /usr/include/c++/10/queue:61, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86, from combo.cpp:1: /usr/include/c++/10/bits/stl_vector.h:1430:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = char; _Alloc = std::allocator<char>; std::vector<_Tp, _Alloc>::iterator = std::vector<char>::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<char>::const_iterator]' 1430 | erase(const_iterator __position) | ^~~~~ /usr/include/c++/10/bits/stl_vector.h:1430:28: note: no known conversion for argument 1 from 'char' to 'std::vector<char>::const_iterator' 1430 | erase(const_iterator __position) | ~~~~~~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/10/bits/stl_vector.h:1457:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = char; _Alloc = std::allocator<char>; std::vector<_Tp, _Alloc>::iterator = std::vector<char>::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<char>::const_iterator]' 1457 | erase(const_iterator __first, const_iterator __last) | ^~~~~ /usr/include/c++/10/bits/stl_vector.h:1457:7: note: candidate expects 2 arguments, 1 provided combo.cpp:19:26: error: no matching function for call to 'std::vector<char>::erase(char)' 19 | ans.erase('B'); | ^ In file included from /usr/include/c++/10/vector:67, from /usr/include/c++/10/queue:61, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86, from combo.cpp:1: /usr/include/c++/10/bits/stl_vector.h:1430:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = char; _Alloc = std::allocator<char>; std::vector<_Tp, _Alloc>::iterator = std::vector<char>::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<char>::const_iterator]' 1430 | erase(const_iterator __position) | ^~~~~ /usr/include/c++/10/bits/stl_vector.h:1430:28: note: no known conversion for argument 1 from 'char' to 'std::vector<char>::const_iterator' 1430 | erase(const_iterator __position) | ~~~~~~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/10/bits/stl_vector.h:1457:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = char; _Alloc = std::allocator<char>; std::vector<_Tp, _Alloc>::iterator = std::vector<char>::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<char>::const_iterator]' 1457 | erase(const_iterator __first, const_iterator __last) | ^~~~~ /usr/include/c++/10/bits/stl_vector.h:1457:7: note: candidate expects 2 arguments, 1 provided combo.cpp:25:26: error: no matching function for call to 'std::vector<char>::erase(char)' 25 | ans.erase('X'); | ^ In file included from /usr/include/c++/10/vector:67, from /usr/include/c++/10/queue:61, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86, from combo.cpp:1: /usr/include/c++/10/bits/stl_vector.h:1430:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = char; _Alloc = std::allocator<char>; std::vector<_Tp, _Alloc>::iterator = std::vector<char>::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<char>::const_iterator]' 1430 | erase(const_iterator __position) | ^~~~~ /usr/include/c++/10/bits/stl_vector.h:1430:28: note: no known conversion for argument 1 from 'char' to 'std::vector<char>::const_iterator' 1430 | erase(const_iterator __position) | ~~~~~~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/10/bits/stl_vector.h:1457:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = char; _Alloc = std::allocator<char>; std::vector<_Tp, _Alloc>::iterator = std::vector<char>::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<char>::const_iterator]' 1457 | erase(const_iterator __first, const_iterator __last) | ^~~~~ /usr/include/c++/10/bits/stl_vector.h:1457:7: note: candidate expects 2 arguments, 1 provided combo.cpp:29:26: error: no matching function for call to 'std::vector<char>::erase(char)' 29 | ans.erase('Y'); | ^ In file included from /usr/include/c++/10/vector:67, from /usr/include/c++/10/queue:61, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86, from combo.cpp:1: /usr/include/c++/10/bits/stl_vector.h:1430:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = char; _Alloc = std::allocator<char>; std::vector<_Tp, _Alloc>::iterator = std::vector<char>::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<char>::const_iterator]' 1430 | erase(const_iterator __position) | ^~~~~ /usr/include/c++/10/bits/stl_vector.h:1430:28: note: no known conversion for argument 1 from 'char' to 'std::vector<char>::const_iterator' 1430 | erase(const_iterator __position) | ~~~~~~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/10/bits/stl_vector.h:1457:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = char; _Alloc = std::allocator<char>; std::vector<_Tp, _Alloc>::iterator = std::vector<char>::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<char>::const_iterator]' 1457 | erase(const_iterator __first, const_iterator __last) | ^~~~~ /usr/include/c++/10/bits/stl_vector.h:1457:7: note: candidate expects 2 arguments, 1 provided