Language: C++

Last login: Mon Apr 24 16:33:46 on ttys000
install-no-MacBook-Pro-4:~ g-2019$ cd zemi/
install-no-MacBook-Pro-4:zemi g-2019$ ls
#test.rb#	0417		0424
install-no-MacBook-Pro-4:zemi g-2019$ cd 0424
install-no-MacBook-Pro-4:0424 g-2019$ ls
#test.cpp#		atCoser-iroha.cpp	prac1_.cpp~
a.out			hanafuda.cpp		str.cpp
atCoder-B.cpp		hanafuda.cpp~		test.cpp
atCoder-B.cpp~		prac1_.cpp		test.cpp~
install-no-MacBook-Pro-4:0424 g-2019$ ./a.out
5 2
0
1
2
3
4
3 1
3 1
5
5 4 3 2 1               
0 0
install-no-MacBook-Pro-4:0424 g-2019$ emacs hanafuda.cpp























[1]+  Stopped                 emacs hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ celar
-bash: celar: command not found
install-no-MacBook-Pro-4:0424 g-2019$ clear

install-no-MacBook-Pro-4:0424 g-2019$ g++ -Wall hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ ./a.out
5 2 
0
1
2
3
4
3 1
3 1
4
4 3 5 2 1 
0 0
install-no-MacBook-Pro-4:0424 g-2019$ fg
emacs hanafuda.cpp

[1]+  Stopped                 emacs hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ g++ -Wall hanafuda.cpp
hanafuda.cpp:22:5: error: no matching function for call to 'init'
    init(&yama, n);
    ^~~~
hanafuda.cpp:7:6: note: candidate function not viable: no known conversion from
      'vector<int> *' to 'vector<int> &' for 1st argument; remove &
void init(vector<int> &yama, int n);
     ^
1 error generated.
install-no-MacBook-Pro-4:0424 g-2019$ fg
emacs hanafuda.cpp

[1]+  Stopped                 emacs hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ fg
emacs hanafuda.cpp

[1]+  Stopped                 emacs hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ g++ -Wall hanafuda.cpp
hanafuda.cpp:22:5: error: no matching function for call to 'init_yama'
    init_yama(&yama, n);
    ^~~~~~~~~
hanafuda.cpp:7:6: note: candidate function not viable: no known conversion from
      'vector<int> *' to 'vector<int> &' for 1st argument; remove &
void init_yama(vector<int> &yama, int n);
     ^
1 error generated.
install-no-MacBook-Pro-4:0424 g-2019$ fg
emacs hanafuda.cpp

[1]+  Stopped                 emacs hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ g++ -Wall hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ ./a.out
5 2
3 1
3 1
0 0
4
install-no-MacBook-Pro-4:0424 g-2019$ fg
emacs hanafuda.cpp

[1]+  Stopped                 emacs hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ g++ -Wall hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ fg
emacs hanafuda.cpp

[1]+  Stopped                 emacs hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ g++ -Wall hanafuda.cpp
hanafuda.cpp:27:7: error: no matching function for call to 'shuffle'
      shuffle(&yama, n, p, c);
      ^~~~~~~
hanafuda.cpp:7:6: note: candidate function not viable: no known conversion from
      'vector<int> *' to 'vector<int> &' for 1st argument; remove &
void shuffle(vector<int> &yama, int n, int p, int c);
     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3122:10: note: 
      candidate function template not viable: requires 3 arguments, but 4 were
      provided
    void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
         ^
1 error generated.
install-no-MacBook-Pro-4:0424 g-2019$ fg
emacs hanafuda.cpp

[1]+  Stopped                 emacs hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ g++ -Wall hanafuda.cpp
hanafuda.cpp:45:9: error: assigning to 'int' from incompatible type
      'vector<int>'
    tmp = yama[p-1+c-1];
        ^ ~~~~~~~~~~~~~
hanafuda.cpp:46:9: error: member reference type 'vector<int> *' is a pointer;
      did you mean to use '->'?
    yama.erase(yama.begin()+p-1+c-1);
    ~~~~^
        ->
