-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVestigium.cpp
More file actions
29 lines (29 loc) · 786 Bytes
/
Vestigium.cpp
File metadata and controls
29 lines (29 loc) · 786 Bytes
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
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int test, count = 0;
cin >> test;
while(count != test){
int N, r = 0, c = 0, k = 0;
cin >> N;
int matrix[N][N];
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++){
cin >> matrix[i][j];
if(i == j) k += matrix[i][j];
}
}
for(int i = 0; i < N; i++){
set <int> s, s1;
for(int j = 0; j < N; j++){
s.insert(matrix[i][j]);
s1.insert(matrix[j][i]);
}
if(s.size() != N) r++;
if(s1.size() != N) c++;
}
count++;
cout << "Case #"<<count<<":"<<" "<<k<<" "<<r<<" "<<c<<endl;
}
}