PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
y_true = [int(x) for x in input().split()]
y_pred = [int(x) for x in input().split()]
import numpy as np
out = np.array([[0,0], [0,0]])
np_true = np.array(y_true)
np_pred = np.array(y_pred)
np_sum = np_true + np_pred
np_diff = np_true - np_pred
out[0][0] = np.count_nonzero(np_sum == 2)
out[1][1] = np.count_nonzero(np_sum == 0)
out[0][1] = np.count_nonzero(np_diff == -1)
out[1][0] = np.count_nonzero(np_diff == 1)
print(out.astype(np.float))
#BINaRY DISORDER
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run