Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#2 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#3 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#4 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#5 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#6 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#7 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#8 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#9 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#10 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#11 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#12 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#13 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#14 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#15 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#16 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#17 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#18 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#19 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
||
#20 |
Error de compilación
main.cpp:45:13: error: use of undeclared identifier 'col' if(cols[col]!=magic){ ^ 1 error generated. |
#include <iostream> #include <vector> using namespace std; int main() { int n, sum, magic=-1; cin >> n; int square[n][n]; vector<int> cols(n, 0); vector<int> rows(n, 0); int diag1=0, diag2=0; for(int row=0;row<n;row++){ for(int col=0;col<n;col++){ cin >> square[row][col]; int current = square[row][col]; cols[col] += current; rows[row] += current; if(row==col){ diag1+=current; } if(col== (n-1-row) ){ diag2+=current; } } } magic = diag1; if(magic != diag2){ cout << "No"; return 0; } for(int row=0;row<n;row++){ if(rows[row]!=magic){ cout << "No"; return 0; } if(cols[col]!=magic){ cout << "No"; return 0; } } cout << "Yes"; }