Submission #534759

#TimeUsernameProblemLanguageResultExecution timeMemory
534759Icebear16Keys (IOI21_keys)C++17
0 / 100
1 ms332 KiB
#include <bits/stdc++.h> std::vector<int> adj[2000]; std::vector<bool> visited(2000,false); std::vector<int> find_reachable(std::vector<int> r, std::vector<int> u, std::vector<int> v, std::vector<int> c) { std::vector<int> ans(r.size(), 0); for(int i=0;i<u.size();i++){ adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } int m=1000; for(int i=0;i<u.size();i++){ int v=adj[i].size(); m=std::min(m,v); } for(int i=0;i<r.size();i++){ if(adj[i].size()==m){ ans[i]=1; } } return ans; }

Compilation message (stderr)

keys.cpp: In function 'std::vector<int> find_reachable(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
keys.cpp:8:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |  for(int i=0;i<u.size();i++){
      |              ~^~~~~~~~~
keys.cpp:13:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |  for(int i=0;i<u.size();i++){
      |              ~^~~~~~~~~
keys.cpp:17:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |  for(int i=0;i<r.size();i++){
      |              ~^~~~~~~~~
keys.cpp:18:19: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   18 |   if(adj[i].size()==m){
      |      ~~~~~~~~~~~~~^~~
#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...