Submission #00245


ソースコード

ステータス

項目 データ
問題 0020 - 3×3Puzzle
ユーザー名 ei2331
投稿日時 2024-08-09 09:49:10
言語 C++17
状態 Compile Error
得点 0
ソースコード長 2107 Byte
最大実行時間 -
最大メモリ使用量

コンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:37:16: error: ‘nx’ was not declared in this scope
             if(nx-1>=0&&m[nx-1][ny]=='.'&&dist[nx-1][ny]==-1){
                ^~
./Main.cpp:37:16: note: suggested alternative: ‘x’
             if(nx-1>=0&&m[nx-1][ny]=='.'&&dist[nx-1][ny]==-1){
                ^~
                x
./Main.cpp:37:25: error: ‘m’ was not declared in this scope
             if(nx-1>=0&&m[nx-1][ny]=='.'&&dist[nx-1][ny]==-1){
                         ^
./Main.cpp:37:33: error: ‘ny’ was not declared in this scope
             if(nx-1>=0&&m[nx-1][ny]=='.'&&dist[nx-1][ny]==-1){
                                 ^~
./Main.cpp:37:33: note: suggested alternative: ‘y’
             if(nx-1>=0&&m[nx-1][ny]=='.'&&dist[nx-1][ny]==-1){
                                 ^~
                                 y
./Main.cpp:37:43: error: ‘dist’ was not declared in this scope
             if(nx-1>=0&&m[nx-1][ny]=='.'&&dist[nx-1][ny]==-1){
                                           ^~~~
./Main.cpp:37:43: note: suggested alternative: ‘div’
             if(nx-1>=0&&m[nx-1][ny]=='.'&&dist[nx-1][ny]==-1){
                                           ^~~~
                                           div
./Main.cpp:39:32: error: expected ‘)’ before ‘;’ token
                 swap(next[zero];
                     ~          ^
                                )
./Main.cpp:40:33: error: no matching function for call to ‘std::queue<std::pair<std::__cxx11::basic_string<char>, long long int> >::push(<brace-enclosed initializer list>)’
                 q.push({nx-1,ny});
                                 ^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/queue:64,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:86,
                 from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:251:7: note: candidate: ‘void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, long long int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, long long int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, long long int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::__cxx11::basic_string<char>, long long int>]’
       push(const value_type& __x)
       ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:251:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const value_type&’ {aka ‘const std::pair<std::__cxx11::basic_string<char>, long long int>&’}
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:256:7: note: candidate: ‘void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, long long int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, long long int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, long long int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::__cxx11::basic_string<char>, long long int>]’
       push(value_type&& __x)
       ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:256:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::queue<std::pair<std::__cxx11::basic_string<char>, long long int> >::value_type&&’ {aka ‘std::pair<std::__cxx11::basic_string<char>, long long int>&&’}
./Main.cpp:43:16: error: ‘nx’ was not declared in this scope
             if(nx+1<h&&m[nx+1][ny]=='.'&&dist[nx+1][ny]==-1){
                ^~
./Main.cpp:43:16: note: suggested alternative: ‘x’
             if(nx+1<h&&m[nx+1][ny]=='.'&&dist[nx+1][ny]==-1){
                ^~
                x
./Main.cpp:43:21: error: ‘h’ was not declared in this scope
             if(nx+1<h&&m[nx+1][ny]=='.'&&dist[nx+1][ny]==-1){
                     ^
./Main.cpp:43:24: error: ‘m’ was not declared in this scope
             if(nx+1<h&&m[nx+1][ny]=='.'&&dist[nx+1][ny]==-1){
                        ^
./Main.cpp:43:32: error: ‘ny’ was not declared in this scope
             if(nx+1<h&&m[nx+1][ny]=='.'&&dist[nx+1][ny]==-1){
                                ^~
./Main.cpp:43:32: note: suggested alternative: ‘y’
             if(nx+1<h&&m[nx+1][ny]=='.'&&dist[nx+1][ny]==-1){
                                ^~
                                y
./Main.cpp:43:42: error: ‘dist’ was not declared in this scope
             if(nx+1<h&&m[nx+1][ny]=='.'&&dist[nx+1][ny]==-1){
                                          ^~~~
./Main.cpp:43:42: note: suggested alternative: ‘div’
             if(nx+1<h&&m[nx+1][ny]=='.'&&dist[nx+1][ny]==-1){
                                          ^~~~
                                          div
./Main.cpp:45:33: error: no matching function for call to ‘std::queue<std::pair<std::__cxx11::basic_string<char>, long long int> >::push(<brace-enclosed initializer list>)’
                 q.push({nx+1,ny});
                                 ^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/queue:64,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:86,
                 from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:251:7: note: candidate: ‘void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, long long int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, long long int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, long long int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::__cxx11::basic_string<char>, long long int>]’
       push(const value_type& __x)
       ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:251:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const value_type&’ {aka ‘const std::pair<std::__cxx11::basic_string<char>, long long int>&’}
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:256:7: note: candidate: ‘void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, long long int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, long long int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, long long int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::__cxx11::basic_string<char>, long long int>]’
       push(value_type&& __x)
       ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:256:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::queue<std::pair<std::__cxx11::basic_string<char>, long long int> >::value_type&&’ {aka ‘std::pair<std::__cxx11::basic_string<char>, long long int>&&’}
./Main.cpp:48:16: error: ‘ny’ was not declared in this scope
             if(ny-1>=0&&m[nx][ny-1]=='.'&&dist[nx][ny-1]==-1){
                ^~
./Main.cpp:48:16: note: suggested alternative: ‘y’
             if(ny-1>=0&&m[nx][ny-1]=='.'&&dist[nx][ny-1]==-1){
                ^~
                y
./Main.cpp:48:25: error: ‘m’ was not declared in this scope
             if(ny-1>=0&&m[nx][ny-1]=='.'&&dist[nx][ny-1]==-1){
                         ^
./Main.cpp:48:27: error: ‘nx’ was not declared in this scope
             if(ny-1>=0&&m[nx][ny-1]=='.'&&dist[nx][ny-1]==-1){
                           ^~
./Main.cpp:48:27: note: suggested alternative: ‘x’
             if(ny-1>=0&&m[nx][ny-1]=='.'&&dist[nx][ny-1]==-1){
                           ^~
                           x
./Main.cpp:48:43: error: ‘dist’ was not declared in this scope
             if(ny-1>=0&&m[nx][ny-1]=='.'&&dist[nx][ny-1]==-1){
                                           ^~~~
./Main.cpp:48:43: note: suggested alternative: ‘div’
             if(ny-1>=0&&m[nx][ny-1]=='.'&&dist[nx][ny-1]==-1){
                                           ^~~~
                                           div
./Main.cpp:50:33: error: no matching function for call to ‘std::queue<std::pair<std::__cxx11::basic_string<char>, long long int> >::push(<brace-enclosed initializer list>)’
                 q.push({nx,ny-1});
                                 ^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/queue:64,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:86,
                 from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:251:7: note: candidate: ‘void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, long long int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, long long int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, long long int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::__cxx11::basic_string<char>, long long int>]’
       push(const value_type& __x)
       ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:251:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const value_type&’ {aka ‘const std::pair<std::__cxx11::basic_string<char>, long long int>&’}
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:256:7: note: candidate: ‘void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, long long int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, long long int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, long long int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::__cxx11::basic_string<char>, long long int>]’
       push(value_type&& __x)
       ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:256:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::queue<std::pair<std::__cxx11::basic_string<char>, long long int> >::value_type&&’ {aka ‘std::pair<std::__cxx11::basic_string<char>, long long int>&&’}
./Main.cpp:53:16: error: ‘ny’ was not declared in this scope
             if(ny+1<w&&m[nx][ny+1]=='.'&&dist[nx][ny+1]==-1){
                ^~
./Main.cpp:53:16: note: suggested alternative: ‘y’
             if(ny+1<w&&m[nx][ny+1]=='.'&&dist[nx][ny+1]==-1){
                ^~
                y
./Main.cpp:53:21: error: ‘w’ was not declared in this scope
             if(ny+1<w&&m[nx][ny+1]=='.'&&dist[nx][ny+1]==-1){
                     ^
./Main.cpp:53:24: error: ‘m’ was not declared in this scope
             if(ny+1<w&&m[nx][ny+1]=='.'&&dist[nx][ny+1]==-1){
                        ^
./Main.cpp:53:26: error: ‘nx’ was not declared in this scope
             if(ny+1<w&&m[nx][ny+1]=='.'&&dist[nx][ny+1]==-1){
                          ^~
./Main.cpp:53:26: note: suggested alternative: ‘x’
             if(ny+1<w&&m[nx][ny+1]=='.'&&dist[nx][ny+1]==-1){
                          ^~
                          x
./Main.cpp:53:42: error: ‘dist’ was not declared in this scope
             if(ny+1<w&&m[nx][ny+1]=='.'&&dist[nx][ny+1]==-1){
                                          ^~~~
./Main.cpp:53:42: note: suggested alternative: ‘div’
             if(ny+1<w&&m[nx][ny+1]=='.'&&dist[nx][ny+1]==-1){
                                          ^~~~
                                          div
./Main.cpp:55:33: error: no matching function for call to ‘std::queue<std::pair<std::__cxx11::basic_string<char>, long long int> >::push(<brace-enclosed initializer list>)’
                 q.push({nx,ny+1});
                                 ^
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/queue:64,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:86,
                 from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:251:7: note: candidate: ‘void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, long long int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, long long int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, long long int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::__cxx11::basic_string<char>, long long int>]’
       push(const value_type& __x)
       ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:251:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const value_type&’ {aka ‘const std::pair<std::__cxx11::basic_string<char>, long long int>&’}
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:256:7: note: candidate: ‘void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, long long int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, long long int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, long long int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::__cxx11::basic_string<char>, long long int>]’
       push(value_type&& __x)
       ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_queue.h:256:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::queue<std::pair<std::__cxx11::basic_string<char>, long long int> >::value_type&&’ {aka ‘std::pair<std::__cxx11::basic_string<char>, long long int>&&’}

セット

セット 得点 Cases

テストケース

ファイル名 状態 実行時間 メモリ使用量 #