File size: 5,411 Bytes
2ab7a4a |
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 38 39 40 41 42 |
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 error2(const string &s,const int &t){`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`1
cerr<<endl<<" "<<s<<" = "<<t<<endl;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`3`2`0`2`0`0`0`0`0`0`0`11`0`11`0`0`0`0`0`0`0`0`0
int c(int n,int k){`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
int ans=0;`FunctionDecl,true;`1`1`0`0`0`0`0`0`0`0`0`0`1`1`0`0`1`1`0`0`0`0`0`0`0`1`0`1`2`0`0`0`0`0`0`0`0`0
if(cnk[n][k]!=0)`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`3`1`1`0`1`0`0`0`0`0`0`3`0`3`0`0`0`1`0`0`1`2`0
return cnk[n][k];`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`3`0`0`0`0`0`0`0`0`0`0`3`0`3`0`0`0`0`0`0`0`2`0
if(k<0)`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`1`1`1`0`1`0`0`0`0`0`0`1`0`1`0`0`0`1`0`0`1`0`0
return 0;`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`0`1`1`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0
if(k==0)`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`1`1`1`0`1`0`0`0`0`0`0`1`0`1`0`0`0`1`0`0`1`0`0
return 1;`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`0`1`1`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0
if(k==1)`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`1`1`1`0`1`0`0`0`0`0`0`1`0`1`0`0`0`1`0`0`1`0`0
return n;/*`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`1`0`0`0`0`0`0`0`0`0`0`1`0`1`0`0`0`0`0`0`0`0`0
if(k>n)`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`2`0`0`0`1`0`0`0`0`0`0`2`0`2`0`0`0`1`0`0`1`0`0
return 0;`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`0`1`1`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0
if(k==n)`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`2`0`0`0`1`0`0`0`0`0`0`2`0`2`0`0`0`1`0`0`1`0`0
return 1;`FunctionDecl,true;IfStmt,false;`1`1`0`0`0`0`0`0`1`0`0`0`2`1`1`0`1`1`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0
ans=c(n-1,k-1)+c(n-1,k);`FunctionDecl,true;`1`1`0`0`0`0`0`0`0`0`0`0`1`1`0`5`3`3`0`0`0`0`0`0`0`0`7`0`7`0`2`2`5`0`0`5`0`0
cnk[n][k]=ans;`FunctionDecl,true;`1`1`0`0`0`0`0`0`0`0`0`0`1`1`0`4`0`0`0`0`0`0`0`0`0`0`4`0`4`0`0`0`1`0`0`1`2`0
return ans;`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
ios::sync_with_stdio(false);`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`0`1`0`0`0`0`0`0`0`0`0`1`0`1`0`0`1`0`0`0`0`0`1
int n,s=0,p=0,a=0,m,k;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`0`3`3`0`0`0`0`0`0`0`6`0`1`7`0`0`0`0`0`0`0`0`1
cin>>n>>m>>k;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`4`0`0`0`0`0`0`0`0`0`0`7`0`7`0`0`0`0`0`0`0`0`0
FOR(i,0,m){`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`0`1`1`1`0`0`1`0`0`0`1`1`1`1`3`0`0`0`1`0`0`1`0`1
cin>>a;`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`0`4`0`0`0`0`0`0`0`0`0`0`5`0`5`0`0`0`0`1`0`1`0`1
if(i+1 == k){`FunctionDecl,false;ForStmt,false;IfStmt,false;`1`0`1`0`0`0`0`0`1`0`0`0`3`0`1`2`1`1`0`1`0`0`0`0`0`0`2`0`2`0`0`0`2`0`0`2`0`0
p-=--a;`FunctionDecl,false;ForStmt,false;IfStmt,false;`1`0`1`0`0`0`0`0`1`0`0`0`3`0`1`2`0`0`0`0`0`0`0`0`0`0`2`0`2`0`0`0`0`1`1`2`0`0
s+=a;`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`0`2`0`0`0`0`0`0`0`0`0`0`2`0`2`0`0`0`0`0`1`1`0`0
p+=a;`FunctionDecl,false;ForStmt,false;`1`0`1`0`0`0`0`0`0`0`0`0`2`0`0`2`0`0`0`0`0`0`0`0`0`0`2`0`2`0`0`0`0`0`1`1`0`0
double q=c(s,n-1),pp=c(p,n-1),y=pp/q;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`6`2`2`0`0`0`0`0`0`0`3`8`1`12`0`2`2`3`0`0`3`0`0
cout<<fixed<<setprecision(11);`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`5`0`5`0`0`1`0`0`0`0`0`0
if(!q)`FunctionDecl,false;IfStmt,false;`1`0`0`0`0`0`0`0`1`0`0`0`2`0`2`1`0`0`0`1`0`0`0`0`0`0`1`0`1`0`0`0`0`1`0`1`0`0
y=1;`FunctionDecl,false;IfStmt,false;`1`0`0`0`0`0`0`0`1`0`0`0`2`0`2`1`1`1`0`0`0`0`0`0`0`0`1`0`1`0`0`0`1`0`0`1`0`0
y=1-y;`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`2`0`2`0`0`0`2`0`0`2`0`0
if(!y)`FunctionDecl,false;IfStmt,false;`1`0`0`0`0`0`0`0`1`0`0`0`2`0`2`1`0`0`0`1`0`0`0`0`0`0`1`0`1`0`0`0`0`1`0`1`0`1
cout<<-1;`FunctionDecl,false;IfStmt,false;`1`0`0`0`0`0`0`0`1`0`0`0`2`0`2`1`1`1`0`0`0`0`0`0`0`0`2`0`2`0`0`0`0`1`0`1`0`0
cout<<y;`FunctionDecl,false;IfStmt,false;`1`0`0`0`0`0`0`0`1`0`0`0`2`0`2`2`0`0`0`0`0`0`0`0`0`0`3`0`3`0`0`0`0`0`0`0`0`0
cout<<endl;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`1`0`0`0`0`0`0`0`0`0`0`3`0`3`0`0`0`0`0`0`0`0`0
system("pause");`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`0`0`0`1`0`1`0`0`0`0`0`0`0`1`0`1`0`0`1`0`0`0`0`0`1
st;`FunctionDecl,false;`1`0`0`0`0`0`0`0`0`0`0`0`1`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
|