Submission #986584

#TimeUsernameProblemLanguageResultExecution timeMemory
986584mariaclaraSplit the Attractions (IOI19_split)C++17
0 / 100
56 ms12800 KiB
#include "split.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define all(x) x.begin(), x.end() #define sz(x) x.size() #define mk make_pair #define pb push_back #define fr first #define sc second vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { vector<vector<int>> edges(n); for(int i = 0; i < sz(p); i++) edges[p[i]].pb(q[i]), edges[q[i]].pb(p[i]); if(a == 1) { queue<int> fila; vector<int> ans(n); fila.push(0); int cnt = 0; while(!fila.empty()) { int x = fila.front(); fila.pop(); ans[x] = 2; cnt++; if(cnt == b) break; for(int viz : edges[x]) if(!ans[viz]) fila.push(viz); } for(int i = 0; i < n; i++) if(a and ans[i] == 0) ans[i] = 1, a = 0; else if(ans[i] == 0) ans[i] = 3; return ans; } }

Compilation message (stderr)

split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:18:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |  for(int i = 0; i < sz(p); i++)
      |                   ^
split.cpp:16:29: warning: control reaches end of non-void function [-Wreturn-type]
   16 |  vector<vector<int>> edges(n);
      |                             ^
#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...