Submission #276323

#TimeUsernameProblemLanguageResultExecution timeMemory
276323Toirov_SadiSplit the Attractions (IOI19_split)C++17
7 / 100
120 ms14500 KiB
#include<bits/stdc++.h> #include "split.h" using namespace std; const int N = 1e5 + 7; int used[N]; vector<int> g[N]; vector<int> t; void dfs(int v){ used[v] = 1; t.push_back(v); for(auto to: g[v]){ if(used[to] == 0) dfs(to); } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { for(int i = 0; i < (int)p.size(); i ++){ g[p[i]].push_back(q[i]); g[q[i]].push_back(p[i]); } dfs(0); int cur = 0; vector<int> res(n); for(int i = 0; i < (int)t.size(); i ++){ if(a --> 0){ res[t[i]] = 1; } else if(b --> 0){ res[t[i]] = 2; } else if(c --> 0){ res[t[i]] = 3; } } return res; }

Compilation message (stderr)

split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:25:9: warning: unused variable 'cur' [-Wunused-variable]
   25 |     int cur = 0;
      |         ^~~
#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...