Submission #1016829

#TimeUsernameProblemLanguageResultExecution timeMemory
1016829vjudge1Checker (COCI19_checker)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int g, n; string s; cin >> g >> n >> s; vector<vector<int>> vec; for (int i = 1; i <= n - 3; i ++){ int x, y, c; cin >> x >> y >> c; if (x > y) swap(x, y); vec.push_back({x, y, i}); } sort(vec.begin(), vec.end()); bool good = 1; for (int i = 1; i < vec.size(); i ++){ if (vec[i].first >= vec[i - 1].second) continue; if (vec[i].second <= vec[i - 1].second) continue; good = 0; } if (!good){ cout << "neispravna triangulacija" << endl; return 0; } cout << "tocno" << endl; }

Compilation message (stderr)

checker.cpp: In function 'int main()':
checker.cpp:21:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for (int i = 1; i < vec.size(); i ++){
      |                     ~~^~~~~~~~~~~~
checker.cpp:22:20: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'first'
   22 |         if (vec[i].first >= vec[i - 1].second) continue;
      |                    ^~~~~
checker.cpp:22:40: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'second'
   22 |         if (vec[i].first >= vec[i - 1].second) continue;
      |                                        ^~~~~~
checker.cpp:23:20: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'second'
   23 |         if (vec[i].second <= vec[i - 1].second) continue;
      |                    ^~~~~~
checker.cpp:23:41: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'second'
   23 |         if (vec[i].second <= vec[i - 1].second) continue;
      |                                         ^~~~~~