Submission #1058213

#TimeUsernameProblemLanguageResultExecution timeMemory
1058213tolbiThousands Islands (IOI22_islands)C++17
5 / 100
17 ms3164 KiB
#include "islands.h" #include <bits/stdc++.h> using namespace std; std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { //herkese birer path vector<array<int,2>> lol(N-1); for (int i = 0; i < M; i++){ if (U[i]==0){ lol[V[i]-1][0]=i; } else if (V[i]==0){ lol[U[i]-1][1]=i; } } if (lol.size()==1){ return false; } vector<int> ans; for (int i = 0; i < lol.size(); ++i) { ans.push_back(lol[i][0]); ans.push_back(lol[i][1]); } for (int i = 0; i < lol.size(); ++i) { ans.push_back(lol[i][1]); ans.push_back(lol[i][0]); } return ans; }

Compilation message (stderr)

islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, std::vector<int>, std::vector<int>)':
islands.cpp:20:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |  for (int i = 0; i < lol.size(); ++i)
      |                  ~~^~~~~~~~~~~~
islands.cpp:25:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |  for (int i = 0; i < lol.size(); ++i)
      |                  ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...