# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
862506 | KK_1729 | Memory (IOI10_memory) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grader.h"
#include "memory.h"
#include <bits/stdc++.h>
using namespace std;
void play() {
int i;
char a, b;
map<char, vector<int>> x;
for (int i = 1; i <= 50; i++){
a = faceup(i);
x[a].pb(i);
}
for (auto c: x){
faceup(x[c][0]);
faceup(x[c][1]);
}
}
컴파일 시 표준 에러 (stderr) 메시지
memory.cpp: In function 'void play()': memory.cpp:12:12: error: 'std::map<char, std::vector<int> >::mapped_type' {aka 'class std::vector<int>'} has no member named 'pb' 12 | x[a].pb(i); | ^~ memory.cpp:16:15: error: no match for 'operator[]' (operand types are 'std::map<char, std::vector<int> >' and 'std::pair<const char, std::vector<int> >') 16 | faceup(x[c][0]); | ^ 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:3: /usr/include/c++/10/bits/stl_map.h:492:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = std::vector<int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::vector<int> > >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = std::vector<int>; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = char]' 492 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/10/bits/stl_map.h:492:34: note: no known conversion for argument 1 from 'std::pair<const char, std::vector<int> >' to 'const key_type&' {aka 'const char&'} 492 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/10/bits/stl_map.h:512:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = char; _Tp = std::vector<int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::vector<int> > >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = std::vector<int>; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = char]' 512 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/10/bits/stl_map.h:512:29: note: no known conversion for argument 1 from 'std::pair<const char, std::vector<int> >' to 'std::map<char, std::vector<int> >::key_type&&' {aka 'char&&'} 512 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~ memory.cpp:17:15: error: no match for 'operator[]' (operand types are 'std::map<char, std::vector<int> >' and 'std::pair<const char, std::vector<int> >') 17 | faceup(x[c][1]); | ^ 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:3: /usr/include/c++/10/bits/stl_map.h:492:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = std::vector<int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::vector<int> > >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = std::vector<int>; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = char]' 492 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/10/bits/stl_map.h:492:34: note: no known conversion for argument 1 from 'std::pair<const char, std::vector<int> >' to 'const key_type&' {aka 'const char&'} 492 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/10/bits/stl_map.h:512:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = char; _Tp = std::vector<int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::vector<int> > >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = std::vector<int>; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = char]' 512 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/10/bits/stl_map.h:512:29: note: no known conversion for argument 1 from 'std::pair<const char, std::vector<int> >' to 'std::map<char, std::vector<int> >::key_type&&' {aka 'char&&'} 512 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~ memory.cpp:7:8: warning: unused variable 'i' [-Wunused-variable] 7 | int i; | ^ memory.cpp:8:12: warning: unused variable 'b' [-Wunused-variable] 8 | char a, b; | ^