# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
467109 | a_aguilo | Memory (IOI10_memory) | C++14 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
void play(){
int candies = 0;
map <char, int> M (50);
set <int> asked;
set <char> received;
while (candies < 25){
int i = 1;
while (i <= 25){
char c = faceup (i);
if (received.find(c) != received.end()){
faceup (M[c]);
candies ++;
}
else{
received.insert(c);
M[c] = i;
++i;
char new = faceup (i);
if (new == c){
candies ++;
}
else {
i--;
}
}
++i;
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
memory.cpp: In function 'void play()': memory.cpp:7:24: error: no matching function for call to 'std::map<char, int>::map(int)' 7 | map <char, int> M (50); | ^ In file included from /usr/include/c++/10/map:61, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81, from memory.cpp:1: /usr/include/c++/10/bits/stl_map.h:290:2: note: candidate: 'template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const _Compare&, const allocator_type&) [with _InputIterator = _InputIterator; _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >]' 290 | map(_InputIterator __first, _InputIterator __last, | ^~~ /usr/include/c++/10/bits/stl_map.h:290:2: note: template argument deduction/substitution failed: memory.cpp:7:24: note: candidate expects 4 arguments, 1 provided 7 | map <char, int> M (50); | ^ In file included from /usr/include/c++/10/map:61, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81, from memory.cpp:1: /usr/include/c++/10/bits/stl_map.h:273:2: note: candidate: 'template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >]' 273 | map(_InputIterator __first, _InputIterator __last) | ^~~ /usr/include/c++/10/bits/stl_map.h:273:2: note: template argument deduction/substitution failed: memory.cpp:7:24: note: candidate expects 2 arguments, 1 provided 7 | map <char, int> M (50); | ^ In file included from /usr/include/c++/10/map:61, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81, from memory.cpp:1: /usr/include/c++/10/bits/stl_map.h:256:2: note: candidate: 'template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = _InputIterator; _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >]' 256 | map(_InputIterator __first, _InputIterator __last, | ^~~ /usr/include/c++/10/bits/stl_map.h:256:2: note: template argument deduction/substitution failed: memory.cpp:7:24: note: candidate expects 3 arguments, 1 provided 7 | map <char, int> M (50); | ^ In file included from /usr/include/c++/10/map:61, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81, from memory.cpp:1: /usr/include/c++/10/bits/stl_map.h:250:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Tp> >, const allocator_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const char, int> >]' 250 | map(initializer_list<value_type> __l, const allocator_type& __a) | ^~~ /usr/include/c++/10/bits/stl_map.h:250:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/10/bits/stl_map.h:244:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&, const allocator_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const char, int> >]' 244 | map(map&& __m, const allocator_type& __a) | ^~~ /usr/include/c++/10/bits/stl_map.h:244:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/10/bits/stl_map.h:240:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&, const allocator_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const char, int> >]' 240 | map(const map& __m, const allocator_type& __a) | ^~~ /usr/include/c++/10/bits/stl_map.h:240:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/10/bits/stl_map.h:236:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const allocator_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const char, int> >]' 236 | map(const allocator_type& __a) | ^~~ /usr/include/c++/10/bits/stl_map.h:236:33: note: no known conversion for argument 1 from 'int' to 'const allocator_type&' {aka 'const std::allocator<std::pair<const char, int> >&'} 236 | map(const allocator_type& __a) | ~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/10/bits/stl_map.h:228:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Tp> >, const _Compare&, const allocator_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const char, int> >]' 228 | map(initializer_list<value_type> __l, | ^~~ /usr/include/c++/10/bits/stl_map.h:228:40: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<std::pair<const char, int> >' 228 | map(initializer_list<value_type> __l, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/10/bits/stl_map.h:215:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >]' 215 | map(map&&) = default; | ^~~ /usr/include/c++/10/bits/stl_map.h:215:11: note: no known conversion for argument 1 from 'int' to 'std::map<char, int>&&' 215 | map(map&&) = default; | ^~~~~ /usr/include/c++/10/bits/stl_map.h:207:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >]' 207 | map(const map&) = default; | ^~~ /usr/include/c++/10/bits/stl_map.h:207:11: note: no known conversion for argument 1 from 'int' to 'const std::map<char, int>&' 207 | map(const map&) = default; | ^~~~~~~~~~ /usr/include/c++/10/bits/stl_map.h:194:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const _Compare&, const allocator_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const char, int> >]' 194 | map(const _Compare& __comp, | ^~~ /usr/include/c++/10/bits/stl_map.h:194:27: note: no known conversion for argument 1 from 'int' to 'const std::less<char>&' 194 | map(const _Compare& __comp, | ~~~~~~~~~~~~~~~~^~~~~~ /usr/include/c++/10/bits/stl_map.h:185:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map() [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >]' 185 | map() = default; | ^~~ /usr/include/c++/10/bits/stl_map.h:185:7: note: candidate expects 0 arguments, 1 provided memory.cpp:13:16: error: 'faceup' was not declared in this scope 13 | char c = faceup (i); | ^~~~~~ memory.cpp:22:13: error: expected unqualified-id before 'new' 22 | char new = faceup (i); | ^~~ memory.cpp:23:16: error: expected type-specifier before '==' token 23 | if (new == c){ | ^~