Submission #615255

# Submission time Handle Problem Language Result Execution time Memory
615255 2022-07-31T08:01:13 Z 이동현(#8495) Broken Device 2 (JOI22_device2) C++17
Compilation error
0 ms 0 KB
#include "Anna.h"
#include <utility>
#include <vector>

namespace {
}

int Declare() {
  return 2000;
}

std::pair<std::vector<int>, std::vector<int> > Anna(long long A) {
  vector<int> X(A, 1), Y(2000, 0);
  while((int)X.size() < 200) X.push_back(0);
  return make_pair(X, Y);
}
#include "Bruno.h"
#include <utility>
#include <vector>

namespace {

int variable_example = 0;

}

long long Bruno(std::vector<int> u) {
  int ans = 0;
  for(auto&i:u) ans += i;
  return ans;
}

Compilation message

Anna.cpp: In function 'std::pair<std::vector<int>, std::vector<int> > Anna(long long int)':
Anna.cpp:13:3: error: 'vector' was not declared in this scope
   13 |   vector<int> X(A, 1), Y(2000, 0);
      |   ^~~~~~
Anna.cpp:13:3: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
                 from Anna.h:2,
                 from Anna.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from Anna.h:2,
                 from Anna.cpp:1:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
Anna.cpp:13:10: error: expected primary-expression before 'int'
   13 |   vector<int> X(A, 1), Y(2000, 0);
      |          ^~~
Anna.cpp:14:14: error: 'X' was not declared in this scope
   14 |   while((int)X.size() < 200) X.push_back(0);
      |              ^
Anna.cpp:15:20: error: 'X' was not declared in this scope
   15 |   return make_pair(X, Y);
      |                    ^
Anna.cpp:15:23: error: 'Y' was not declared in this scope
   15 |   return make_pair(X, Y);
      |                       ^
Anna.cpp:15:10: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'?
   15 |   return make_pair(X, Y);
      |          ^~~~~~~~~
      |          std::make_pair
In file included from /usr/include/c++/10/utility:70,
                 from Anna.h:1,
                 from Anna.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:567:5: note: 'std::make_pair' declared here
  567 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~

Bruno.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~