File size: 5,472 Bytes
da6962b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
code`block`FunctionDecl`FunctionDeclRec`ForStmt`ForStmtRec`DoStmt`DoStmtRec`WhileStmt`WhileStmtRec`IfStmt`IfStmtRec`SwitchStmt`SwitchStmtRec`countBlocks`countBlocksRec`countCondition`countVariable`countLiteral`IntegerLiteral`StringLiteral`IfStmt`ForStmt`WhileStmt`DoStmt`SwitchStmt`countLoop`VarDecl`DeclRefExpr`DeclStmt`countDecl`countPointer`writeFunction`CallExpr`BinaryOperator`UnaryOperator`CompoundAssignOperator`countOperand`ArraySubscriptE`RealFaultLocation
void superior(int a ,int b)`FunctionDecl,true;`1`1`0`0`0`0`0`0`0`0`0`0`1`1`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`1
    for(int i=0 ; i < nodes[a].size() ; i++)`FunctionDecl,true;ForStmt,false;`1`1`1`0`0`0`0`0`0`0`0`0`2`1`1`4`1`1`0`0`1`0`0`0`1`1`5`1`7`0`0`0`1`1`0`2`0`0
        if(nodes[a][i] == b)`FunctionDecl,true;ForStmt,false;IfStmt,false;`1`1`1`0`0`0`0`0`1`0`0`0`3`1`2`4`0`0`0`1`0`0`0`0`0`0`6`0`6`0`0`0`1`0`0`1`0`0
            isSup = true;`FunctionDecl,true;ForStmt,false;IfStmt,false;`1`1`1`0`0`0`0`0`1`0`0`0`3`1`2`1`1`0`0`0`0`0`0`0`0`0`1`0`1`0`0`0`1`0`0`1`0`0
            return;`FunctionDecl,true;ForStmt,false;IfStmt,false;`1`1`1`0`0`0`0`0`1`0`0`0`3`1`2`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0
        else superior(nodes[a][i],b );`FunctionDecl,true;ForStmt,false;IfStmt,false;`1`1`1`0`0`0`0`0`1`0`0`0`3`1`2`4`0`0`0`0`0`0`0`0`0`0`7`0`7`0`1`1`0`0`0`0`0`0
int main()`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0
    int n;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`0`0`0`0`0`0`0`0`0`0`1`0`1`2`0`0`0`0`0`0`0`0`1
    cin >> n;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`2`0`0`0`0`0`0`0`0`0`0`3`0`3`0`0`0`0`0`0`0`0`0
    nodes = vector< vector<int> >(n);`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`2`0`0`0`0`0`0`0`0`0`0`3`0`3`0`0`0`0`0`0`0`0`1
    for(int i=0 ; i < n ; i++)`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`1`3`1`1`0`0`1`0`0`0`1`1`3`1`5`0`0`0`1`1`0`2`0`0
        int v;`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`1`0`0`0`0`0`0`0`0`0`0`1`0`1`2`0`0`0`0`0`0`0`0`0
        cin >> v;`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`1`2`0`0`0`0`0`0`0`0`0`0`3`0`3`0`0`0`0`0`0`0`0`0
        if(v>0)`FunctionDecl,false;ForStmt,false;IfStmt,false;`1`0`1`0`0`0`0`0`1`0`0`0`3`0`2`1`1`1`0`1`0`0`0`0`0`0`1`0`1`0`0`0`1`0`0`1`0`0
        nodes[v-1].push_back(i);`FunctionDecl,false;ForStmt,false;IfStmt,false;`1`0`1`0`0`0`0`0`1`0`0`0`3`0`2`3`1`1`0`0`0`0`0`0`0`0`4`0`4`0`0`0`1`0`0`1`0`0
    vector< vector<int> > grps;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`0`0`0`0`0`0`0`0`0`0`1`0`1`2`0`0`0`0`0`0`0`0`0
    vector<int> a;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`0`0`0`0`0`0`0`0`0`0`1`0`1`2`0`0`0`0`0`0`0`0`0
    a.push_back(0);`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`1`1`1`0`0`0`0`0`0`0`0`1`0`1`0`0`0`0`0`0`0`0`0
    grps.push_back(a);`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`2`0`0`0`0`0`0`0`0`0`0`2`0`2`0`0`0`0`0`0`0`0`0
    for(int i=1 ; i < n ; i++)`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`1`3`1`1`0`0`1`0`0`0`1`1`3`1`5`0`0`0`1`1`0`2`0`0
        int j= 0;`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`1`0`1`1`0`0`0`0`0`0`0`1`0`1`2`0`0`0`0`0`0`0`0`0
        for( ; j < grps.size() ;j++)`FunctionDecl,false;ForStmt,false;ForStmt,false;`1`0`2`0`0`0`0`0`0`0`0`0`3`0`2`3`0`0`0`0`1`0`0`0`1`0`3`0`3`0`0`0`1`1`0`2`0`0
                isSup = false;`FunctionDecl,false;ForStmt,false;ForStmt,false;`1`0`2`0`0`0`0`0`0`0`0`0`3`0`2`1`1`0`0`0`0`0`0`0`0`0`1`0`1`0`0`0`1`0`0`1`0`0
                for(int k=0 ; k < grps[j].size() && !isSup ; k++)`FunctionDecl,false;ForStmt,false;ForStmt,false;ForStmt,false;`1`0`3`0`0`0`0`0`0`0`0`0`4`0`7`5`1`1`0`0`1`0`0`0`1`1`6`1`8`0`0`0`2`2`0`4`0`0
                    isSup = false;`FunctionDecl,false;ForStmt,false;ForStmt,false;ForStmt,false;`1`0`3`0`0`0`0`0`0`0`0`0`4`0`7`1`1`0`0`0`0`0`0`0`0`0`1`0`1`0`0`0`1`0`0`1`0`0
                    superior(grps[j][k],i);`FunctionDecl,false;ForStmt,false;ForStmt,false;ForStmt,false;`1`0`3`0`0`0`0`0`0`0`0`0`4`0`7`4`0`0`0`0`0`0`0`0`0`0`7`0`7`0`1`1`0`0`0`0`0`0
                if(!isSup){`FunctionDecl,false;ForStmt,false;ForStmt,false;IfStmt,false;`1`0`2`0`0`0`0`0`1`0`0`0`4`0`5`1`0`0`0`1`0`0`0`0`0`0`1`0`1`0`0`0`0`1`0`1`0`0
                    break;`FunctionDecl,false;ForStmt,false;ForStmt,false;IfStmt,false;`1`0`2`0`0`0`0`0`1`0`0`0`4`0`5`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0
        if(j==grps.size())`FunctionDecl,false;ForStmt,false;IfStmt,false;`1`0`1`0`0`0`0`0`1`0`0`0`3`0`2`2`0`0`0`1`0`0`0`0`0`0`2`0`2`0`0`0`1`0`0`1`0`0
            vector<int> a;`FunctionDecl,false;ForStmt,false;IfStmt,false;`1`0`1`0`0`0`0`0`1`0`0`0`3`0`2`0`0`0`0`0`0`0`0`0`0`1`0`1`2`0`0`0`0`0`0`0`0`0
            a.push_back(i);`FunctionDecl,false;ForStmt,false;IfStmt,false;`1`0`1`0`0`0`0`0`1`0`0`0`3`0`2`2`0`0`0`0`0`0`0`0`0`0`2`0`2`0`0`0`0`0`0`0`0`0
            grps.push_back(a);`FunctionDecl,false;ForStmt,false;IfStmt,false;`1`0`1`0`0`0`0`0`1`0`0`0`3`0`2`2`0`0`0`0`0`0`0`0`0`0`2`0`2`0`0`0`0`0`0`0`0`0
            grps[j].push_back(i);`FunctionDecl,false;ForStmt,false;IfStmt,false;`1`0`1`0`0`0`0`0`1`0`0`0`3`0`2`3`0`0`0`0`0`0`0`0`0`0`4`0`4`0`0`0`0`0`0`0`0`0
    cout << grps.size();`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`2`0`0`0`0`0`0`0`0`0`0`3`0`3`0`0`0`0`0`0`0`0`0
    return 0;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0