-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathANARC08G.cpp
More file actions
58 lines (37 loc) · 1.35 KB
/
ANARC08G.cpp
File metadata and controls
58 lines (37 loc) · 1.35 KB
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
53
54
55
56
57
58
#include<iostream>
#include<stdio.h>
#include<cstdlib>
using namespace std;
int main()
{
int count=0;
while(true)
{
int t;
count++;
scanf("%d",&t);
if(t==0)
break;
int a[t][t];
long long sum=0;
for(int i=0;i<t;i++)
for(int j=0;j<t;j++)
{
scanf("%d",&a[i][j]);
sum=sum+a[i][j];
}
long long sum2=0;
for(int i=0;i<t;i++)
{
long long k=0;
for(int j=0;j<t;j++)
k=k+a[i][j];
for(int j=0;j<t;j++)
k=k-a[j][i];
sum2=sum2+abs(k);
}
printf("%d. %lld %lld\n",count,sum,sum2/2);
}
system ("pause");
return 0;
}