Submission #1077851

#TimeUsernameProblemLanguageResultExecution timeMemory
1077851pccThousands Islands (IOI22_islands)C++17
5 / 100
20 ms5324 KiB
#include "islands.h" #include <variant> #include <vector> #include <bits/stdc++.h> using namespace std; #define pii pair<int,int> #define fs first #define sc second std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { if(N == 2){ vector<int> cnt[2]; for(int i = 0;i<M;i++){ int a = U[i],b = V[i]; cnt[a].push_back(i); } if(cnt[0].size()<2||cnt[1].size()<1)return false; int x = cnt[0][0],y = cnt[1][0],z = cnt[0][1]; return vector<int>({x,y,z,x,y,z}); } }

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:16:17: warning: unused variable 'b' [-Wunused-variable]
   16 |    int a = U[i],b = V[i];
      |                 ^
islands.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
#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...