ID 5478184
Пользователь Павлюк Роман Сергеевич
Время 12.10.2021 23:26<< 13.10.2021 00:02 (27 д. 14:35) 00:08>>
Обработка 00:02 ... 00:02 (6,96 сек.)
Файл 5478184.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 1, осень 2021
Задача C: Set
Набор тестов
Ограничения Время: 1с Память: 512Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:16:0:
set.h:3:1: error: 'Set' does not name a type; did you mean 'getw'?
 Set::Set(const std::vector<int64_t> &vector) {
 ^~~
 getw
set.h:9:1: error: 'Set' does not name a type; did you mean 'getw'?
 Set Set::Union(const Set &old) const {
 ^~~
 getw
set.h:20:1: error: 'Set' does not name a type; did you mean 'getw'?
 Set Set::Intersection(const Set &another) const {
 ^~~
 getw
set.h:32:1: error: 'Set' does not name a type; did you mean 'getw'?
 Set Set::Difference(const Set &another) const {
 ^~~
 getw
set.h:50:1: error: 'Set' does not name a type; did you mean 'getw'?
 Set Set::SymmetricDifference(const Set &another) const {
 ^~~
 getw
set.h:54:6: error: 'Set' has not been declared
 void Set::Add(int64_t num) {
      ^~~
set.h: In function 'void Add(int64_t)':
set.h:55:28: error: invalid use of 'this' in non-member function
     for (auto const item : this->vector) {
                            ^~~~
set.h:60:5: error: invalid use of 'this' in non-member function
     this->vector.push_back(num);
     ^~~~
set.h: At global scope:
set.h:63:6: error: 'Set' has not been declared
 void Set::Remove(int64_t num) {
      ^~~
set.h: In function 'void Remove(int64_t)':
set.h:64:34: error: invalid use of 'this' in non-member function
     for (unsigned int i = 0; i < this->vector.size(); i++) {
                                  ^~~~
set.h:65:13: error: invalid use of 'this' in non-member function
         if (this->vector[i] == num) {
             ^~~~
set.h:66:13: error: invalid use of 'this' in non-member function
             this->vector.erase(this->vector.begin() + i);
             ^~~~
set.h:66:32: error: invalid use of 'this' in non-member function
             this->vector.erase(this->vector.begin() + i);
                                ^~~~
set.h: At global scope:
set.h:72:6: error: 'Set' has not been declared
 bool Set::Contains(int64_t num) const {
      ^~~
set.h:72:33: error: non-member function 'bool Contains(int64_t)' cannot have cv-qualifier
 bool Set::Contains(int64_t num) const {
                                 ^~~~~
set.h: In function 'bool Contains(int64_t)':
set.h:73:28: error: invalid use of 'this' in non-member function
     for (auto const item : this->vector) {
                            ^~~~
set.h: At global scope:
set.h:81:22: error: 'Set' has not been declared
 std::vector<int64_t> Set::Data() const {
                      ^~~
set.h:81:34: error: non-member function 'std::vector<long int> Data()' cannot have cv-qualifier
 std::vector<int64_t> Set::Data() const {
                                  ^~~~~
set.h: In function 'std::vector<long int> Data()':
set.h:82:12: error: invalid use of 'this' in non-member function
     return this->vector;
            ^~~~
main.cpp: In function 'int main()':
main.cpp:37:9: error: 'Set' was not declared in this scope
         Set s1(v1), s2(v2), s3;
         ^~~
main.cpp:37:9: note: suggested alternative: 'getw'
         Set s1(v1), s2(v2), s3;
         ^~~
         getw
main.cpp:40:17: error: 's3' was not declared in this scope
                 s3 = s1.Union(s2);
                 ^~
main.cpp:40:17: note: suggested alternative: 'v3'
                 s3 = s1.Union(s2);
                 ^~
                 v3
main.cpp:40:22: error: 's1' was not declared in this scope
                 s3 = s1.Union(s2);
                      ^~
main.cpp:40:22: note: suggested alternative: 'v1'
                 s3 = s1.Union(s2);
                      ^~
                      v1
main.cpp:40:31: error: 's2' was not declared in this scope
                 s3 = s1.Union(s2);
                               ^~
main.cpp:40:31: note: suggested alternative: 'v2'
                 s3 = s1.Union(s2);
                               ^~
                               v2
main.cpp:44:17: error: 's3' was not declared in this scope
                 s3 = s1.Intersection(s2);
                 ^~
main.cpp:44:17: note: suggested alternative: 'v3'
                 s3 = s1.Intersection(s2);
                 ^~
                 v3
main.cpp:44:22: error: 's1' was not declared in this scope
                 s3 = s1.Intersection(s2);
                      ^~
main.cpp:44:22: note: suggested alternative: 'v1'
                 s3 = s1.Intersection(s2);
                      ^~
                      v1
main.cpp:44:38: error: 's2' was not declared in this scope
                 s3 = s1.Intersection(s2);
                                      ^~
main.cpp:44:38: note: suggested alternative: 'v2'
                 s3 = s1.Intersection(s2);
                                      ^~
                                      v2
main.cpp:48:17: error: 's3' was not declared in this scope
                 s3 = s1.Difference(s2);
                 ^~
main.cpp:48:17: note: suggested alternative: 'v3'
                 s3 = s1.Difference(s2);
                 ^~
                 v3
main.cpp:48:22: error: 's1' was not declared in this scope
                 s3 = s1.Difference(s2);
                      ^~
main.cpp:48:22: note: suggested alternative: 'v1'
                 s3 = s1.Difference(s2);
                      ^~
                      v1
main.cpp:48:36: error: 's2' was not declared in this scope
                 s3 = s1.Difference(s2);
                                    ^~
main.cpp:48:36: note: suggested alternative: 'v2'
                 s3 = s1.Difference(s2);
                                    ^~
                                    v2
main.cpp:52:17: error: 's3' was not declared in this scope
                 s3 = s1.SymmetricDifference(s2);
                 ^~
main.cpp:52:17: note: suggested alternative: 'v3'
                 s3 = s1.SymmetricDifference(s2);
                 ^~
                 v3
main.cpp:52:22: error: 's1' was not declared in this scope
                 s3 = s1.SymmetricDifference(s2);
                      ^~
main.cpp:52:22: note: suggested alternative: 'v1'
                 s3 = s1.SymmetricDifference(s2);
                      ^~
                      v1
main.cpp:52:45: error: 's2' was not declared in this scope
                 s3 = s1.SymmetricDifference(s2);
                                             ^~
main.cpp:52:45: note: suggested alternative: 'v2'
                 s3 = s1.SymmetricDifference(s2);
                                             ^~
                                             v2
main.cpp:57:25: error: 's1' was not declared in this scope
                         s1.Add(k);
                         ^~
main.cpp:57:25: note: suggested alternative: 'v1'
                         s1.Add(k);
                         ^~
                         v1
main.cpp:59:17: error: 's3' was not declared in this scope
                 s3 = s1;
                 ^~
main.cpp:59:17: note: suggested alternative: 'v3'
                 s3 = s1;
                 ^~
                 v3
main.cpp:59:22: error: 's1' was not declared in this scope
                 s3 = s1;
                      ^~
main.cpp:59:22: note: suggested alternative: 'v1'
                 s3 = s1;
                      ^~
                      v1
main.cpp:64:25: error: 's1' was not declared in this scope
                         s1.Remove(k);
                         ^~
main.cpp:64:25: note: suggested alternative: 'v1'
                         s1.Remove(k);
                         ^~
                         v1
main.cpp:66:17: error: 's3' was not declared in this scope
                 s3 = s1;
                 ^~
main.cpp:66:17: note: suggested alternative: 'v3'
                 s3 = s1;
                 ^~
                 v3
main.cpp:66:22: error: 's1' was not declared in this scope
                 s3 = s1;
                      ^~
main.cpp:66:22: note: suggested alternative: 'v1'
                 s3 = s1;
                      ^~
                      v1
main.cpp:71:29: error: 's1' was not declared in this scope
                         if (s1.Contains(k)) {
                             ^~
main.cpp:71:29: note: suggested alternative: 'v1'
                         if (s1.Contains(k)) {
                             ^~
                             v1
main.cpp:75:17: error: 's3' was not declared in this scope
                 s3 = s1;
                 ^~
main.cpp:75:17: note: suggested alternative: 'v3'
                 s3 = s1;
                 ^~
                 v3
main.cpp:75:22: error: 's1' was not declared in this scope
                 s3 = s1;
                      ^~
main.cpp:75:22: note: suggested alternative: 'v1'
                 s3 = s1;
                      ^~
                      v1
main.cpp:78:14: error: 's3' was not declared in this scope
         v3 = s3.Data();
              ^~
main.cpp:78:14: note: suggested alternative: 'v3'
         v3 = s3.Data();
              ^~
              v3
[печатать | |
]
(1 901 b)
0.096s 0.011s 10