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 int solve(int dx, int color) {`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 if (color == m) return 0;`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`2`1`1`0`1`0`0`0`0`0`0`2`0`2`0`0`0`1`0`0`1`0`0 int &sol = dp[dx][color];`FunctionDecl,true;`1`1`0`0`0`0`0`0`0`0`0`0`1`1`0`3`0`0`0`0`0`0`0`0`0`1`3`1`5`1`0`0`0`0`0`0`2`0 if (sol != -1) return sol;`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`2`1`1`0`1`0`0`0`0`0`0`2`0`2`0`0`0`1`1`0`2`0`0 int nxt = lower_bound(pos[color].begin(), pos[color].end(), dx) - pos[color].begin();`FunctionDecl,true;`1`1`0`0`0`0`0`0`0`0`0`0`1`1`0`7`0`0`0`0`0`0`0`0`0`1`9`1`11`0`0`1`0`0`0`0`3`0 int L = pos[color].size() - nxt;`FunctionDecl,true;`1`1`0`0`0`0`0`0`0`0`0`0`1`1`0`3`0`0`0`0`0`0`0`0`0`1`3`1`5`0`0`0`1`0`0`1`1`0 sol = solve(dx, color + 1) + L;`FunctionDecl,true;`1`1`0`0`0`0`0`0`0`0`0`0`1`1`0`4`1`1`0`0`0`0`0`0`0`0`5`0`5`0`1`1`3`0`0`3`0`0 for (int i = nxt; i < pos[color].size(); ++i) {`FunctionDecl,true;ForStmt,false;`1`1`1`0`0`0`0`0`0`0`0`0`2`1`1`5`0`0`0`0`1`0`0`0`1`1`5`1`7`0`0`0`1`1`0`2`1`0 int cnt = i - nxt + 1;`FunctionDecl,true;ForStmt,false;`1`1`1`0`0`0`0`0`0`0`0`0`2`1`1`2`1`1`0`0`0`0`0`0`0`1`2`1`4`0`0`0`2`0`0`2`0`0 int diff = pos[color][i] - dx + 1 - cnt;`FunctionDecl,true;ForStmt,false;`1`1`1`0`0`0`0`0`0`0`0`0`2`1`1`5`1`1`0`0`0`0`0`0`0`1`6`1`8`0`0`0`3`0`0`3`1`0 sol = min(sol, solve(pos[color][i]+1, color+1) + L - cnt + diff);`FunctionDecl,true;ForStmt,false;`1`1`1`0`0`0`0`0`0`0`0`0`2`1`1`9`2`2`0`0`0`0`0`0`0`0`12`0`12`0`1`2`6`0`0`6`1`1 return sol;`FunctionDecl,true;`1`1`0`0`0`0`0`0`0`0`0`0`1`1`0`1`0`0`0`0`0`0`0`0`0`0`1`0`1`0`0`0`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 memset(dp, -1, sizeof(dp));`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`2`1`1`0`0`0`0`0`0`0`0`3`0`3`0`0`1`0`1`0`1`0`0 scanf("%d%d",&n,&m);`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`2`1`0`1`0`0`0`0`0`0`0`3`0`3`2`0`1`0`2`0`2`0`0 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 col; double x;`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`2`0`2`4`0`0`0`0`0`0`0`0`0 scanf("%d%lf",&col,&x); col--;`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`1`3`1`0`1`0`0`0`0`0`0`0`4`0`4`2`0`1`0`3`0`3`0`0 pos[col].push_back(i);`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`1`3`0`0`0`0`0`0`0`0`0`0`3`0`3`0`0`0`0`0`0`0`1`0 printf("%d\n",solve(0, 0));`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`0`3`2`1`0`0`0`0`0`0`0`2`0`2`0`1`2`0`0`0`0`0`1 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