ID 5481850
Пользователь Псарев Александр Павлович
Время 22:12<< 13.10.2021 22:12 (9 д. 02:29) 22:14>>
Обработка 22:12 ... 22:12 (6,82 сек.)
Файл 5481850.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: In constructor 'Set::Set(const std::vector<long int>&)':
set.h:18:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
 for (int i = 0; i < vec.size(); i++) {
                 ~~^~~~~~~~~~~~
set.h: In member function 'Set Set::Union(const Set&)':
set.h:29:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
 for (int i = 0; i < join_set.S.size(); i++) {
                 ~~^~~~~~~~~~~~~~~~~~~
set.h:35:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
 for (int i = 0; i < this->S.size(); i++) {
                 ~~^~~~~~~~~~~~~~~~
set.h:41:6: error: 'new_S' was not declared in this scope
 sort(new_S.begin(), new_S.end());
      ^~~~~
set.h:41:1: error: 'sort' was not declared in this scope
 sort(new_S.begin(), new_S.end());
 ^~~~
set.h:41:1: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from main.cpp:5:
/usr/include/c++/7/bits/stl_algo.h:4856:5: note:   'std::sort'
     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
     ^~~~
In file included from main.cpp:16:0:
set.h:42:18: error: converting to 'Set' from initializer list would use explicit constructor 'Set::Set(const std::vector<long int>&)'
 return { new_set };
                  ^
set.h: In member function 'Set Set::Intersection(const Set&)':
set.h:46:21: error: 'join_set' was not declared in this scope
 for (int i = 0; i < join_set.S.size(); i++) {
                     ^~~~~~~~
set.h:46:21: note: suggested alternative: 'fd_set'
 for (int i = 0; i < join_set.S.size(); i++) {
                     ^~~~~~~~
                     fd_set
set.h:51:17: error: converting to 'Set' from initializer list would use explicit constructor 'Set::Set(const std::vector<long int>&)'
 return { result };
                 ^
set.h: In member function 'Set Set::Difference(const Set&)':
set.h:55:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
 for (int i = 0; i < join_set.S.size(); i++) {
                 ~~^~~~~~~~~~~~~~~~~~~
set.h:60:17: error: converting to 'Set' from initializer list would use explicit constructor 'Set::Set(const std::vector<long int>&)'
 return { result };
                 ^
set.h: In member function 'Set Set::SymmetricDifference(const Set&)':
set.h:64:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
 for (int i = 0; i < s.S.size(); i++) {
                 ~~^~~~~~~~~~~~
set.h:69:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
 for (int i = 0; i < this->S.size(); i++) {
                 ~~^~~~~~~~~~~~~~~~
set.h:74:17: error: converting to 'Set' from initializer list would use explicit constructor 'Set::Set(const std::vector<long int>&)'
 return { result };
                 ^
set.h: In member function 'bool Set::Contains(int64_t)':
set.h:82:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
 for (int i = 0; i < this->S.size(); i++) {
                 ~~^~~~~~~~~~~~~~~~
set.h: In member function 'void Set::Remove(int64_t)':
set.h:90:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
 for (int i = 0; i < this->S.size(); i++) {
                 ~~^~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
[печатать | |
]
(2 405 b)
0.048s 0.008s 10