Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct node {
- int idx;
- int mood;
- int dist;
- node (){}
- node(int _idx, int _mood, int _dist) {
- idx = _idx;
- mood = _mood;
- dist = _dist;
- }
- bool operator < (const node &tmp) const {
- int score1 = 0, score2 = 0;
- if(mood > tmp.mood) {
- score1++;
- }
- else {
- score2++;
- }
- if(dist < tmp.dist) {
- score1++;
- }
- else {
- score2++;
- }
- return score1 < score2;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement