Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- long long n, A[105][105], a[105], res;
- int main() {
- cin >> n;
- for(int i = 1; i <= n; i ++)
- for(int j = 1; j <= n; j ++)
- cin >> A[i][j];
- for(int i = 1; i <= n; i ++)
- cin >> a[i];
- for(int i = 1; i <= n; i ++){
- for(int j = 1; j <= n; j ++){
- if(A[i][j] == 1)
- if(a[i] != a[j]) res ++;
- }
- }
- cout << res / 2 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement