Created
December 10, 2014 05:00
-
-
Save vikhyat/835d547fdda1a800ca1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define eq(X, a) ((X[0] == a[0]) && (X[1] == a[1])) | |
main() { | |
int t; | |
float tp, tn, fp, fn, p, r; | |
tp = tn = fp = fn = 0; | |
char c[3]; | |
scanf("%d\n", &t); | |
while (t--) { | |
gets(c); | |
if (eq(c, "++")) tp++; | |
if (eq(c, "+-")) fn++; | |
if (eq(c, "-+")) fp++; | |
if (eq(c, "--")) tn++; | |
} | |
p = tp / (tp + fp); | |
r = tp / (tp + fn); | |
printf("%.2f", 2*p*r / (p+r)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment