并查集,思路:将和bug i interact(我觉得“性交”会有误会)的归为一类,看同类的是否有interact行为(性行为),如果有输出Suspicious bugs found!
#include <iostream>
using namespace std;
class Node
{
public:
Node()
{
nodeID=0;
parent=NULL;
rank=0;
}
Node(int id)
{
nodeID=id;
parent=NULL;
rank=0;
}
int nodeID;
Node* parent;
int rank;
};
void MakeSet(Node* node)
{
node->parent=node;
node->rank=0;
}
void LinkSets(Node* node1,Node* node2)
{
if(node1->ra......
阅读全文