hanafuda.cpp:46:20: error: member reference type 'vector<int> *' is a pointer;
      did you mean to use '->'?
    yama.erase(yama.begin()+p-1+c-1);
               ~~~~^
                   ->
hanafuda.cpp:47:9: error: member reference type 'vector<int> *' is a pointer;
      did you mean to use '->'?
    yama.insert(yama.begin(), tmp);
    ~~~~^
        ->
hanafuda.cpp:47:21: error: member reference type 'vector<int> *' is a pointer;
      did you mean to use '->'?
    yama.insert(yama.begin(), tmp);
                ~~~~^
                    ->
5 errors generated.
install-no-MacBook-Pro-4:0424 g-2019$ fg
emacs hanafuda.cpp

[1]+  Stopped                 emacs hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ g++ -Wall hanafuda.cpp
install-no-MacBook-Pro-4:0424 g-2019$ fg
emacs hanafuda.cpp


#include <iostream>
#include <vector>
using namespace std;

//?±±?????????????????¢??°???????±±???????±±????????°n???p?????????????????????c???                       
void shuffle(vector<int> &yama, int n, int p, int c);


int main(){
  int n, r;
  int p, c;
  vector<int> yama, v;

  cin >> n;
  cin >> r;

  while(n != 0 && r != 0){
    //?±±??????????????????                                                            
    for(int i = 0, j = n; i < n; i++, j--){
      yama.push_back(j);
    }
    //?????£?????????                                                                
    for (int i = 0; i < r; i++){
      cin >> p;
      cin >> c;
      shuffle(yama, n, p, c);
    }
    //???????????????????¨????                                                          
    v.push_back(yama.front());

    cin >> n;
    cin >> r;
  }
  for(int i = 0; i < v.size(); i++){
    cout << v[i];
  }
  cout << endl;
}

