-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathVestigium.cpp
More file actions
52 lines (44 loc) · 859 Bytes
/
Vestigium.cpp
File metadata and controls
52 lines (44 loc) · 859 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// It's gonna End soon , sooner than it started .
#include "bits/stdc++.h"
#define pb push_back
using ll = long long;
using namespace std;
#define endl "\n";
int x = 1;
void D(){
ll n ; cin>>n;
ll k=0 , r=0, c=0;
ll a[n][n];
for(ll i =0;i<n;i++) {
unordered_set<ll>s;
for(ll j =0 ;j<n;j++){
cin>>a[i][j];
s.insert(a[i][j]);
if(i==j) k+=a[i][j];
}
r+=((ll)s.size() != n);
}
for(ll i =0;i<n;i++) {
unordered_set<ll>s;
for(ll j =0 ;j<n;j++){
s.insert(a[j][i]);
}
c+=((ll)s.size() != n);
}
cout<<"Case #"<<x<<": "<<k<<" "<<r<<" "<<c<<endl;
x++;
}
int main(int argc, char const *argv[])
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cout.precision(0);
cout<<fixed;
ll n , m,k ,pt(0),ct(0) ,x,y;
ll t =1;
cin>>t;
while(t--){
D();
}
}