hiho week 275 register

Ended

Participants:51

Verdict:Accepted
Score:100 / 100
Submitted:2019-10-05 20:28:01

Lang:G++

Edit
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
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
 
int main(){
    char ch1, ch2;
    int n;
    double tp, fn, fp, tn, precision, recall, ans;
    while( cin >> n ){
        tp = 0.; fn = 0.;
        fp = 0.; tn = 0.;
        for(int i=0; i<n; ++i){
            cin >> ch1 >> ch2;
            if(ch1 == '+' && ch2 == '+'){
                tp += 1.;
            }else if(ch1 == '+' && ch2 == '-'){
                fn += 1.;
            }else if(ch1 == '-' && ch2 == '+'){
                fp += 1.;
            }else if(ch1 == '-' && ch2 == '-'){
                tn += 1.;
            }
        }
        if( abs(tp + fp ) <= 1e-6){
            precision = 1;
        } else {
            precision = tp/(tp + fp);
        }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX