Skip to content

Instantly share code, notes, and snippets.

@ik11235
Created December 9, 2014 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ik11235/97b40779c09194570179 to your computer and use it in GitHub Desktop.
Save ik11235/97b40779c09194570179 to your computer and use it in GitHub Desktop.
class ChristmasTreeDecorationDiv2 {
public:
int solve(vector<int> col, vector<int> x, vector<int> y) {
int cnt=0;
for(int i=0;i<x.size();i++)
{
if(col[x[i]-1]!=col[y[i]-1])
cnt++;
}
return cnt;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment