Submission #291104

#TimeUsernameProblemLanguageResultExecution timeMemory
291104Pichon5Split the Attractions (IOI19_split)C++17
7 / 100
120 ms13428 KiB
#include<bits/stdc++.h> #include "split.h" #define vi vector<int> #define pb push_back #define F first using namespace std; vector<vector<int> >G; vector<bool>vis; vi res; vi v; void dfs(int u){ vis[u]=true; v.pb(u); for(int i=0;i<G[u].size();i++){ if(vis[G[u][i]]==true){ continue; } dfs(G[u][i]); } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { G.assign(n,vector<int>()); for(int i=0;i<p.size();i++){ G[p[i]].pb(q[i]); G[q[i]].pb(p[i]); } res.resize(n); vis.assign(n,false); dfs(0); for(int i=0;i<n;i++){ if(a>0){ res[v[i]]=1; a--; continue; } if(b>0){ res[v[i]]=2; b--; continue; } res[v[i]]=3; } return res; }

Compilation message (stderr)

split.cpp: In function 'void dfs(int)':
split.cpp:14:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for(int i=0;i<G[u].size();i++){
      |                 ~^~~~~~~~~~~~
split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:23:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     for(int i=0;i<p.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...