void shuffle(vector<int> &yama, int n, int p, int c){
  int tmp;

  for(int i = 0;i < c; i++){
-uuu:---F1  hanafuda.cpp   Top L41    (C++/l Abbrev)----------------------------

Compiler output:
a.cc:4:2: error: invalid preprocessing directive #test
    4 | #test.rb#       0417            0424
      |  ^~~~
a.cc:7:2: error: invalid preprocessing directive #test
    7 | #test.cpp#              atCoser-iroha.cpp       prac1_.cpp~
      |  ^~~~
a.cc:70:60: warning: multi-character character constant [-Wmultichar]
   70 | hanafuda.cpp:22:5: error: no matching function for call to 'init'
      |                                                            ^~~~~~
a.cc:74:7: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
   74 |       'vector<int> *' to 'vector<int> &' for 1st argument; remove &
      |       ^~~~~~~~~~~~~~~
a.cc:74:26: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
   74 |       'vector<int> *' to 'vector<int> &' for 1st argument; remove &
      |                          ^~~~~~~~~~~~~~~
a.cc:87:60: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   87 | hanafuda.cpp:22:5: error: no matching function for call to 'init_yama'
      |                                                            ^~~~~~~~~~~
a.cc:91:7: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
   91 |       'vector<int> *' to 'vector<int> &' for 1st argument; remove &
      |       ^~~~~~~~~~~~~~~
a.cc:91:26: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
   91 |       'vector<int> *' to 'vector<int> &' for 1st argument; remove &
      |                          ^~~~~~~~~~~~~~~
a.cc:116:60: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
  116 | hanafuda.cpp:27:7: error: no matching function for call to 'shuffle'
      |                                                            ^~~~~~~~~
a.cc:120:7: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
  120 |       'vector<int> *' to 'vector<int> &' for 1st argument; remove &
      |       ^~~~~~~~~~~~~~~
a.cc:120:26: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
  120 |       'vector<int> *' to 'vector<int> &' for 1st argument; remove &
      |                          ^~~~~~~~~~~~~~~
a.cc:134:40: warning: multi-character character constant [-Wmultichar]
  134 | hanafuda.cpp:45:9: error: assigning to 'int' from incompatible type
      |                                        ^~~~~
a.cc:135:7: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
  135 |       'vector<int>'
      |       ^~~~~~~~~~~~~
a.cc:138:49: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
  138 | hanafuda.cpp:46:9: error: member reference type 'vector<int> *' is a pointer;
      |                                                 ^~~~~~~~~~~~~~~
a.cc:139:27: warning: multi-character character constant [-Wmultichar]
  139 |       did you mean to use '->'?
      |                           ^~~~
a.cc:143:50: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
  143 | hanafuda.cpp:46:20: error: member reference type 'vector<int> *' is a pointer;
      |                                                  ^~~~~~~~~~~~~~~
a.cc:144:27: warning: multi-character character constant [-Wmultichar]
  144 |       did you mean to use '->'?
      |                           ^~~~
a.cc:148:49: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
  148 | hanafuda.cpp:47:9: error: member reference type 'vector<int> *' is a pointer;
      |                                                 ^~~~~~~~~~~~~~~
a.cc:149:27: warning: multi-character character constant [-Wmultichar]
  149 |       did you mean to use '->'?
      |                           ^~~~
a.cc:153:50: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
  153 | hanafuda.cpp:47:21: error: member reference type 'vector<int> *' is a pointer;
      |                                                  ^~~~~~~~~~~~~~~
a.cc:154:27: warning: multi-character character constant [-Wmultichar]
  154 |       did you mean to use '->'?
      |                           ^~~~
a.cc:1:1: error: 'Last' does not name a type
    1 | Last login: Mon Apr 24 16:33:46 on ttys000
      | ^~~~
a.cc:72:5: error: expected unqualified-id before '^' token
   72 |     ^~~~
      |     ^
a.cc:74:60: error: 'remove' does not name a type
   74 |       'vector<int> *' to 'vector<int> &' for 1st argument; remove &
      |                                                            ^~~~~~
a.cc:76:6: error: expected unqualified-id before '^' token
   76 |      ^
      |      ^
a.cc:89:5: error: expected unqualified-id before '^' token
   89 |     ^~~~~~~~~
      |     ^
a.cc:91:60: error: 'remove' does not name a type
   91 |       'vector<int> *' to 'vector<int> &' for 1st argument; remove &
      |                                                            ^~~~~~
a.cc:93:6: error: expected unqualified-id before '^' token
   93 |      ^
      |      ^
a.cc:118:7: error: expected unqualified-id before '^' token
  118 |       ^~~~~~~
      |       ^
a.cc:120:60: error: 'remove' does not name a type
  120 |       'vector<int> *' to 'vector<int> &' for 1st argument; remove &
      |                                                            ^~~~~~
a.cc:122:6: error: expected unqualified-id before '^' token
  122 |      ^
      |      ^
a.cc:137:9: error: expected unqualified-id before '^' token
  137 |         ^ ~~~~~~~~~~~~~
      |         ^
a.cc:139:7: error: 'did' does not name a type
  139 |       did you mean to use '->'?
      |       ^~~
a.cc:141:6: error: expected class-name before '~' token
  141 |     ~~~~^
      |      ^
a.cc:144:7: error: 'did' does not name a type
  144 |       did you mean to use '->'?
      |       ^~~
a.cc:146:17: error: expected class-name before '~' token
  146 |                ~~~~^
      |                 ^
a.cc:149:7: error: 'did' does not name a type
  149 |       did you mean to use '->'?
      |       ^~~
a.cc:151:6: error: expected class-name before '~' token
  151 |     ~~~~^
      |      ^
a.cc:154:7: error: 'did' does not name a type
  154 |       did you mean to use '->'?
      |       ^~~
a.cc:156:18: error: expected class-name before '~' token
  156 |                 ~~~~^
      |                  ^
In file included from /usr/include/c++/14/iosfwd:42,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:168:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
   68 |   typedef ptrdiff_t     streamsize; // Signed integral type
      |           ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
   40 | #include <cwchar> // For mbstate_t
  +++ |+#include <cstddef>
   41 | 
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
  131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                                            ^~~~~~
In file included from /usr/include/wchar.h:35,
                 from /usr/include/c++/14/cwchar:44,
                 from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
  132 |   __attribute__((__externally_visible__));
      |                                         ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
  133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                                              ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
  134 |   __attribute__((__externally_visible__));
      |                                         ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
  140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
      |                             ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
  142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
      |                               ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
  145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                          ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                            ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
  145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_U