Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.002 s | 0 KBi |
#2 |
Correcto
|
0.001 s | 0 KBi |
#3 |
Correcto
|
0.002 s | 0 KBi |
#4 |
Correcto
|
0.003 s | 1 KBi |
#5 |
Correcto
|
0.002 s | 0 KBi |
#6 |
Correcto
|
0.001 s | 0 KBi |
#7 |
Correcto
|
0.003 s | 3 KBi |
#8 |
Correcto
|
0.001 s | 0 KBi |
#9 |
Correcto
|
0.002 s | 0 KBi |
#10 |
Correcto
|
0.006 s | 63 KBi |
#11 |
Correcto
|
0.001 s | 0 KBi |
#12 |
Correcto
|
0.001 s | 0 KBi |
#13 |
Correcto
|
0.002 s | 0 KBi |
#14 |
Correcto
|
0.001 s | 0 KBi |
#15 |
Correcto
|
0.002 s | 0 KBi |
#16 |
Correcto
|
0.003 s | 0 KBi |
#17 |
Correcto
|
0.002 s | 0 KBi |
#18 |
Correcto
|
0.003 s | 0 KBi |
#19 |
Correcto
|
0.003 s | 0 KBi |
#20 |
Correcto
|
0.002 s | 0 KBi |
#include <bits/stdc++.h> using namespace std; int arr[100]; int main(){ int n, c, r, lr = 0, d1 = 0, d2 = 0; cin >> n; for( int i = 0; i < n ; i++){ r = 0; for( int j = 0; j < n ; j++){ cin >> c; r += c; arr[j] += c; if(i == n-1 && arr[j] != lr){ cout << "No"; exit(0); }if(i == j) d1 += c; if(n-j-1 == i) d2 += c; } if(i == 0) lr = r; if(lr != r){ cout << "No"; exit(0); } } if(d1 != lr || d2 != lr) cout << "No"; else cout << "Yes"; }